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.PluginControlDefaultAbstractService is a base class that provides common functionality for services interacting with entity data. It includes utility methods for processing, converting, and managing entity data objects, as well as methods for looking up plugins and connectors. This class extendsPluginControlDefaultand is intended to be subclassed by specific service implementations.
-
-
Field Summary
Fields Modifier and Type Field Description static intERR_OBJECT_ALREADY_EXISTSIntentionally using the HTTP equivalent code 409 (Conflict).static intERR_OBJECT_DOES_NOT_EXISTIntentionally using the HTTP equivalent code 404 (Not Found).protected javax.servlet.http.HttpServletRequesthttpServletRequestThe HTTP servlet request object, used to access request-specific information such as headers, parameters, and attributes.protected javax.servlet.http.HttpServletResponsehttpServletResponseThe HTTP servlet response object, used to modify and send response-specific information such as headers, status codes, and output data.protected static org.slf4j.LoggerloggerLogger instance for logging messages and debugging information.protected PluginLibpluginLibraryThe library providing access to plugin management and related utilities.protected static java.lang.StringPUBLISHINGHUBDB_MAPPED_NAMEThe JNDI name for the Publishing Hub Database Connector.static java.lang.StringWILDCARDUsed as wildcard character for ConnectorEntityId and ResultType.
-
Constructor Summary
Constructors Constructor Description AbstractService()Default constructor for the AbstractService class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclean(com.priint.pubserver.plugin.entitydata.EntityData item)Cleans the connector entity from the item.protected voidclean(java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> items)Cleans the connector entity from the list of items.protected java.lang.StringconnectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity)Converts the connector entity from the request into a string representation.protected com.priint.pubserver.plugin.entitydata.ConnectorEntityconnectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, java.lang.String instance, java.lang.String parentIdentifier)Converts the connector entity from the request into a ConnectorEntity object.protected java.lang.StringconnectorEntityFromRequest(java.lang.String connectorEntity)Converts the connector entity from the request into a string representation.protected com.priint.pubserver.plugin.entitydata.ConnectorEntityconnectorEntityFromRequest(java.lang.String connectorEntityId, java.lang.String instance, java.lang.String parentIdentifier)Converts the connector entity from the request into a ConnectorEntity object.protected com.priint.pubserver.plugin.entitydata.ContextcontextFromListField()Retrieves the context from the HTTP servlet request.protected static com.priint.pubserver.plugin.entitydata.ContextcontextFromListField(javax.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, java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems)Creates an `EntityItem` for updating an existing entity.protected static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4UpdatefillUpdateRecords(java.lang.String instance, com.priint.pubserver.plugin.entitydata.EntityData expectedItem, java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems)Creates an `EntityDataRecord4Update` for updating an existing entity.static java.lang.reflect.MethodfindMethod(java.lang.Class<? extends com.priint.pubserver.plugin.entitydata.EntityData> clazz, java.lang.String property)Finds a method in the specified class that matches the given property name.static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushDatafromEntityDataList(java.util.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(java.util.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(java.lang.String jndiName, java.lang.Class<T> clazz)Looks up a bean by its JNDI name and casts it to the specified type.protected com.priint.pubserver.plugin.interfaces.ConnectorRemotelookupConnector(java.lang.String mappedName, java.lang.String instanceName)Looks up a connector by its mapped name and instance name.protected com.priint.pubserver.plugin.interfaces.EntityManagerRemotelookupEntityManager()Looks up a plugin by its mapped name and instance name.protected com.priint.pubserver.plugin.interfaces.ConnectorPersistLocallookupPersistConnector(java.lang.String mappedName, java.lang.String instanceName)Looks up a connector by its mapped name and instance name.protected <T> TlookupPlugin(java.lang.String mappedName, java.lang.String instanceName, java.lang.Class<T> type)Lookup a plugin by its mapped name and instance name.protected static <T> TlookupPluginByJndi(java.lang.String jndiName, java.lang.String mappedName, java.lang.String instanceName, java.lang.Class<T> clazz)Sets the connector entity for the given entity data.protected <T> TlookupPluginByPluginManager(java.lang.String sessionId, java.lang.String mappedName, java.lang.String instanceName, java.lang.Class<T> clazz)Lookup a plugin by its mapped name and instance name.protected java.lang.ObjectlookupPublishingHubDBConnector()Lookup the publishing hub database connector.protected com.priint.pubserver.plugin.interfaces.PublishingManagementConnectorlookupPublishingManagementConnector(java.lang.String mappedName, java.lang.String instanceName)Looks up a PublishingManagementConnector by its mapped name and instance name.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)Sets the connector entity for the given entity data.static voidsetConnectorEntity(java.lang.String instance, com.priint.pubserver.plugin.entitydata.EntityData entityData)Sets the connector entity for the given entity data.static java.util.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).static java.util.Map<java.lang.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].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)Converts an `EntityData` object into an `EntityDataRecord4Update` object.static java.util.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 java.util.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 of 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 `EntityItem` based on the given `EntityData` and `PushCommand`.static java.util.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)Converts an `EntityData` object into an `EntityItem` for update operations.static java.util.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)Merges two PushData objects into one.-
Methods inherited from class com.priint.pubserver.plugin.PluginControlDefault
afterCreateConfigurations, afterDeleteConfigurations, afterUpdateConfigurations, createConfiguration, deleteConfigurations, getSession, getSessionId, initInstance, loadServerConfig, ping, readSessionAttribute, updateConfigurations, writeSessionAttribute
-
-
-
-
Field Detail
-
WILDCARD
public static final java.lang.String WILDCARD
Used as wildcard character for ConnectorEntityId and ResultType. Will be replaced by null in connector queries.- See Also:
- Constant Field Values
-
ERR_OBJECT_ALREADY_EXISTS
public static final int ERR_OBJECT_ALREADY_EXISTS
Intentionally 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:
- Constant Field Values
-
ERR_OBJECT_DOES_NOT_EXIST
public static final int ERR_OBJECT_DOES_NOT_EXIST
Intentionally 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:
- Constant Field Values
-
logger
protected static org.slf4j.Logger logger
Logger instance for logging messages and debugging information. It uses the class name of the current class for context.
-
PUBLISHINGHUBDB_MAPPED_NAME
protected static final java.lang.String PUBLISHINGHUBDB_MAPPED_NAME
The JNDI name for the Publishing Hub Database Connector. This is used to map the connector to its corresponding local bean.- See Also:
- Constant Field Values
-
httpServletRequest
@Context protected javax.servlet.http.HttpServletRequest httpServletRequest
The HTTP servlet request object, used to access request-specific information such as headers, parameters, and attributes.
-
httpServletResponse
@Context protected javax.servlet.http.HttpServletResponse httpServletResponse
The HTTP servlet response object, used to modify and send response-specific information such as headers, status codes, and output data.
-
pluginLibrary
protected PluginLib pluginLibrary
The library providing access to plugin management and related utilities. Used for looking up and managing plugins within the application.
-
-
Method Detail
-
fillUpdateItem
protected static com.priint.pubserver.plugin.entitydata.EntityItem fillUpdateItem(com.priint.pubserver.plugin.entitydata.EntityData expectedItem, java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems) throws com.priint.pubserver.plugin.exception.ConnectorExceptionCreates an `EntityItem` for updating an existing entity. Validates that the `actualItems` list contains at least one item and compares it with the `expectedItem`.- Parameters:
expectedItem- the entity data expected to be updated.actualItems- the list of actual entity data items retrieved from the database.- Returns:
- an `EntityItem` instance prepared for update.
- Throws:
com.priint.pubserver.plugin.exception.ConnectorException- if the `actualItems` list is empty or null.
-
fillUpdateRecords
protected static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update fillUpdateRecords(java.lang.String instance, com.priint.pubserver.plugin.entitydata.EntityData expectedItem, java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> actualItems) throws com.priint.pubserver.plugin.exception.ConnectorException, ServiceExceptionCreates an `EntityDataRecord4Update` for updating an existing entity. Validates that the `actualItems` list contains at least one item and compares it with the `expectedItem`. Populates the update record with the differences between the actual and expected items.- Parameters:
instance- the instance identifier for the connector entity.expectedItem- the entity data expected to be updated.actualItems- the list of actual entity data items retrieved from the database.- Returns:
- an `EntityDataRecord4Update` instance prepared for update.
- Throws:
com.priint.pubserver.plugin.exception.ConnectorException- if the `actualItems` list is empty or null.ServiceException- if a property cannot be accessed or updated.
-
findMethod
public static java.lang.reflect.Method findMethod(java.lang.Class<? extends com.priint.pubserver.plugin.entitydata.EntityData> clazz, java.lang.String property) throws java.lang.NoSuchMethodExceptionFinds a method in the specified class that matches the given property name. It tries to find both "get" and "is" prefixed methods for the property.- Parameters:
clazz- the class to search for the method.property- the property name to find the method for.- Returns:
- the found method.
- Throws:
java.lang.NoSuchMethodException- if no matching method is found.
-
fromEntityDataList
public static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData fromEntityDataList(java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> list)
Converts a list of EntityData to a push data object.- Parameters:
list- the list of EntityData objects to be converted.- Returns:
- a PushData object containing the converted EntityData objects.
-
fromEntityDataList
public static com.priint.pubserver.plugin.entitydata.Data fromEntityDataList(java.util.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:
- the push data object containing the converted EntityData objects.
- Since:
- 4.1.0 planning supported
-
lookupPluginByJndi
protected static <T> T lookupPluginByJndi(java.lang.String jndiName, java.lang.String mappedName, java.lang.String instanceName, java.lang.Class<T> clazz) throws javax.naming.NamingException, com.priint.pubserver.exception.PubServerExceptionSets the connector entity for the given entity data.- Type Parameters:
T- the type of the plugin to be looked up.- Parameters:
instanceName- the instance identifier for the connector entity.clazz- the entity data to set the connector entity for.jndiName- the JNDI name of the plugin.mappedName- the mapped name of the plugin.- Returns:
- the plugin instance cast to the specified type.
- Throws:
javax.naming.NamingException- if the JNDI lookup fails.com.priint.pubserver.exception.PubServerException- if the plugin is not of the expected type.
-
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- the data object to process- Since:
- 4.1.0 plannings attribute supported
-
toEntityDataList
public static java.util.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).- Parameters:
pushData- the PushData object to be converted.- Returns:
- List of EntityData objects.
- Since:
- 4.1.0 plannings attribute supported
-
toEntityDataMap
public static java.util.Map<java.lang.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.
- Parameters:
pushData- the PushData object to be converted.- Returns:
MapofEntityDataobjects.- 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 `EntityItem` based on the given `EntityData` and `PushCommand`. Depending on the command, this method generates an `EntityItem` for update, delete, or insert operations.- Parameters:
entityData- the `EntityData` object to be converted. Must not be null.command- the `PushCommand` indicating the type of operation (UPDATE, DELETE, or INSERT).- Returns:
- an `EntityItem` object representing the operation to be performed on the given `EntityData`.
-
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). This method initializes a new `EntityDataRecord` using the class type and identifier of the provided `EntityData` item.- Parameters:
item- the `EntityData` object to be converted. Must not be null.- Returns:
- an `EntityDataRecord` object containing the class type and identifier of the provided `EntityData` item.
-
toEntityItemForUpdate
public static com.priint.pubserver.plugin.entitydata.EntityItem toEntityItemForUpdate(com.priint.pubserver.plugin.entitydata.EntityData entityData)
Converts an `EntityData` object into an `EntityItem` for update operations. This method extracts all fields from the given `EntityData` object and populates them into a new `EntityItem` instance for updating purposes.- Parameters:
entityData- the `EntityData` object to be converted. Must not be null.- Returns:
- an `EntityItem` object containing the extracted fields from the provided `EntityData` object, or null if the input is null.
-
toEntityDataRecord4Update
public static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update toEntityDataRecord4Update(com.priint.pubserver.plugin.entitydata.EntityData entityData)
Converts an `EntityData` object into an `EntityDataRecord4Update` object. This method extracts all fields from the given `EntityData` object and populates them into a new `EntityDataRecord4Update` instance.- Parameters:
entityData- the `EntityData` object to be converted. Must not be null.- Returns:
- an `EntityDataRecord4Update` object containing the extracted fields from the provided `EntityData` object, or null if the input is null.
-
toEntityItem4UpdateList
public static java.util.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.- Parameters:
pushData- the PushData object to be converted.- Returns:
ListofEntityItem
-
toEntityDataRecord4UpdateList
public static java.util.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.- Parameters:
pushData- the PushData object to be converted.- Returns:
ListofConnectorPersistRemote.EntityDataRecord4Update
-
toEntityItemList
public static java.util.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- the PushData object to be converted.- Returns:
ListofEntityItem
-
toEntityDataRecordList
public static java.util.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 of EntityDataRecord (for delete). The method processes the PushData object and extracts all EntityData items, converting them into EntityDataRecord objects. KeyValue items with references are prioritized to ensure proper ordering.- Parameters:
pushData- the PushData object containing the entity data to be converted into records.- Returns:
ListofConnectorPersistRemote.EntityDataRecord, where each record represents an EntityData item.
-
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)Merges two PushData objects into one. The `insertData` object is merged into the `intoData` object. If `intoData` is null, a new PushData object is created and populated with the data from `insertData`.- Parameters:
insertData- the PushData object containing data to be merged.intoData- the PushData object into which data will be merged. Can be null.- Returns:
- a PushData object containing the merged data.
- Since:
- 4.1.0 plannings attribute supported
-
connectorEntityFromRequest
protected com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, java.lang.String instance, java.lang.String parentIdentifier)Converts the connector entity from the request into a ConnectorEntity object.- Parameters:
connectorEntity- the connector entity to be converted.instance- the instance name of the connector entity.parentIdentifier- the parent identifier of the connector entity.- Returns:
- a ConnectorEntity object with the specified parameters.
-
connectorEntityFromRequest
protected com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntityFromRequest(java.lang.String connectorEntityId, java.lang.String instance, java.lang.String parentIdentifier)Converts the connector entity from the request into a ConnectorEntity object.- Parameters:
connectorEntityId- the identifier of the connector entity.instance- the instance name of the connector entity.parentIdentifier- the parent identifier of the connector entity.- Returns:
- a ConnectorEntity object with the specified parameters.
-
connectorEntityFromRequest
protected java.lang.String connectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity)
Converts the connector entity from the request into a string representation.- Parameters:
connectorEntity- the connector entity to be converted.- Returns:
- the string representation of the connector entity.
-
connectorEntityFromRequest
protected java.lang.String connectorEntityFromRequest(java.lang.String connectorEntity)
Converts the connector entity from the request into a string representation.- Parameters:
connectorEntity- the connector entity to be converted.- Returns:
- the string representation of the connector entity.
-
contextFromListField
protected com.priint.pubserver.plugin.entitydata.Context contextFromListField()
Retrieves the context from the HTTP servlet request.- Returns:
- a `Context` object populated with the context parameters from the request.
-
contextFromListField
protected static com.priint.pubserver.plugin.entitydata.Context contextFromListField(javax.servlet.http.HttpServletRequest httpServletRequest)
Example?context=language:deu&context=country:DE&context=assortment:0815- Parameters:
httpServletRequest- the HTTP servlet request containing context parameters.- Returns:
- a `Context` object populated with the context parameters from the request.
-
lookupConnector
protected com.priint.pubserver.plugin.interfaces.ConnectorRemote lookupConnector(java.lang.String mappedName, java.lang.String instanceName) throws ServiceExceptionLooks up a connector by its mapped name and instance name.- Parameters:
mappedName- the mapped name of the connector.instanceName- the instance name of the connector.- Returns:
- the connector object.
- Throws:
ServiceException- if an error occurs during lookup.
-
lookupEntityManager
protected com.priint.pubserver.plugin.interfaces.EntityManagerRemote lookupEntityManager() throws ServiceExceptionLooks up a plugin by its mapped name and instance name.- Returns:
- the plugin object.
- Throws:
ServiceException- if an error occurs during lookup.
-
lookupPublishingManagementConnector
protected com.priint.pubserver.plugin.interfaces.PublishingManagementConnector lookupPublishingManagementConnector(java.lang.String mappedName, java.lang.String instanceName) throws ServiceExceptionLooks up a PublishingManagementConnector by its mapped name and instance name.- Parameters:
mappedName- the mapped name of the connector.instanceName- the instance name of the connector.- Returns:
- the connector object.
- Throws:
ServiceException- if an error occurs during lookup.
-
lookupPersistConnector
protected com.priint.pubserver.plugin.interfaces.ConnectorPersistLocal lookupPersistConnector(java.lang.String mappedName, java.lang.String instanceName) throws ServiceExceptionLooks up a connector by its mapped name and instance name.- Parameters:
mappedName- the mapped name of the connector.instanceName- the instance name of the connector.- Returns:
- the connector object.
- Throws:
ServiceException- if an error occurs during lookup.
-
lookupBean
protected <T> T lookupBean(java.lang.String jndiName, java.lang.Class<T> clazz) throws ServiceExceptionLooks up a bean by its JNDI name and casts it to the specified type.- Type Parameters:
T- the type of the bean to be returned.- Parameters:
jndiName- the JNDI name of the bean to be looked up.clazz- the class type to which the bean should be cast.- Returns:
- the bean instance cast to the specified type.
- Throws:
ServiceException- if the lookup fails or the bean is not of the expected type.
-
lookupPlugin
protected <T> T lookupPlugin(java.lang.String mappedName, java.lang.String instanceName, java.lang.Class<T> type) throws ServiceExceptionLookup a plugin by its mapped name and instance name.- Type Parameters:
T- the type of the plugin to be returned.- Parameters:
mappedName- the mapped name of the plugin.instanceName- the instance name of the plugin.type- the class type of the plugin.- Returns:
- the plugin object.
- Throws:
ServiceException- if an error occurs during lookup.
-
lookupPluginByPluginManager
protected <T> T lookupPluginByPluginManager(java.lang.String sessionId, java.lang.String mappedName, java.lang.String instanceName, java.lang.Class<T> clazz) throws com.priint.pubserver.exception.PubServerExceptionLookup a plugin by its mapped name and instance name.- Type Parameters:
T- the type of the plugin to be returned.- Parameters:
sessionId- the session ID for the plugin manager.mappedName- the mapped name of the plugin.instanceName- the instance name of the plugin.clazz- the class type of the plugin.- Returns:
- the plugin object.
- Throws:
com.priint.pubserver.exception.PubServerException- if an error occurs during lookup.
-
lookupPublishingHubDBConnector
protected java.lang.Object lookupPublishingHubDBConnector() throws ServiceExceptionLookup the publishing hub database connector.- Returns:
- the connector object.
- Throws:
ServiceException- if an error occurs during lookup.
-
setConnectorEntity
public static void setConnectorEntity(java.lang.String instance, com.priint.pubserver.plugin.entitydata.EntityData entityData)Sets the connector entity for the given entity data.- Parameters:
instance- the instance name to be set.entityData- the entity data object to be updated.
-
setConnectorEntity
public static void setConnectorEntity(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, com.priint.pubserver.plugin.entitydata.EntityData entityData)Sets the connector entity for the given entity data.- Parameters:
connectorEntity- the connector entity to be set.entityData- the entity data object to be updated.
-
clean
protected void clean(java.util.List<? extends com.priint.pubserver.plugin.entitydata.EntityData> items)
Cleans the connector entity from the list of items.- Parameters:
items- items the list of `EntityData` objects to be cleaned.
-
clean
protected void clean(com.priint.pubserver.plugin.entitydata.EntityData item)
Cleans the connector entity from the item.- Parameters:
item- the `EntityData` object to be cleaned.
-
-