Package step.core.entities
Class EntityManager
- java.lang.Object
-
- step.core.entities.EntityManager
-
public class EntityManager extends Object
-
-
Constructor Summary
Constructors Constructor Description EntityManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityManager
addDependencyTreeVisitorHook(DependencyTreeVisitorHook hook)
Register aEntityDependencyTreeVisitor
hookList<DependencyTreeVisitorHook>
getDependencyTreeVisitorHooks()
Collection<Entity<?,?>>
getEntities()
void
getEntitiesReferences(String entityName, String entityId, step.core.objectenricher.ObjectPredicate objectPredicate, EntityReferencesMap references, boolean recursive)
get entities recursively by scanning the given entity (aka artefact), the entity is retrieved and deserialized from the dbvoid
getEntitiesReferences(String entityType, step.core.objectenricher.ObjectPredicate objectPredicate, boolean recursively, EntityReferencesMap refs)
Retrieve all existing references from the DB for given entity typeEntity<?,?>
getEntityByName(String entityName)
EntityManager
register(Entity<?,?> entity)
void
registerExportHook(BiConsumer<Object,ExportContext> exportBiConsumer)
void
registerImportHook(BiConsumer<Object,ImportContext> importBiConsumer)
Class<?>
resolveClass(String entityName)
void
runExportHooks(Object o, ExportContext exportContext)
void
runImportHooks(Object o, ImportContext importContext)
void
updateReferences(Object entity, Map<String,String> references, step.core.objectenricher.ObjectPredicate objectPredicate, Set<String> messageCollector)
-
-
-
Field Detail
-
executions
public static final String executions
- See Also:
- Constant Field Values
-
plans
public static final String plans
- See Also:
- Constant Field Values
-
functions
public static final String functions
- See Also:
- Constant Field Values
-
reports
public static final String reports
- See Also:
- Constant Field Values
-
tasks
public static final String tasks
- See Also:
- Constant Field Values
-
users
public static final String users
- See Also:
- Constant Field Values
-
resources
public static final String resources
- See Also:
- Constant Field Values
-
resourceRevisions
public static final String resourceRevisions
- See Also:
- Constant Field Values
-
recursive
public static final String recursive
- See Also:
- Constant Field Values
-
-
Method Detail
-
register
public EntityManager register(Entity<?,?> entity)
-
getEntities
public Collection<Entity<?,?>> getEntities()
-
getEntitiesReferences
public void getEntitiesReferences(String entityType, step.core.objectenricher.ObjectPredicate objectPredicate, boolean recursively, EntityReferencesMap refs)
Retrieve all existing references from the DB for given entity type- Parameters:
entityType
- type of entities to retrieveobjectPredicate
- to apply to filter entities (i.e. project)recursively
- flag to export references recursively (i.e by exporting a plan recursively the plan will be scanned to find sub references)refs
- the map of entity references to be populated during the process
-
getEntitiesReferences
public void getEntitiesReferences(String entityName, String entityId, step.core.objectenricher.ObjectPredicate objectPredicate, EntityReferencesMap references, boolean recursive)
get entities recursively by scanning the given entity (aka artefact), the entity is retrieved and deserialized from the db- Parameters:
entityName
- name of the type of entityentityId
- the id of the entityreferences
- the map of references to be populated
-
updateReferences
public void updateReferences(Object entity, Map<String,String> references, step.core.objectenricher.ObjectPredicate objectPredicate, Set<String> messageCollector)
-
addDependencyTreeVisitorHook
public EntityManager addDependencyTreeVisitorHook(DependencyTreeVisitorHook hook)
Register aEntityDependencyTreeVisitor
hook- Parameters:
hook
- the hook instance to be registered- Returns:
- this instance
-
getDependencyTreeVisitorHooks
public List<DependencyTreeVisitorHook> getDependencyTreeVisitorHooks()
-
registerExportHook
public void registerExportHook(BiConsumer<Object,ExportContext> exportBiConsumer)
-
runExportHooks
public void runExportHooks(Object o, ExportContext exportContext)
-
registerImportHook
public void registerImportHook(BiConsumer<Object,ImportContext> importBiConsumer)
-
runImportHooks
public void runImportHooks(Object o, ImportContext importContext)
-
-