Package step.core.entities
Class EntityManager
- java.lang.Object
-
- step.core.entities.EntityManager
-
public class EntityManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
executions
static java.lang.String
functions
static java.lang.String
plans
static java.lang.String
recursive
static java.lang.String
reports
static java.lang.String
resourceRevisions
static java.lang.String
resources
static java.lang.String
tasks
static java.lang.String
users
-
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
hookjava.util.List<DependencyTreeVisitorHook>
getDependencyTreeVisitorHooks()
java.util.Collection<Entity<?,?>>
getEntities()
void
getEntitiesReferences(java.lang.String entityName, java.lang.String entityId, 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(java.lang.String entityType, ObjectPredicate objectPredicate, boolean recursively, EntityReferencesMap refs)
Retrieve all existing references from the DB for given entity typeEntity<?,?>
getEntityByName(java.lang.String entityName)
EntityManager
register(Entity<?,?> entity)
void
registerExportHook(java.util.function.BiConsumer<java.lang.Object,ExportContext> exportBiConsumer)
void
registerImportHook(java.util.function.BiConsumer<java.lang.Object,ImportContext> importBiConsumer)
java.lang.Class<?>
resolveClass(java.lang.String entityName)
void
runExportHooks(java.lang.Object o, ExportContext exportContext)
void
runImportHooks(java.lang.Object o, ImportContext importContext)
void
updateReferences(java.lang.Object entity, java.util.Map<java.lang.String,java.lang.String> references, ObjectPredicate objectPredicate)
-
-
-
Field Detail
-
executions
public static final java.lang.String executions
- See Also:
- Constant Field Values
-
plans
public static final java.lang.String plans
- See Also:
- Constant Field Values
-
functions
public static final java.lang.String functions
- See Also:
- Constant Field Values
-
reports
public static final java.lang.String reports
- See Also:
- Constant Field Values
-
tasks
public static final java.lang.String tasks
- See Also:
- Constant Field Values
-
users
public static final java.lang.String users
- See Also:
- Constant Field Values
-
resources
public static final java.lang.String resources
- See Also:
- Constant Field Values
-
resourceRevisions
public static final java.lang.String resourceRevisions
- See Also:
- Constant Field Values
-
recursive
public static final java.lang.String recursive
- See Also:
- Constant Field Values
-
-
Method Detail
-
register
public EntityManager register(Entity<?,?> entity)
-
getEntities
public java.util.Collection<Entity<?,?>> getEntities()
-
getEntityByName
public Entity<?,?> getEntityByName(java.lang.String entityName)
-
resolveClass
public java.lang.Class<?> resolveClass(java.lang.String entityName)
-
getEntitiesReferences
public void getEntitiesReferences(java.lang.String entityType, 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(java.lang.String entityName, java.lang.String entityId, 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(java.lang.Object entity, java.util.Map<java.lang.String,java.lang.String> references, ObjectPredicate objectPredicate)
-
addDependencyTreeVisitorHook
public EntityManager addDependencyTreeVisitorHook(DependencyTreeVisitorHook hook)
Register aEntityDependencyTreeVisitor
hook- Parameters:
hook
- the hook instance to be registered- Returns:
- this instance
-
getDependencyTreeVisitorHooks
public java.util.List<DependencyTreeVisitorHook> getDependencyTreeVisitorHooks()
-
registerExportHook
public void registerExportHook(java.util.function.BiConsumer<java.lang.Object,ExportContext> exportBiConsumer)
-
runExportHooks
public void runExportHooks(java.lang.Object o, ExportContext exportContext)
-
registerImportHook
public void registerImportHook(java.util.function.BiConsumer<java.lang.Object,ImportContext> importBiConsumer)
-
runImportHooks
public void runImportHooks(java.lang.Object o, ImportContext importContext)
-
-