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
AbstractService 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 extends PluginControlDefault and is intended to be subclassed by specific service implementations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Intentionally using the HTTP equivalent code 409 (Conflict).
    static final int
    Intentionally using the HTTP equivalent code 404 (Not Found).
    protected jakarta.servlet.http.HttpServletRequest
    The HTTP servlet request object, used to access request-specific information such as headers, parameters, and attributes.
    protected jakarta.servlet.http.HttpServletResponse
    The HTTP servlet response object, used to modify and send response-specific information such as headers, status codes, and output data.
    protected static org.slf4j.Logger
    Logger instance for logging messages and debugging information.
    protected PluginLib
    The library providing access to plugin management and related utilities.
    protected static final String
    The JNDI name for the Publishing Hub Database Connector.
    static final String
    Used as wildcard character for ConnectorEntityId and ResultType.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for the AbstractService class.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    clean(com.priint.pubserver.plugin.entitydata.EntityData item)
    Cleans the connector entity from the item.
    protected void
    clean(List<? extends com.priint.pubserver.plugin.entitydata.EntityData> items)
    Cleans the connector entity from the list of items.
    protected String
    connectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity)
    Converts the connector entity from the request into a string representation.
    protected com.priint.pubserver.plugin.entitydata.ConnectorEntity
    connectorEntityFromRequest(com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity, String instance, String parentIdentifier)
    Converts the connector entity from the request into a ConnectorEntity object.
    protected String
    Converts the connector entity from the request into a string representation.
    protected com.priint.pubserver.plugin.entitydata.ConnectorEntity
    connectorEntityFromRequest(String connectorEntityId, String instance, String parentIdentifier)
    Converts the connector entity from the request into a ConnectorEntity object.
    protected com.priint.pubserver.plugin.entitydata.Context
    Retrieves the context from the HTTP servlet request.
    protected static com.priint.pubserver.plugin.entitydata.Context
    contextFromListField(jakarta.servlet.http.HttpServletRequest httpServletRequest)
    Example
    ?context=language:deu&context=country:DE&context=assortment:0815
    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)
    Creates an `EntityItem` for updating an existing entity.
    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)
    Creates an `EntityDataRecord4Update` for updating an existing entity.
    static Method
    findMethod(Class<? extends com.priint.pubserver.plugin.entitydata.EntityData> clazz, String property)
    Finds a method in the specified class that matches the given property name.
    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.
    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.
    protected <T> T
    lookupBean(String jndiName, Class<T> clazz)
    Looks up a bean by its JNDI name and casts it to the specified type.
    protected com.priint.pubserver.plugin.interfaces.ConnectorRemote
    lookupConnector(String mappedName, String instanceName)
    Looks up a connector by its mapped name and instance name.
    protected com.priint.pubserver.plugin.interfaces.EntityManagerRemote
    Looks up a plugin by its mapped name and instance name.
    protected com.priint.pubserver.plugin.interfaces.ConnectorPersistLocal
    lookupPersistConnector(String mappedName, String instanceName)
    Looks up a connector by its mapped name and instance name.
    protected <T> T
    lookupPlugin(String mappedName, String instanceName, Class<T> type)
    Lookup a plugin by its mapped name and instance name.
    protected static <T> T
    lookupPluginByJndi(String jndiName, String mappedName, String instanceName, Class<T> clazz)
    Sets the connector entity for the given entity data.
    protected <T> T
    lookupPluginByPluginManager(String sessionId, String mappedName, String instanceName, Class<T> clazz)
    Lookup a plugin by its mapped name and instance name.
    protected Object
    Lookup the publishing hub database connector.
    protected com.priint.pubserver.plugin.interfaces.PublishingManagementConnector
    Looks up a PublishingManagementConnector by its mapped name and instance name.
    static void
    preProcessData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data)
    Process data object with all embedded entitydata recursively. Add origin (if missing).
    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.
    static void
    setConnectorEntity(String instance, com.priint.pubserver.plugin.entitydata.EntityData entityData)
    Sets the connector entity for the given entity data.
    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).
    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].
    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).
    static com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.EntityDataRecord4Update
    toEntityDataRecord4Update(com.priint.pubserver.plugin.entitydata.EntityData entityData)
    Converts an `EntityData` object into an `EntityDataRecord4Update` object.
    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 of EntityDataRecord (for delete).
    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`.
    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.EntityItem
    toEntityItemForUpdate(com.priint.pubserver.plugin.entitydata.EntityData entityData)
    Converts an `EntityData` object into an `EntityItem` for update operations.
    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.PushData
    toPushData(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.priint.pubserver.plugin.interfaces.PluginControl

    validateConfigurations
  • Field Details

    • WILDCARD

      public static final String 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_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:
    • 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:
    • 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 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:
    • httpServletRequest

      @Context protected jakarta.servlet.http.HttpServletRequest httpServletRequest
      The HTTP servlet request object, used to access request-specific information such as headers, parameters, and attributes.
    • httpServletResponse

      @Context protected jakarta.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.
  • Constructor Details

    • AbstractService

      public AbstractService()
      Default constructor for the AbstractService class. Initializes the base class and provides common functionality for services interacting with entity data.
  • 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
      Creates 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(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
      Creates 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 Method findMethod(Class<? extends com.priint.pubserver.plugin.entitydata.EntityData> clazz, String property) throws NoSuchMethodException
      Finds 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:
      NoSuchMethodException - if no matching method is found.
    • 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 - 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(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 EntityData
      data - 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(String jndiName, String mappedName, String instanceName, Class<T> clazz) throws NamingException, com.priint.pubserver.exception.PubServerException
      Sets the connector entity for the given entity data.
      Type Parameters:
      T - the type of the plugin to be looked up.
      Parameters:
      jndiName - the JNDI name of the plugin.
      mappedName - the mapped name of the plugin.
      instanceName - the instance identifier for the connector entity.
      clazz - the entity data to set the connector entity for.
      Returns:
      the plugin instance cast to the specified type.
      Throws:
      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 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 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.

      Parameters:
      pushData - the PushData object to be converted.
      Returns:
      Map of EntityData objects.
      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 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:
      List of EntityItem
    • 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.
      Parameters:
      pushData - the PushData object to be converted.
      Returns:
      List of ConnectorPersistRemote.EntityDataRecord4Update
    • 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 - the PushData object to be converted.
      Returns:
      List of EntityItem
    • 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 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:
      List of ConnectorPersistRemote.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, String instance, 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(String connectorEntityId, String instance, 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 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 String connectorEntityFromRequest(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(jakarta.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(String mappedName, String instanceName) throws ServiceException
      Looks 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 ServiceException
      Looks 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(String mappedName, String instanceName) throws ServiceException
      Looks 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(String mappedName, String instanceName) throws ServiceException
      Looks 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(String jndiName, Class<T> clazz) throws ServiceException
      Looks 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(String mappedName, String instanceName, Class<T> type) throws ServiceException
      Lookup 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(String sessionId, String mappedName, String instanceName, Class<T> clazz) throws com.priint.pubserver.exception.PubServerException
      Lookup 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 Object lookupPublishingHubDBConnector() throws ServiceException
      Lookup the publishing hub database connector.
      Returns:
      the connector object.
      Throws:
      ServiceException - if an error occurs during lookup.
    • setConnectorEntity

      public static void setConnectorEntity(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(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.