Class LogbookLifeCyclesImpl
java.lang.Object
fr.gouv.vitam.logbook.lifecycles.core.LogbookLifeCyclesImpl
- All Implemented Interfaces:
LogbookLifeCycles
Logbook LifeCycles implementation base class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbulk(LogbookCollections collections, String idOp, List<? extends LogbookLifeCycleModel> logbookLifeCycleModels) Bulk methodbooleancheckObjectGroupLifecycleEntriesExistenceByLastPersistedDate(String startDate, String endDate) Checks existence of new object group life cyclesbooleancheckUnitLifecycleEntriesExistenceByLastPersistedDate(String startDate, String endDate) Checks existence of new unit life cyclesvoidcommitObjectGroup(String idOperation, String idLc) Commits ObjectGroup lifeCyclevoidcommitUnit(String idOperation, String idLc) Commits Unit lifeCyclevoidcreateBulkLogbookLifecycle(String operationId, LogbookLifeCycleParameters[] lifecycleArray) Create one Logbook Lifecycle with already multiple sub-eventsvoidcreateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) Create and insert logbook LifeCycle entriesvoidcreateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) Create and insert logbook LifeCycle entriesvoiddeleteLifeCycleObjectGroups(List<String> objectGroupIds) delete LifeCycle ObjectGroupsvoiddeleteLifeCycleUnits(List<String> unitsIdentifier) delete LifeCycle UnitsgetObjectGroupLifeCycleStatus(String objectGroupId) Returns the LifeCycle Status for a given objectGroup Idcom.fasterxml.jackson.databind.JsonNodereturns the raw version of object group life cycleList<com.fasterxml.jackson.databind.JsonNode>returns the raw version of object group life cycleCloseableIterator<com.fasterxml.jackson.databind.JsonNode>getRawObjectGroupLifecyclesByLastPersistedDate(String startDate, String endDate, int limit) Gets a list of raw object group life cycles by requestcom.fasterxml.jackson.databind.JsonNodereturns the raw version of unit life cycleList<com.fasterxml.jackson.databind.JsonNode>returns the raw version of unit life cycleCloseableIterator<com.fasterxml.jackson.databind.JsonNode>getRawUnitLifecyclesByLastPersistedDate(String startDate, String endDate, int limit) Gets a list of raw unit life cycles by requestgetUnitLifeCycleStatus(String unitId) Returns the LifeCycle Status for a given unit IdvoidrollbackObjectGroup(String idOperation, String idLc) Rollback logbook LifeCycle entriesvoidrollBackObjectGroupsByOperation(String idOperation) Removes the created object groups lifeCycles during a given operationvoidrollbackUnit(String idOperation, String idLc) Rollback logbook LifeCycle entriesvoidrollBackUnitsByOperation(String idOperation) Removes the created unit lifeCycles during a given operationselectLifeCycleById(String lifecycleId, com.fasterxml.jackson.databind.JsonNode queryDsl, boolean sliced, LogbookCollections collection) Selects life cycle entryList<LogbookLifeCycle<?>>selectLifeCycles(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) Selects life cycle entriesvoidupdateBulkLogbookLifecycle(String operationId, LogbookLifeCycleParameters[] lifecycleArray) Update one Logbook Lifecycle with multiple sub-events
It adds this new entry within the very same Logbook Lifecycle entry in "events" array.voidupdateLogbookLifeCycleBulk(LogbookCollections logbookCollections, List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk) updateLogbookLifeCycleBulkvoidupdateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) Update logbook LifeCycle entriesvoidupdateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters, boolean commit) Update logbook LifeCycle entriesvoidupdateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) Update logbook LifeCycle entriesvoidupdateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters, boolean commit) Update logbook LifeCycle entries committed or in progress
-
Constructor Details
-
LogbookLifeCyclesImpl
Constructor- Parameters:
mongoDbAccess- of logbook
-
-
Method Details
-
createUnit
public void createUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException, IllegalArgumentException Description copied from interface:LogbookLifeCyclesCreate and insert logbook LifeCycle entries- Specified by:
createUnitin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle unit identifierparameters- the logbook lifecycle parameters- Throws:
LogbookAlreadyExistsException- if an LifeCycle with the same eventIdentifierProcess and outcome="Started" already existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseIllegalArgumentException
-
createObjectGroup
public void createObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException, IllegalArgumentException Description copied from interface:LogbookLifeCyclesCreate and insert logbook LifeCycle entries- Specified by:
createObjectGroupin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifierparameters- the logbook lifecycle parameters- Throws:
LogbookAlreadyExistsException- if an LifeCycle with the same eventIdentifierProcess and outcome="Started" already existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseIllegalArgumentException
-
updateUnit
public void updateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookDatabaseException, IllegalArgumentException, LogbookNotFoundException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesUpdate logbook LifeCycle entries- Specified by:
updateUnitin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifierparameters- the logbook lifecycle parameters- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if no LifeCycle with the same eventIdentifierProcess existsLogbookAlreadyExistsException- if the entry already existsIllegalArgumentException
-
updateUnit
public void updateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesUpdate logbook LifeCycle entries committed or in progress- Specified by:
updateUnitin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifierparameters- the logbook lifecycle parameterscommit- if false update in progress collection else update committed LFC- Throws:
LogbookNotFoundException- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException- if the entry already exists
-
updateObjectGroup
public void updateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesUpdate logbook LifeCycle entries- Specified by:
updateObjectGroupin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifierparameters- the logbook lifecycle parameters- Throws:
LogbookNotFoundException- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException- if the entry already existsIllegalArgumentException
-
updateObjectGroup
public void updateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesUpdate logbook LifeCycle entries- Specified by:
updateObjectGroupin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifierparameters- the logbook lifecycle parameterscommit- if true update is done on committed collection otherwise on inProcess one- Throws:
LogbookNotFoundException- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException- if the entry already existsIllegalArgumentException
-
selectLifeCycleById
public LogbookLifeCycle<?> selectLifeCycleById(String lifecycleId, com.fasterxml.jackson.databind.JsonNode queryDsl, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException, InvalidCreateOperationException Description copied from interface:LogbookLifeCyclesSelects life cycle entry- Specified by:
selectLifeCycleByIdin interfaceLogbookLifeCycles- Parameters:
lifecycleId- the lifecycle idqueryDsl- the select projection in format of JsonNodesliced- the boolean sliced filtering events or notcollection- the collection on which the select operation will be done : Production collection (LIFECYCLE_OBJECT_GROUP/LIFECYCLE_UNIT) or Working collection (LIFECYCLE_OBJECT_GROUP_IN_PROCESS/LIFECYCLE_UNIT_IN_PROCESS)- Returns:
- the logbook LifeCycle
- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if no LifeCycle selected cannot be foundInvalidParseOperationException- if invalid parse for selecting the LifeCycleVitamDBException- in case a desynchro is recorded between Mongo and ESInvalidCreateOperationException
-
selectLifeCycles
public List<LogbookLifeCycle<?>> selectLifeCycles(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, VitamDBException Description copied from interface:LogbookLifeCyclesSelects life cycle entries- Specified by:
selectLifeCyclesin interfaceLogbookLifeCycles- Parameters:
select- the select request in format of JsonNodesliced- the boolean sliced filtering events or notcollection- the collection on which the select operation will be done : Production collection (LIFECYCLE_OBJECT_GROUP/LIFECYCLE_UNIT) or Working collection (LIFECYCLE_OBJECT_GROUP_IN_PROCESS/LIFECYCLE_UNIT_IN_PROCESS)- Returns:
- List of the logbook LifeCycle
- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if no LifeCycle selected cannot be foundVitamDBException- in case a desynchro is recorded between Mongo and ES
-
rollbackUnit
public void rollbackUnit(String idOperation, String idLc) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException Description copied from interface:LogbookLifeCyclesRollback logbook LifeCycle entries- Specified by:
rollbackUnitin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifier- Throws:
LogbookNotFoundException- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseIllegalArgumentException
-
rollbackObjectGroup
public void rollbackObjectGroup(String idOperation, String idLc) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException Description copied from interface:LogbookLifeCyclesRollback logbook LifeCycle entries- Specified by:
rollbackObjectGroupin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifier- Throws:
LogbookNotFoundException- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException- if errors occur while connecting or writing to the databaseIllegalArgumentException
-
createBulkLogbookLifecycle
public void createBulkLogbookLifecycle(String operationId, LogbookLifeCycleParameters[] lifecycleArray) throws LogbookDatabaseException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesCreate one Logbook Lifecycle with already multiple sub-events- Specified by:
createBulkLogbookLifecyclein interfaceLogbookLifeCycles- Parameters:
operationId- Operation IdlifecycleArray- with first and next events to add/update- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException- if LifeCycle already exists
-
updateBulkLogbookLifecycle
public void updateBulkLogbookLifecycle(String operationId, LogbookLifeCycleParameters[] lifecycleArray) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesUpdate one Logbook Lifecycle with multiple sub-events
It adds this new entry within the very same Logbook Lifecycle entry in "events" array.- Specified by:
updateBulkLogbookLifecyclein interfaceLogbookLifeCycles- Parameters:
operationId- Operation IdlifecycleArray- containing all Lifecycle Logbook in order- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if LifeCycle cannot be foundLogbookAlreadyExistsException- if LifeCycle already exists
-
commitUnit
public void commitUnit(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesCommits Unit lifeCycle- Specified by:
commitUnitin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifier- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if LifeCycle cannot be foundLogbookAlreadyExistsException- if LifeCycle already exists
-
commitObjectGroup
public void commitObjectGroup(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException Description copied from interface:LogbookLifeCyclesCommits ObjectGroup lifeCycle- Specified by:
commitObjectGroupin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation identifieridLc- the lifecycle identifier- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if LifeCycle cannot be foundLogbookAlreadyExistsException- if LifeCycle already exists
-
rollBackUnitsByOperation
public void rollBackUnitsByOperation(String idOperation) throws LogbookNotFoundException, LogbookDatabaseException Description copied from interface:LogbookLifeCyclesRemoves the created unit lifeCycles during a given operation- Specified by:
rollBackUnitsByOperationin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation id- Throws:
LogbookNotFoundException- if LifeCycle cannot be foundLogbookDatabaseException- if errors occur while connecting or writing to the database
-
rollBackObjectGroupsByOperation
public void rollBackObjectGroupsByOperation(String idOperation) throws LogbookNotFoundException, LogbookDatabaseException Description copied from interface:LogbookLifeCyclesRemoves the created object groups lifeCycles during a given operation- Specified by:
rollBackObjectGroupsByOperationin interfaceLogbookLifeCycles- Parameters:
idOperation- the operation id- Throws:
LogbookNotFoundException- if LifeCycle cannot be foundLogbookDatabaseException- if errors occur while connecting or writing to the database
-
getUnitLifeCycleStatus
public LifeCycleStatusCode getUnitLifeCycleStatus(String unitId) throws LogbookDatabaseException, LogbookNotFoundException Description copied from interface:LogbookLifeCyclesReturns the LifeCycle Status for a given unit Id- Specified by:
getUnitLifeCycleStatusin interfaceLogbookLifeCycles- Parameters:
unitId- the unit Id- Returns:
- the lifeCycleStatusCode
- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if LifeCycle cannot be found
-
getObjectGroupLifeCycleStatus
public LifeCycleStatusCode getObjectGroupLifeCycleStatus(String objectGroupId) throws LogbookDatabaseException, LogbookNotFoundException Description copied from interface:LogbookLifeCyclesReturns the LifeCycle Status for a given objectGroup Id- Specified by:
getObjectGroupLifeCycleStatusin interfaceLogbookLifeCycles- Parameters:
objectGroupId- the objectGroup Id- Returns:
- the lifeCycleStatusCode
- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if LifeCycle cannot be found
-
bulk
public void bulk(LogbookCollections collections, String idOp, List<? extends LogbookLifeCycleModel> logbookLifeCycleModels) throws DatabaseException Description copied from interface:LogbookLifeCyclesBulk method- Specified by:
bulkin interfaceLogbookLifeCycles- Parameters:
collections- the logbook collectionsidOp- operation identifierlogbookLifeCycleModels- lifecycles to be created- Throws:
DatabaseException- if database could not be reached
-
getRawUnitLifecyclesByLastPersistedDate
public CloseableIterator<com.fasterxml.jackson.databind.JsonNode> getRawUnitLifecyclesByLastPersistedDate(String startDate, String endDate, int limit) Description copied from interface:LogbookLifeCyclesGets a list of raw unit life cycles by request- Specified by:
getRawUnitLifecyclesByLastPersistedDatein interfaceLogbookLifeCycles- Parameters:
startDate- the selection start dateendDate- the selection end datelimit- the max limit
-
getRawObjectGroupLifecyclesByLastPersistedDate
public CloseableIterator<com.fasterxml.jackson.databind.JsonNode> getRawObjectGroupLifecyclesByLastPersistedDate(String startDate, String endDate, int limit) Description copied from interface:LogbookLifeCyclesGets a list of raw object group life cycles by request- Specified by:
getRawObjectGroupLifecyclesByLastPersistedDatein interfaceLogbookLifeCycles- Parameters:
startDate- the selection start dateendDate- the selection end datelimit- the max limit
-
checkUnitLifecycleEntriesExistenceByLastPersistedDate
public boolean checkUnitLifecycleEntriesExistenceByLastPersistedDate(String startDate, String endDate) Description copied from interface:LogbookLifeCyclesChecks existence of new unit life cycles- Specified by:
checkUnitLifecycleEntriesExistenceByLastPersistedDatein interfaceLogbookLifeCycles- Parameters:
startDate- the selection start dateendDate- the selection end date
-
checkObjectGroupLifecycleEntriesExistenceByLastPersistedDate
public boolean checkObjectGroupLifecycleEntriesExistenceByLastPersistedDate(String startDate, String endDate) Description copied from interface:LogbookLifeCyclesChecks existence of new object group life cycles- Specified by:
checkObjectGroupLifecycleEntriesExistenceByLastPersistedDatein interfaceLogbookLifeCycles- Parameters:
startDate- the selection start dateendDate- the selection end date
-
getRawUnitLifeCycleById
public com.fasterxml.jackson.databind.JsonNode getRawUnitLifeCycleById(String id) throws LogbookNotFoundException, InvalidParseOperationException Description copied from interface:LogbookLifeCyclesreturns the raw version of unit life cycle- Specified by:
getRawUnitLifeCycleByIdin interfaceLogbookLifeCycles- Parameters:
id- the id to retrieve- Returns:
- the unit life cycle
- Throws:
LogbookNotFoundExceptionInvalidParseOperationException
-
getRawUnitLifeCycleByIds
public List<com.fasterxml.jackson.databind.JsonNode> getRawUnitLifeCycleByIds(List<String> ids) throws LogbookNotFoundException, InvalidParseOperationException Description copied from interface:LogbookLifeCyclesreturns the raw version of unit life cycle- Specified by:
getRawUnitLifeCycleByIdsin interfaceLogbookLifeCycles- Parameters:
ids- the ids to retrieve- Returns:
- the unit life cycle
- Throws:
LogbookNotFoundExceptionInvalidParseOperationException
-
getRawObjectGroupLifeCycleById
public com.fasterxml.jackson.databind.JsonNode getRawObjectGroupLifeCycleById(String id) throws LogbookNotFoundException, InvalidParseOperationException Description copied from interface:LogbookLifeCyclesreturns the raw version of object group life cycle- Specified by:
getRawObjectGroupLifeCycleByIdin interfaceLogbookLifeCycles- Parameters:
id- the id to retrieve- Returns:
- the object group life cycle
- Throws:
LogbookNotFoundExceptionInvalidParseOperationException
-
getRawObjectGroupLifeCycleByIds
public List<com.fasterxml.jackson.databind.JsonNode> getRawObjectGroupLifeCycleByIds(List<String> ids) throws LogbookNotFoundException, InvalidParseOperationException Description copied from interface:LogbookLifeCyclesreturns the raw version of object group life cycle- Specified by:
getRawObjectGroupLifeCycleByIdsin interfaceLogbookLifeCycles- Parameters:
ids- the ids to retrieve- Returns:
- the object group life cycle
- Throws:
LogbookNotFoundExceptionInvalidParseOperationException
-
updateLogbookLifeCycleBulk
public void updateLogbookLifeCycleBulk(LogbookCollections logbookCollections, List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk) Description copied from interface:LogbookLifeCyclesupdateLogbookLifeCycleBulk- Specified by:
updateLogbookLifeCycleBulkin interfaceLogbookLifeCycles- Parameters:
logbookCollections- lifecycleUnitInProcesslogbookLifeCycleParametersBulk- logbookLifeCycleParametersBulk
-
deleteLifeCycleObjectGroups
Description copied from interface:LogbookLifeCyclesdelete LifeCycle ObjectGroups- Specified by:
deleteLifeCycleObjectGroupsin interfaceLogbookLifeCycles- Parameters:
objectGroupIds- objectGroupIds- Throws:
DatabaseException- DatabaseException
-
deleteLifeCycleUnits
Description copied from interface:LogbookLifeCyclesdelete LifeCycle Units- Specified by:
deleteLifeCycleUnitsin interfaceLogbookLifeCycles- Parameters:
unitsIdentifier- units lfc Identifier- Throws:
DatabaseException- DatabaseException
-