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.Stringexecutionsstatic java.lang.Stringfunctionsstatic java.lang.Stringplansstatic java.lang.Stringrecursivestatic java.lang.Stringreportsstatic java.lang.StringresourceRevisionsstatic java.lang.Stringresourcesstatic java.lang.Stringtasksstatic java.lang.Stringusers
-
Constructor Summary
Constructors Constructor Description EntityManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityManageraddDependencyTreeVisitorHook(DependencyTreeVisitorHook hook)Register aEntityDependencyTreeVisitorhookjava.util.List<DependencyTreeVisitorHook>getDependencyTreeVisitorHooks()java.util.Collection<Entity<?,?>>getEntities()voidgetEntitiesReferences(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 dbvoidgetEntitiesReferences(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)EntityManagerregister(Entity<?,?> entity)voidregisterExportHook(java.util.function.BiConsumer<java.lang.Object,ExportContext> exportBiConsumer)voidregisterImportHook(java.util.function.BiConsumer<java.lang.Object,ImportContext> importBiConsumer)java.lang.Class<?>resolveClass(java.lang.String entityName)voidrunExportHooks(java.lang.Object o, ExportContext exportContext)voidrunImportHooks(java.lang.Object o, ImportContext importContext)voidupdateReferences(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 aEntityDependencyTreeVisitorhook- 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)
-
-