Class EntityModelManager

java.lang.Object
com.priint.pubserver.plugin.entitymanager.EntityModelManager

public class EntityModelManager extends Object
Class that manages the Entity Models available to the Entity Manager. This class is instantiated in the PluginInit session bean class.
Since:
4.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addConnectorOfEntityModel(com.priint.pubserver.entity.ConnectorOfEntityModel conmodel)
    Add a new ConnectorOfEntityModel
    void
    addEntity(com.priint.pubserver.entity.EntityModel entityModel, com.priint.pubserver.entity.Entity entity)
    Add an Entity to the Entity Model Manager.
    void
    addModel(com.priint.pubserver.entity.EntityModel entityModel)
    Add a model to the Entity Model Manager.
    List<com.priint.pubserver.entity.ConnectorOfEntityModel>
    Get the List of Connectors and there assigned Entity Models
    Map<String,com.priint.pubserver.entity.Entity>
    Get all entities of all models
    <T> T
    getEntity(com.priint.pubserver.entity.EntityModel entityModel, String entityIdentifier, Class<T> entityType)
    Get an Entity of a special subclass from the Entity Model Manager
    <T> T
    getEntityByConnectorEntity(String entityModelIdentifier, String connectorEntity, Class<T> clazz)
    Get an Entity by the Connector Entity string
    com.priint.pubserver.entity.EntityModel
    getEntityModel(String entityModelIdentifier)
    Get an Entity Model from the Entity Model Manager.
    Map<String,com.priint.pubserver.entity.EntityModel>
    Get all Entity Models from the Entity Model Manager
    <T> T
    getEntityNoEntityType(com.priint.pubserver.entity.EntityModel entityModel, String entityIdentifier)
     
    com.priint.pubserver.entity.Entity
    getParentEntity(String modelId, String childId)
    Get the (last) parent entity for an entity - if existing.
    List<com.priint.pubserver.entity.EntityBucket>
    getRootEntities(String entityModelIdentifier)
    Get a List of Entities that are set as root elements of the model
    void
    removeEntityModel(String entityModelIdentifier)
    Remove an Entity Model and its Entities from the Entity Model Manager

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityModelManager

      public EntityModelManager()
  • Method Details

    • getEntityModels

      public Map<String,com.priint.pubserver.entity.EntityModel> getEntityModels()
      Get all Entity Models from the Entity Model Manager
      Returns:
      Map of Entity Models with identifier as key
    • getEntities

      public Map<String,com.priint.pubserver.entity.Entity> getEntities()
      Get all entities of all models
      Returns:
      Map of Entities with identifier as Key = <ModelIdentifier + EntityIdentifier>
    • addModel

      public void addModel(com.priint.pubserver.entity.EntityModel entityModel)
      Add a model to the Entity Model Manager. Existing models will not be replaced.
      Parameters:
      entityModel - The Entity Model
    • getEntityModel

      public com.priint.pubserver.entity.EntityModel getEntityModel(String entityModelIdentifier)
      Get an Entity Model from the Entity Model Manager.
      Parameters:
      entityModelIdentifier - Identifier of the Entity Model
      Returns:
      The Entity Model or null if there is no model with this identifier.
    • addEntity

      public void addEntity(com.priint.pubserver.entity.EntityModel entityModel, com.priint.pubserver.entity.Entity entity)
      Add an Entity to the Entity Model Manager. Existing entities will not be replaced.
      Parameters:
      entityModel - The Entity Model
      entity - The Entity
    • getEntity

      public <T> T getEntity(com.priint.pubserver.entity.EntityModel entityModel, String entityIdentifier, Class<T> entityType)
      Get an Entity of a special subclass from the Entity Model Manager
      Parameters:
      entityModel - The Entity Model
      entityIdentifier - Identifier of the Entity
      entityType - Entity Class of the Entity (e.g. EntityBucket.class).
      Returns:
      The Entity or null if entity not found or no instance of subclass.
    • getEntityNoEntityType

      public <T> T getEntityNoEntityType(com.priint.pubserver.entity.EntityModel entityModel, String entityIdentifier)
    • getEntityByConnectorEntity

      public <T> T getEntityByConnectorEntity(String entityModelIdentifier, String connectorEntity, Class<T> clazz)
      Get an Entity by the Connector Entity string
      Parameters:
      entityModelIdentifier - Identifier of the Entity Model
      connectorEntity - Connector Entity String
      clazz - Class of the Entity
      Returns:
      The Entity or null if no object with the connector string and entity type found in the model.
    • getRootEntities

      public List<com.priint.pubserver.entity.EntityBucket> getRootEntities(String entityModelIdentifier)
      Get a List of Entities that are set as root elements of the model
      Parameters:
      entityModelIdentifier - identifier of the Entity Model
      Returns:
      List of root entities of the model
    • removeEntityModel

      public void removeEntityModel(String entityModelIdentifier)
      Remove an Entity Model and its Entities from the Entity Model Manager
      Parameters:
      entityModelIdentifier -
    • getConnectorOfEntityModels

      public List<com.priint.pubserver.entity.ConnectorOfEntityModel> getConnectorOfEntityModels()
      Get the List of Connectors and there assigned Entity Models
      Returns:
      List<ConnectorOfEntityModel>
    • addConnectorOfEntityModel

      public void addConnectorOfEntityModel(com.priint.pubserver.entity.ConnectorOfEntityModel conmodel)
      Add a new ConnectorOfEntityModel
      Parameters:
      conmodel - ConnectorOfEntityModel Object
    • getParentEntity

      public com.priint.pubserver.entity.Entity getParentEntity(String modelId, String childId)
      Get the (last) parent entity for an entity - if existing.

      If an entity has more than one parent in a model one of these parents will be returned. It will always be the same as long as the entity model is not reloaded through a commit or reload of the plugin.

      Parameters:
      modelId -
      childId -
      Returns:
      parent entity or null