Interface ConnectorPersistRemote
-
- All Superinterfaces:
PluginControl
- All Known Subinterfaces:
ConnectorPersistLocal
- All Known Implementing Classes:
AbstractConnector
public interface ConnectorPersistRemote extends PluginControl
Interface for connectors that support to modify data in the content system..- Since:
- 4.0.3, 4.0.5 JAXB serialization annotations for EntityDataRecord and EntityDataRecord4Update, 4.1.6 New methods to support insert, update, delete by EntityItem instances. Deprecated old methods using EntityDataRecord or EntityDataRecord4Update and other stuff related to PublishingHubDBConnector.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classConnectorPersistRemote.EntityDataRecordDeprecated.since 4.1.6 please useEntityIteminsteadstatic classConnectorPersistRemote.EntityDataRecord4UpdateDeprecated.since 4.1.6 please useEntityIteminsteadstatic classConnectorPersistRemote.PushCommandrequest command for the entity data itemstatic classConnectorPersistRemote.PushDataData object for push service.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.List<EntityItem>bulkInsert(java.util.List<EntityItem> entityItems)java.util.List<EntityItem>bulkUpsert(java.util.List<EntityItem> entityItems)java.util.List<java.lang.Object>callMethodByName(java.lang.String methodName, java.lang.Class<?>[] argTypes, java.lang.Object[] argValues)Deprecated.since 4.1.6 please use method specific to the connector implementationjava.util.List<EntityItem>commitItems(java.util.List<EntityItem> entityItems)intexecuteNativeCall(java.lang.String call)Deprecated.since 4.1.6 Please avoid this method for security reasons.<T,J>
java.util.List<T>executeNativeQuery(java.lang.String call, java.lang.Class<J> clazz)Deprecated.since 4.1.6 Please avoid this method for security reasons.java.util.List<Context>getContextList()Retrieves a list of existing contexts in the data source.java.lang.StringgetNextIdentifier(java.lang.Class<?> clazz)Deprecated.since 4.1.6 please use method specific to the connector implementationjava.util.List<EntityData>getObjectList(java.util.Map<java.lang.String,java.lang.Object> Params, java.lang.String NQN, java.lang.Class<EntityData> clazz)Deprecated.since 4.1.6 please use method specific to the connector implementationjava.util.List<java.lang.String>getOrigins()Get a list of origins existing in the data.ProposedEntitiesgetProposedEntities(java.lang.String origin)Infer entity model base data from data source.voidinsert(EntityData entityData)Deprecated.since 4.1.6 please usepersist(EntityItem)insteadbooleanmerge(EntityItem entityItem)Method performs an update of given record.
Record which is to be updated must exist in database.booleanmerge(ConnectorPersistRemote.EntityDataRecord4Update entityDataRecord4Update)Deprecated.since 4.1.6 please usemerge(EntityItem)booleanmergeItems(java.util.List<EntityItem> entityItems)Method performsmerge(EntityItem)on the given list of records.
Listed records must exists in databasebooleanmergeList(java.util.List<ConnectorPersistRemote.EntityDataRecord4Update> entityDataRecord4UpdateList)Deprecated.since 4.1.6 please usemergeItems(List)EntityDatapersist(EntityData entityData)Deprecated.since 4.1.6 please usepersist(EntityItem)insteadEntityItempersist(EntityItem entityItem)Performs an insert of a new record.java.util.List<EntityItem>persistItems(java.util.List<EntityItem> entityItems)Performspersist(EntityItem)on each item of the given list of records.
Listed records must not exists in database.java.util.List<EntityData>persistList(java.util.List<EntityData> entityDataList)Deprecated.since 4.1.6 please usepersistItems(List)java.util.List<EntityItem>persistListFromSerializedFiles(java.util.List<java.lang.String> serFiles)Deprecated.since 4.1.6 please use EntityDataService to import files (as XML or JSON).booleanremove(EntityItem entityItem)Performs record deletion from data source.booleanremove(ConnectorPersistRemote.EntityDataRecord entityDataRecord)Deprecated.since 4.1.6 please usemergeItems(List)booleanremoveItems(java.util.List<EntityItem> entityItems)Performsremove(EntityItem)on the given list of records.booleanremoveList(java.util.List<ConnectorPersistRemote.EntityDataRecord> entityDataRecordList)Deprecated.since 4.1.6 please useremoveItems(List)voidupdate(ConnectorPersistRemote.EntityDataRecord4Update entityDataRecord4Update)Deprecated.since 4.1.6 please usemerge(EntityItem)instead-
Methods inherited from interface com.priint.pubserver.plugin.interfaces.PluginControl
afterCreateConfigurations, afterDeleteConfigurations, afterUpdateConfigurations, createConfiguration, deleteConfigurations, initInstance, loadServerConfig, ping, updateConfigurations, validateConfigurations
-
-
-
-
Method Detail
-
persist
EntityItem persist(EntityItem entityItem) throws ConnectorException
Performs an insert of a new record. IfBucketis to be inserted, and object holds the structure, the whole structure will be inserted including: subBuckets, KeyValues, Texts, Prices, MediaAssets, MediaObjects, Context
Record which is to be inserted must not exists in database, the only one exception isContext. If existing context will be passed as a part of the structure, the existing one will be used.Checking the existence of
Context- When identifier of Context is passed id will be used for checking
- When no identifier is provided it will be created based on language and country, and then used for existence checking
- Parameters:
entityItem- The structure containing the entity data item in "value" field.- Returns:
- inserted object or null, if fails.
- Throws:
ConnectorException- Since:
- 4.1.6
-
persist
@Deprecated EntityData persist(EntityData entityData) throws ConnectorException
Deprecated.since 4.1.6 please usepersist(EntityItem)instead- Throws:
ConnectorException- Since:
- 4.0.0
-
persistItems
java.util.List<EntityItem> persistItems(java.util.List<EntityItem> entityItems) throws ConnectorException
Performspersist(EntityItem)on each item of the given list of records.
Listed records must not exists in database.The operation may or may not be transactional safe depending on the connector implementation. Please see the connector documentation.
- Parameters:
entityItems- list ofEntityItem. Each item will contain the actual entity data in its "value" field.- Returns:
- list of inserted objects or empty list, if it fails.
- Throws:
ConnectorException- Since:
- 4.1.6
-
persistList
@Deprecated java.util.List<EntityData> persistList(java.util.List<EntityData> entityDataList) throws ConnectorException
Deprecated.since 4.1.6 please usepersistItems(List)- Throws:
ConnectorException- Since:
- 4.0.4
-
persistListFromSerializedFiles
@Deprecated java.util.List<EntityItem> persistListFromSerializedFiles(java.util.List<java.lang.String> serFiles) throws ConnectorException
Deprecated.since 4.1.6 please use EntityDataService to import files (as XML or JSON).- Parameters:
serFiles-- Returns:
- entityItems
- Throws:
ConnectorException- Since:
- 4.0.4
-
merge
boolean merge(EntityItem entityItem) throws ConnectorException
Method performs an update of given record.
Record which is to be updated must exist in database.- Parameters:
entityItem- structure of information about record to be modified- Returns:
- true if update succeed
- Throws:
ConnectorException- Since:
- 4.1.6
-
merge
@Deprecated boolean merge(ConnectorPersistRemote.EntityDataRecord4Update entityDataRecord4Update) throws ConnectorException
Deprecated.since 4.1.6 please usemerge(EntityItem)- Throws:
ConnectorException- Since:
- 4.0.0
-
mergeItems
boolean mergeItems(java.util.List<EntityItem> entityItems) throws ConnectorException
Method performsmerge(EntityItem)on the given list of records.
Listed records must exists in database- Parameters:
entityItems- list of items containing either a value or a push map to update fields of the underlying item.- Returns:
- true if update succeed
- Throws:
ConnectorException- Since:
- 4.1.6
-
mergeList
@Deprecated boolean mergeList(java.util.List<ConnectorPersistRemote.EntityDataRecord4Update> entityDataRecord4UpdateList) throws ConnectorException
Deprecated.since 4.1.6 please usemergeItems(List)- Throws:
ConnectorException- Since:
- 4.0.0
-
remove
boolean remove(EntityItem entityItem) throws ConnectorException
Performs record deletion from data source.It is up to the connector how this deletion is implemented. E.g. how related objects are also removed. The only requirements are: (1) A persist of the same item after a remove should be successful (other things being equal). (2) A getByIdentifier after a remove should return an empty list.
Depending on the connector implementation different handling of exceptional state may occur. E.g. you may get ConnectorException encapsulating an INDEX VIOLATION.
- Parameters:
entityItem- information about entity to be processed- Returns:
- true, if remove succeed.
- Throws:
ConnectorException- Since:
- 4.1.6
-
remove
boolean remove(ConnectorPersistRemote.EntityDataRecord entityDataRecord) throws ConnectorException
Deprecated.since 4.1.6 please usemergeItems(List)- Throws:
ConnectorException- Since:
- 4.0.0
-
removeItems
boolean removeItems(java.util.List<EntityItem> entityItems) throws ConnectorException
Performsremove(EntityItem)on the given list of records.- Parameters:
entityItems- list of information about entities to be removed.- Returns:
- true on success
- Throws:
ConnectorException- Since:
- 4.1.6
-
removeList
@Deprecated boolean removeList(java.util.List<ConnectorPersistRemote.EntityDataRecord> entityDataRecordList) throws ConnectorException
Deprecated.since 4.1.6 please useremoveItems(List)- Throws:
ConnectorException- Since:
- 4.0.0
-
commitItems
java.util.List<EntityItem> commitItems(java.util.List<EntityItem> entityItems) throws ConnectorException
Performs the command defined for eachEntityIteminListon theEntityItem.The details of this operation may differ between connectors.
(1) the operation as a whole may or may not be transactional safe.
(2) the single operations may be chunked (by action type or number of items) and executed in "batch" mode.- Parameters:
entityItems- List ofEntityItemwith command to be performed.- Returns:
- List of items
EntityItemwith status and message as created by insert, update or delete operation. - Throws:
ConnectorException
-
bulkInsert
java.util.List<EntityItem> bulkInsert(java.util.List<EntityItem> entityItems) throws ConnectorException
Performs the insert command for eachEntityIteminListon theEntityItem.The details of this operation may differ between connectors.
(1) the operation as a whole may be transactional safe.- Parameters:
entityItems- List ofEntityItemwith command to be performed.- Returns:
- List of items
EntityItemwith status and message as created by insert - Throws:
ConnectorException
-
bulkUpsert
java.util.List<EntityItem> bulkUpsert(java.util.List<EntityItem> entityItems) throws ConnectorException
Performs the upsert command for eachEntityIteminListon theEntityItem.The details of this operation may differ between connectors.
(1) the operation as a whole may be transactional safe.- Parameters:
entityItems- List ofEntityItemwith command to be performed.- Returns:
- List of items
EntityItemwith status and message as created by insert - Throws:
ConnectorException
-
getNextIdentifier
@Deprecated java.lang.String getNextIdentifier(java.lang.Class<?> clazz) throws ConnectorExceptionDeprecated.since 4.1.6 please use method specific to the connector implementation- Parameters:
clazz-- Returns:
- identifier
- Throws:
ConnectorException
-
executeNativeCall
@Deprecated int executeNativeCall(java.lang.String call) throws ConnectorExceptionDeprecated.since 4.1.6 Please avoid this method for security reasons.FOR INTERNAL USE ONLY.
Execute a native sql call like
"update con_bucket set identifier = 'Y' where identifier = 'X';"- Parameters:
call- the native sql-command to run- Returns:
- the number of affected entities
- Throws:
ConnectorException- Since:
- 4.0.3, 4.1 added explicit exception handling
-
executeNativeQuery
@Deprecated <T,J> java.util.List<T> executeNativeQuery(java.lang.String call, java.lang.Class<J> clazz) throws ConnectorExceptionDeprecated.since 4.1.6 Please avoid this method for security reasons.FOR INTERNAL USE ONLY.
Execute a native sql query like
"select * from con_bucket;"- Parameters:
call- the native sql-query to runclazz- the corresponding entity class of the returned data- Returns:
- a List of the found entity data
- Throws:
ConnectorException- Since:
- 4.0.0, 4.1 added explicit exception handling
-
getContextList
java.util.List<Context> getContextList() throws NotImplementedException, DataSourceException, ConnectorException
Retrieves a list of existing contexts in the data source.- Returns:
- list of contexts
- Throws:
NotImplementedExceptionDataSourceExceptionConnectorException- Since:
- 4.0.0
-
getObjectList
@Deprecated java.util.List<EntityData> getObjectList(java.util.Map<java.lang.String,java.lang.Object> Params, java.lang.String NQN, java.lang.Class<EntityData> clazz) throws ConnectorException
Deprecated.since 4.1.6 please use method specific to the connector implementationTemporary method to created complicated statements. It will be used only in Import Methods!- Parameters:
Params-NQN-clazz-- Returns:
- Throws:
ConnectorException
-
callMethodByName
@Deprecated java.util.List<java.lang.Object> callMethodByName(java.lang.String methodName, java.lang.Class<?>[] argTypes, java.lang.Object[] argValues) throws ConnectorExceptionDeprecated.since 4.1.6 please use method specific to the connector implementationThis method provides a reflection call to methods of JPAUtils. All static methods of JPAUtils can be called using a reflection call approach please note that due to some casting and compilation issue, argTypes[0] will always be PublishingHubDBConnector.class and argValues[0]= this Other argType and argValue can be passed based on the method programmer wants to call from JPAUtils.java- Parameters:
methodName- - method name to call using reflectionargTypes- - argTypes of called method parametersargValues- - argValues of called methods- Returns:
- if called method returns anything then the same will be added to List
- Throws:
ConnectorException
-
insert
@Deprecated void insert(EntityData entityData) throws ConnectorException
Deprecated.since 4.1.6 please usepersist(EntityItem)instead- Parameters:
entityData-- Throws:
ConnectorException
-
update
@Deprecated void update(ConnectorPersistRemote.EntityDataRecord4Update entityDataRecord4Update) throws ConnectorException
Deprecated.since 4.1.6 please usemerge(EntityItem)instead- Parameters:
entityDataRecord4Update-- Throws:
ConnectorException
-
getProposedEntities
ProposedEntities getProposedEntities(java.lang.String origin) throws ConnectorException
Infer entity model base data from data source.- Parameters:
origin-- Returns:
- The proposed entities.
- Throws:
ConnectorException- Since:
- 4.0.5
-
getOrigins
java.util.List<java.lang.String> getOrigins() throws ConnectorExceptionGet a list of origins existing in the data.An origin is typically something like a importId.
Implementation is connector specific. Most connectors will not support this and just return null or empty list.
- Returns:
- list of origins (or null or empty list)
- Throws:
ConnectorException
-
-