Interface ConnectorPersistRemote
- All Superinterfaces:
PluginControl
- All Known Subinterfaces:
ConnectorPersistLocal
- All Known Implementing Classes:
AbstractConnector
- 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 ClassesModifier and TypeInterfaceDescriptionstatic classDeprecated.static classDeprecated.since 4.1.6 please useEntityIteminsteadstatic enumrequest command for the entity data itemstatic classData object for push service. -
Method Summary
Modifier and TypeMethodDescriptionbulkInsert(List<EntityItem> entityItems) bulkUpsert(List<EntityItem> entityItems) callMethodByName(String methodName, Class<?>[] argTypes, Object[] argValues) Deprecated.since 4.1.6 please use method specific to the connector implementationcommitItems(List<EntityItem> entityItems) intexecuteNativeCall(String call) Deprecated.since 4.1.6 Please avoid this method for security reasons.<T,J> List<T> executeNativeQuery(String call, Class<J> clazz) Deprecated.since 4.1.6 Please avoid this method for security reasons.Retrieves a list of existing contexts in the data source.getNextIdentifier(Class<?> clazz) Deprecated.since 4.1.6 please use method specific to the connector implementationgetObjectList(Map<String, Object> Params, String NQN, Class<EntityData> clazz) Deprecated.since 4.1.6 please use method specific to the connector implementationGet a list of origins existing in the data.getProposedEntities(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(List<EntityItem> entityItems) Method performsmerge(EntityItem)on the given list of records.
Listed records must exists in databasebooleanmergeList(List<ConnectorPersistRemote.EntityDataRecord4Update> entityDataRecord4UpdateList) Deprecated.since 4.1.6 please usemergeItems(List)persist(EntityData entityData) Deprecated.since 4.1.6 please usepersist(EntityItem)insteadpersist(EntityItem entityItem) Performs an insert of a new record.persistItems(List<EntityItem> entityItems) Performspersist(EntityItem)on each item of the given list of records.
Listed records must not exists in database.persistList(List<EntityData> entityDataList) Deprecated.since 4.1.6 please usepersistItems(List)persistListFromSerializedFiles(List<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(List<EntityItem> entityItems) Performsremove(EntityItem)on the given list of records.booleanremoveList(List<ConnectorPersistRemote.EntityDataRecord> entityDataRecordList) Deprecated.since 4.1.6 please useremoveItems(List)voidupdate(ConnectorPersistRemote.EntityDataRecord4Update entityDataRecord4Update) Deprecated.since 4.1.6 please usemerge(EntityItem)insteadMethods inherited from interface com.priint.pubserver.plugin.interfaces.PluginControl
afterCreateConfigurations, afterDeleteConfigurations, afterUpdateConfigurations, createConfiguration, deleteConfigurations, initInstance, loadServerConfig, ping, updateConfigurations, validateConfigurations
-
Method Details
-
persist
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.since 4.1.6 please usepersist(EntityItem)instead- Throws:
ConnectorException- Since:
- 4.0.0
-
persistItems
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.since 4.1.6 please usepersistItems(List)- Throws:
ConnectorException- Since:
- 4.0.4
-
persistListFromSerializedFiles
@Deprecated List<EntityItem> persistListFromSerializedFiles(List<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
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
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(List<ConnectorPersistRemote.EntityDataRecord4Update> entityDataRecord4UpdateList) throws ConnectorException Deprecated.since 4.1.6 please usemergeItems(List)- Throws:
ConnectorException- Since:
- 4.0.0
-
remove
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
Deprecated.since 4.1.6 please usemergeItems(List)- Throws:
ConnectorException- Since:
- 4.0.0
-
removeItems
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(List<ConnectorPersistRemote.EntityDataRecord> entityDataRecordList) throws ConnectorException Deprecated.since 4.1.6 please useremoveItems(List)- Throws:
ConnectorException- Since:
- 4.0.0
-
commitItems
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
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
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.since 4.1.6 please use method specific to the connector implementation- Parameters:
clazz-- Returns:
- identifier
- Throws:
ConnectorException
-
executeNativeCall
Deprecated.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> List<T> executeNativeQuery(String call, Class<J> clazz) throws ConnectorException Deprecated.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
List<Context> getContextList() throws NotImplementedException, DataSourceException, ConnectorExceptionRetrieves a list of existing contexts in the data source.- Returns:
- list of contexts
- Throws:
NotImplementedExceptionDataSourceExceptionConnectorException- Since:
- 4.0.0
-
getObjectList
@Deprecated List<EntityData> getObjectList(Map<String, Object> Params, String NQN, Class<EntityData> clazz) throws ConnectorExceptionDeprecated.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 List<Object> callMethodByName(String methodName, Class<?>[] argTypes, Object[] argValues) throws ConnectorException Deprecated.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.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
Infer entity model base data from data source.- Parameters:
origin-- Returns:
- The proposed entities.
- Throws:
ConnectorException- Since:
- 4.0.5
-
getOrigins
Get 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
-
EntityIteminstead