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(AbstractStepContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
getAllEntities(java.lang.String entityName, java.lang.String id, ObjectPredicate objectPredicate, EntityReferencesMap references)
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<?,?>
getEntityByClass(java.lang.Class<?> c)
Entity<?,?>
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 object, java.util.Map<java.lang.String,java.lang.String> references)
Used when importing artefacts with new IDs to update all references accordingly if the map doesn't contain the old ID yet, a new id and corresponding map entry are created
-
-
-
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
-
-
Constructor Detail
-
EntityManager
public EntityManager(AbstractStepContext context)
-
-
Method Detail
-
register
public EntityManager register(Entity<?,?> entity)
-
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
-
getAllEntities
public void getAllEntities(java.lang.String entityName, java.lang.String id, ObjectPredicate objectPredicate, EntityReferencesMap references)
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 entityid
- the id of the entityreferences
- the map of references to be populated
-
getEntityByClass
public Entity<?,?> getEntityByClass(java.lang.Class<?> c)
-
updateReferences
public void updateReferences(java.lang.Object object, java.util.Map<java.lang.String,java.lang.String> references)
Used when importing artefacts with new IDs to update all references accordingly if the map doesn't contain the old ID yet, a new id and corresponding map entry are created
-
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)
-
-