Class AbstractService
java.lang.Object
com.priint.pubserver.plugin.PluginControlDefault
com.priint.pubserver.entitydata.service.AbstractService
- All Implemented Interfaces:
com.priint.pubserver.plugin.interfaces.PluginControl
- Direct Known Subclasses:
ConnectorService,DataProviderService,EntityManagerService,EntityModelService,PushService,PushServicePlugin
public abstract class AbstractService
extends com.priint.pubserver.plugin.PluginControlDefault
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIntentionally using the HTTP equivalent code 409 (Conflict).static final intIntentionally using the HTTP equivalent code 404 (Not Found).protected jakarta.servlet.http.HttpServletRequestprotected jakarta.servlet.http.HttpServletResponseprotected static org.slf4j.Loggerprotected PluginLibprotected static final Stringstatic final StringUsed as wildcard character for ConnectorEntityId and ResultType. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclean(com.priint.pubserver.plugin.entitydata.EntityData item) protected voidprotected StringconnectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity) protected com.priint.pubserver.plugin.entitydata.ConnectorEntityconnectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, String instance, String parentIdentifier) protected StringconnectorEntityFromRequest(String connectorEntity) protected com.priint.pubserver.plugin.entitydata.ConnectorEntityconnectorEntityFromRequest(String connectorEntityId, String instance, String parentIdentifier) protected com.priint.pubserver.plugin.entitydata.Contextprotected static com.priint.pubserver.plugin.entitydata.ContextcontextFromListField(jakarta.servlet.http.HttpServletRequest httpServletRequest) Example?context=language:deu&context=country:DE&context=assortment:0815protected static com.priint.pubserver.plugin.entitydata.EntityItemfillUpdateItem(com.priint.pubserver.plugin.entitydata.EntityData expectedItem, List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems) protected static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4UpdatefillUpdateRecords(String instance, com.priint.pubserver.plugin.entitydata.EntityData expectedItem, List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems) static MethodfindMethod(Class<? extends com.priint.pubserver.plugin.entitydata.EntityData> clazz, String property) static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushDatafromEntityDataList(List<? extends com.priint.pubserver.plugin.entitydata.EntityData> list) Converts a list of EntityData to a push data object.static com.priint.pubserver.plugin.entitydata.DatafromEntityDataList(List<? extends com.priint.pubserver.plugin.entitydata.EntityData> list, com.priint.pubserver.plugin.entitydata.Data data) Converts a list of EntityData to a push data object.protected <T> TlookupBean(String jndiName, Class<T> clazz) protected com.priint.pubserver.plugin.interfaces.ConnectorRemotelookupConnector(String mappedName, String instanceName) protected com.priint.pubserver.plugin.interfaces.EntityManagerRemoteprotected com.priint.pubserver.plugin.interfaces.ConnectorPersistLocallookupPersistConnector(String mappedName, String instanceName) protected <T> TlookupPlugin(String mappedName, String instanceName, Class<T> type) protected static <T> TlookupPluginByJndi(String jndiName, String mappedName, String instanceName, Class<T> clazz) protected <T> TlookupPluginByPluginManager(String sessionId, String mappedName, String instanceName, Class<T> clazz) protected Objectprotected com.priint.pubserver.plugin.interfaces.PublishingManagementConnectorlookupPublishingManagementConnector(String mappedName, String instanceName) static voidpreProcessData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Process data object with all embedded entitydata recursively. Add origin (if missing).static voidsetConnectorEntity(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, com.priint.pubserver.plugin.entitydata.EntityData entityData) static voidsetConnectorEntity(String instance, com.priint.pubserver.plugin.entitydata.EntityData entityData) static List<com.priint.pubserver.plugin.entitydata.EntityData>toEntityDataList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityData (for later update).toEntityDataMap(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Create a map of entity data identified by key [className+identifier].static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecordtoEntityDataRecord(com.priint.pubserver.plugin.entitydata.EntityData item) Creates an EntityDataRecord (for delete) from an EntityData item (like Bucket, Cord, etc).static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4UpdatetoEntityDataRecord4Update(com.priint.pubserver.plugin.entitydata.EntityData entityData) static List<com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update>toEntityDataRecord4UpdateList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord4Update.static List<com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord>toEntityDataRecordList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord (for delete).static com.priint.pubserver.plugin.entitydata.EntityItemtoEntityItem(com.priint.pubserver.plugin.entitydata.EntityData entityData, com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushCommand command) Creates an EntityDataRecord (for delete) from an EntityData item (like Bucket, Cord, etc).static List<com.priint.pubserver.plugin.entitydata.EntityItem>toEntityItem4UpdateList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord4Update.static com.priint.pubserver.plugin.entitydata.EntityItemtoEntityItemForUpdate(com.priint.pubserver.plugin.entitydata.EntityData entityData) static List<com.priint.pubserver.plugin.entitydata.EntityItem>toEntityItemList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord (for delete).static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushDatatoPushData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData insertData, com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData intoData) Methods inherited from class com.priint.pubserver.plugin.PluginControlDefault
afterCreateConfigurations, afterDeleteConfigurations, afterUpdateConfigurations, createConfiguration, deleteConfigurations, getSession, getSessionId, initInstance, loadServerConfig, ping, readSessionAttribute, updateConfigurations, writeSessionAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.priint.pubserver.plugin.interfaces.PluginControl
validateConfigurations
-
Field Details
-
WILDCARD
Used as wildcard character for ConnectorEntityId and ResultType. Will be replaced by null in connector queries.- See Also:
-
ERR_OBJECT_ALREADY_EXISTS
public static final int ERR_OBJECT_ALREADY_EXISTSIntentionally using the HTTP equivalent code 409 (Conflict).
This will generate a 422 (Unprocessable Entity) on a rest service.
This is indicating that client should not retry the request until data have been fixed.- See Also:
-
ERR_OBJECT_DOES_NOT_EXIST
public static final int ERR_OBJECT_DOES_NOT_EXISTIntentionally using the HTTP equivalent code 404 (Not Found).
This will generate a 422 (Unprocessable Entity) on a rest service.
This is indicating that client should not retry the request until data have been fixed.- See Also:
-
logger
protected static org.slf4j.Logger logger -
PUBLISHINGHUBDB_MAPPED_NAME
- See Also:
-
httpServletRequest
@Context protected jakarta.servlet.http.HttpServletRequest httpServletRequest -
httpServletResponse
@Context protected jakarta.servlet.http.HttpServletResponse httpServletResponse -
pluginLibrary
-
-
Constructor Details
-
AbstractService
public AbstractService()
-
-
Method Details
-
fillUpdateItem
protected static com.priint.pubserver.plugin.entitydata.EntityItem fillUpdateItem(com.priint.pubserver.plugin.entitydata.EntityData expectedItem, List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems) throws com.priint.pubserver.plugin.exception.ConnectorException - Throws:
com.priint.pubserver.plugin.exception.ConnectorException
-
fillUpdateRecords
protected static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update fillUpdateRecords(String instance, com.priint.pubserver.plugin.entitydata.EntityData expectedItem, List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems) throws com.priint.pubserver.plugin.exception.ConnectorException, ServiceException - Throws:
com.priint.pubserver.plugin.exception.ConnectorExceptionServiceException
-
findMethod
public static Method findMethod(Class<? extends com.priint.pubserver.plugin.entitydata.EntityData> clazz, String property) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
fromEntityDataList
public static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData fromEntityDataList(List<? extends com.priint.pubserver.plugin.entitydata.EntityData> list) Converts a list of EntityData to a push data object.- Parameters:
list- of any EntityData- Returns:
-
fromEntityDataList
public static com.priint.pubserver.plugin.entitydata.Data fromEntityDataList(List<? extends com.priint.pubserver.plugin.entitydata.EntityData> list, com.priint.pubserver.plugin.entitydata.Data data) Converts a list of EntityData to a push data object.- Parameters:
list- of any EntityDatadata- target object to take the EntityData items (should not be null)- Returns:
- Since:
- 4.1.0 planning supported
-
lookupPluginByJndi
protected static <T> T lookupPluginByJndi(String jndiName, String mappedName, String instanceName, Class<T> clazz) throws NamingException, com.priint.pubserver.exception.PubServerException - Throws:
NamingExceptioncom.priint.pubserver.exception.PubServerException
-
preProcessData
public static void preProcessData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Process data object with all embedded entitydata recursively.- Add origin (if missing).
- Set context and context identifier (if missing).
- Parameters:
data-- Since:
- 4.1.0 plannings attribute supported
-
toEntityDataList
public static List<com.priint.pubserver.plugin.entitydata.EntityData> toEntityDataList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityData (for later update).- Returns:
- Since:
- 4.1.0 plannings attribute supported
-
toEntityDataMap
public static Map<String,com.priint.pubserver.plugin.entitydata.EntityData> toEntityDataMap(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Create a map of entity data identified by key [className+identifier]. Creation order of the entries reflects proposed insertion order.Entries with key but empty value are expected to already exist in the data target.
- Returns:
- Since:
- 4.1.0 plannings attribute supported
-
toEntityItem
public static com.priint.pubserver.plugin.entitydata.EntityItem toEntityItem(com.priint.pubserver.plugin.entitydata.EntityData entityData, com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushCommand command) Creates an EntityDataRecord (for delete) from an EntityData item (like Bucket, Cord, etc).- Parameters:
entityData-command-- Returns:
EntityItem
-
toEntityDataRecord
public static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord toEntityDataRecord(com.priint.pubserver.plugin.entitydata.EntityData item) Creates an EntityDataRecord (for delete) from an EntityData item (like Bucket, Cord, etc).- Parameters:
item-- Returns:
-
toEntityItemForUpdate
public static com.priint.pubserver.plugin.entitydata.EntityItem toEntityItemForUpdate(com.priint.pubserver.plugin.entitydata.EntityData entityData) - Parameters:
entityData-- Returns:
-
toEntityDataRecord4Update
public static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update toEntityDataRecord4Update(com.priint.pubserver.plugin.entitydata.EntityData entityData) - Parameters:
entityData-- Returns:
-
toEntityItem4UpdateList
public static List<com.priint.pubserver.plugin.entitydata.EntityItem> toEntityItem4UpdateList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord4Update.- Returns:
-
toEntityDataRecord4UpdateList
public static List<com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update> toEntityDataRecord4UpdateList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord4Update.- Returns:
-
toEntityItemList
public static List<com.priint.pubserver.plugin.entitydata.EntityItem> toEntityItemList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord (for delete).- Parameters:
pushData-- Returns:
ListofEntityItem
-
toEntityDataRecordList
public static List<com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord> toEntityDataRecordList(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData pushData) Converts the current PushData object into a list if EntityDataRecord (for delete).- Returns:
-
toPushData
public static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData toPushData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData insertData, com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData intoData) - Returns:
- Since:
- 4.1.0 plannings attribute supported
-
connectorEntityFromRequest
-
connectorEntityFromRequest
-
connectorEntityFromRequest
protected String connectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity) -
connectorEntityFromRequest
-
contextFromListField
protected com.priint.pubserver.plugin.entitydata.Context contextFromListField() -
contextFromListField
protected static com.priint.pubserver.plugin.entitydata.Context contextFromListField(jakarta.servlet.http.HttpServletRequest httpServletRequest) Example?context=language:deu&context=country:DE&context=assortment:0815- Returns:
-
lookupConnector
protected com.priint.pubserver.plugin.interfaces.ConnectorRemote lookupConnector(String mappedName, String instanceName) throws ServiceException - Throws:
ServiceException
-
lookupEntityManager
protected com.priint.pubserver.plugin.interfaces.EntityManagerRemote lookupEntityManager() throws ServiceException- Throws:
ServiceException
-
lookupPublishingManagementConnector
protected com.priint.pubserver.plugin.interfaces.PublishingManagementConnector lookupPublishingManagementConnector(String mappedName, String instanceName) throws ServiceException - Throws:
ServiceException
-
lookupPersistConnector
protected com.priint.pubserver.plugin.interfaces.ConnectorPersistLocal lookupPersistConnector(String mappedName, String instanceName) throws ServiceException - Throws:
ServiceException
-
lookupBean
- Throws:
ServiceException
-
lookupPlugin
protected <T> T lookupPlugin(String mappedName, String instanceName, Class<T> type) throws ServiceException - Throws:
ServiceException
-
lookupPluginByPluginManager
protected <T> T lookupPluginByPluginManager(String sessionId, String mappedName, String instanceName, Class<T> clazz) throws com.priint.pubserver.exception.PubServerException - Throws:
com.priint.pubserver.exception.PubServerException
-
lookupPublishingHubDBConnector
- Throws:
ServiceException
-
setConnectorEntity
public static void setConnectorEntity(String instance, com.priint.pubserver.plugin.entitydata.EntityData entityData) -
setConnectorEntity
public static void setConnectorEntity(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, com.priint.pubserver.plugin.entitydata.EntityData entityData) -
clean
-
clean
protected void clean(com.priint.pubserver.plugin.entitydata.EntityData item)
-