Class EntityModelManager
java.lang.Object
com.priint.pubserver.plugin.entitymanager.EntityModelManager
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectorOfEntityModel(com.priint.pubserver.entity.ConnectorOfEntityModel conmodel) Add a new ConnectorOfEntityModelvoidaddEntity(com.priint.pubserver.entity.EntityModel entityModel, com.priint.pubserver.entity.Entity entity) Add an Entity to the Entity Model Manager.voidaddModel(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 ModelsGet all entities of all models<T> TgetEntity(com.priint.pubserver.entity.EntityModel entityModel, String entityIdentifier, Class<T> entityType) Get an Entity of a special subclass from the Entity Model Manager<T> TgetEntityByConnectorEntity(String entityModelIdentifier, String connectorEntity, Class<T> clazz) Get an Entity by the Connector Entity stringcom.priint.pubserver.entity.EntityModelgetEntityModel(String entityModelIdentifier) Get an Entity Model from the Entity Model Manager.Get all Entity Models from the Entity Model Manager<T> TgetEntityNoEntityType(com.priint.pubserver.entity.EntityModel entityModel, String entityIdentifier) com.priint.pubserver.entity.EntitygetParentEntity(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 modelvoidremoveEntityModel(String entityModelIdentifier) Remove an Entity Model and its Entities from the Entity Model Manager
-
Constructor Details
-
EntityModelManager
public EntityModelManager()
-
-
Method Details
-
getEntityModels
Get all Entity Models from the Entity Model Manager- Returns:
- Map of Entity Models with identifier as key
-
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
Get an Entity Model from the Entity Model Manager.- Parameters:
entityModelIdentifier- Identifier of the Entity Model- Returns:
- The Entity Model or
nullif 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 Modelentity- 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 ModelentityIdentifier- Identifier of the EntityentityType- Entity Class of the Entity (e.g. EntityBucket.class).- Returns:
- The Entity or
nullif 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 ModelconnectorEntity- Connector Entity Stringclazz- Class of the Entity- Returns:
- The Entity or
nullif no object with the connector string and entity type found in the model.
-
getRootEntities
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
Remove an Entity Model and its Entities from the Entity Model Manager- Parameters:
entityModelIdentifier-
-
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
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
-