public class LogbookLifeCyclesImpl extends Object implements LogbookLifeCycles
Constructor and Description |
---|
LogbookLifeCyclesImpl(LogbookDbAccess mongoDbAccess)
Constructor
|
LogbookLifeCyclesImpl(LogbookDbAccess mongoDbAccess,
boolean disablePurge)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
bulk(LogbookCollections collections,
String idOp,
List<? extends LogbookLifeCycleModel> logbookLifeCycleModels)
Bulk method
|
void |
commitObjectGroup(String idOperation,
String idLc)
Commits ObjectGroup lifeCycle
|
void |
commitUnit(String idOperation,
String idLc)
Commits Unit lifeCycle
|
void |
createBulkLogbookLifecycle(String idOp,
LogbookLifeCycleParameters[] lifecycleArray)
Create one Logbook Lifecycle with already multiple sub-events
|
void |
createObjectGroup(String idOperation,
String idLc,
LogbookLifeCycleObjectGroupParameters parameters)
Create and insert logbook LifeCycle entries
|
void |
createUnit(String idOperation,
String idLc,
LogbookLifeCycleUnitParameters parameters)
Create and insert logbook LifeCycle entries
|
LogbookLifeCycleObjectGroup |
getObjectGroupById(String idObjectGroup)
Select logbook life cycle by the lifecycle's ID
|
LogbookLifeCycleObjectGroup |
getObjectGroupByOperationIdAndByObjectGroupId(String idOperation,
String idLc)
Select logbook LifeCycle entry by operation
|
LifeCycleStatusCode |
getObjectGroupLifeCycleStatus(String objectGroupId)
Returns the LifeCycle Status for a given objectGroup Id
|
LogbookLifeCycle |
getUnitById(com.fasterxml.jackson.databind.JsonNode queryDsl,
LogbookCollections collection)
Selects logbook life cycle by lifecycle ID (using a queryDsl)
|
LogbookLifeCycleUnit |
getUnitById(String idUnit)
Select logbook life cycle by the lifecycle's ID
|
LogbookLifeCycleUnit |
getUnitByOperationIdAndByUnitId(String idOperation,
String idLc)
Select logbook LifeCycle entry by operation
|
LifeCycleStatusCode |
getUnitLifeCycleStatus(String unitId)
Returns the LifeCycle Status for a given unit Id
|
void |
rollbackObjectGroup(String idOperation,
String idLc)
Rollback logbook LifeCycle entries
|
void |
rollBackObjectGroupsByOperation(String idOperation)
Removes the created object groups lifeCycles during a given operation
|
void |
rollbackUnit(String idOperation,
String idLc)
Rollback logbook LifeCycle entries
|
void |
rollBackUnitsByOperation(String idOperation)
Removes the created unit lifeCycles during a given operation
|
List<LogbookLifeCycle> |
selectObjectGroup(com.fasterxml.jackson.databind.JsonNode select,
boolean sliced,
LogbookCollections collection)
Selects object group life cycle entries
|
List<LogbookLifeCycle> |
selectObjectGroup(com.fasterxml.jackson.databind.JsonNode select,
LogbookCollections collection)
Selects object group life cycle entries
|
List<LogbookLifeCycle> |
selectUnit(com.fasterxml.jackson.databind.JsonNode select,
boolean sliced,
LogbookCollections collection)
Select logbook LifeCycle entries
|
void |
updateBulkLogbookLifecycle(String idOp,
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. |
void |
updateObjectGroup(String idOperation,
String idLc,
LogbookLifeCycleObjectGroupParameters parameters)
Update logbook LifeCycle entries
|
void |
updateObjectGroup(String idOperation,
String idLc,
LogbookLifeCycleObjectGroupParameters parameters,
boolean commit)
Update logbook LifeCycle entries
|
void |
updateUnit(String idOperation,
String idLc,
LogbookLifeCycleUnitParameters parameters)
Update logbook LifeCycle entries
|
void |
updateUnit(String idOperation,
String idLc,
LogbookLifeCycleUnitParameters parameters,
boolean commit)
Update logbook LifeCycle entries committed or in progress
|
public LogbookLifeCyclesImpl(LogbookDbAccess mongoDbAccess)
mongoDbAccess
- of logbookpublic LogbookLifeCyclesImpl(LogbookDbAccess mongoDbAccess, boolean disablePurge)
mongoDbAccess
- of logbookpublic void createUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCycles
createUnit
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle unit identifierparameters
- the logbook lifecycle parametersLogbookAlreadyExistsException
- if an LifeCycle with the same eventIdentifierProcess and outcome="Started"
already existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseIllegalArgumentException
public void createObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCycles
createObjectGroup
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierparameters
- the logbook lifecycle parametersLogbookAlreadyExistsException
- if an LifeCycle with the same eventIdentifierProcess and outcome="Started"
already existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseIllegalArgumentException
public void updateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookDatabaseException, IllegalArgumentException, LogbookNotFoundException, LogbookAlreadyExistsException
LogbookLifeCycles
updateUnit
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierparameters
- the logbook lifecycle parametersLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no LifeCycle with the same eventIdentifierProcess existsLogbookAlreadyExistsException
- if the entry already existsIllegalArgumentException
public void updateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException
LogbookLifeCycles
updateUnit
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierparameters
- the logbook lifecycle parameterscommit
- if false update in progress collection else update committed LFCLogbookNotFoundException
- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException
- if the entry already existspublic void updateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException, LogbookAlreadyExistsException
LogbookLifeCycles
updateObjectGroup
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierparameters
- the logbook lifecycle parametersLogbookNotFoundException
- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException
- if the entry already existsIllegalArgumentException
public void updateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException, LogbookAlreadyExistsException
LogbookLifeCycles
updateObjectGroup
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierparameters
- the logbook lifecycle parameterscommit
- if true update is done on committed collection otherwise on inProcess oneLogbookNotFoundException
- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException
- if the entry already existsIllegalArgumentException
public LogbookLifeCycleUnit getUnitByOperationIdAndByUnitId(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException
LogbookLifeCycles
getUnitByOperationIdAndByUnitId
in interface LogbookLifeCycles
idOperation
- the operation ididLc
- the logbook identifierLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no LifeCycle selected cannot be foundInvalidParseOperationException
- if invalid parse for selecting the LifeCyclepublic LogbookLifeCycleObjectGroup getObjectGroupByOperationIdAndByObjectGroupId(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, IllegalArgumentException
LogbookLifeCycles
getObjectGroupByOperationIdAndByObjectGroupId
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the logbook identifierLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no LifeCycle selected cannot be foundInvalidParseOperationException
- if invalid parse for selecting the LifeCycleIllegalArgumentException
public List<LogbookLifeCycle> selectUnit(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
LogbookLifeCycles
selectUnit
in interface LogbookLifeCycles
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_UNIT) or Working collection (LIFECYCLE_UNIT_IN_PROCESS)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 ESpublic List<LogbookLifeCycle> selectObjectGroup(com.fasterxml.jackson.databind.JsonNode select, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
LogbookLifeCycles
selectObjectGroup
in interface LogbookLifeCycles
select
- the select request in format of JsonNodecollection
- the collection on which the select operation will be done : Production collection
(LIFECYCLE_OBJECT_GROUP) or Working collection (LIFECYCLE_OBJECT_GROUP_IN_PROCESS)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 ESpublic List<LogbookLifeCycle> selectObjectGroup(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
LogbookLifeCycles
selectObjectGroup
in interface LogbookLifeCycles
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) or Working collection (LIFECYCLE_OBJECT_GROUP_IN_PROCESS)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 ESpublic void rollbackUnit(String idOperation, String idLc) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCycles
rollbackUnit
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierLogbookNotFoundException
- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseIllegalArgumentException
public void rollbackObjectGroup(String idOperation, String idLc) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCycles
rollbackObjectGroup
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierLogbookNotFoundException
- if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException
- if errors occur while connecting or writing to the databaseIllegalArgumentException
public LogbookLifeCycleUnit getUnitById(String idUnit) throws LogbookDatabaseException, LogbookNotFoundException
LogbookLifeCycles
getUnitById
in interface LogbookLifeCycles
idUnit
- the unit identifierLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no LifeCycle selected cannot be foundpublic LogbookLifeCycle getUnitById(com.fasterxml.jackson.databind.JsonNode queryDsl, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException
LogbookLifeCycles
getUnitById
in interface LogbookLifeCycles
queryDsl
- the query as a jsoncollection
- the collection on which the select operation will be done : Production collection
(LIFECYCLE_UNIT) or Working collection (LIFECYCLE_UNIT_IN_PROCESS)LogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no LifeCycle selected cannot be foundpublic LogbookLifeCycleObjectGroup getObjectGroupById(String idObjectGroup) throws LogbookDatabaseException, LogbookNotFoundException
LogbookLifeCycles
getObjectGroupById
in interface LogbookLifeCycles
idObjectGroup
- the object group identifierLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no LifeCycle selected cannot be foundpublic void createBulkLogbookLifecycle(String idOp, LogbookLifeCycleParameters[] lifecycleArray) throws LogbookDatabaseException, LogbookAlreadyExistsException
LogbookLifeCycles
createBulkLogbookLifecycle
in interface LogbookLifeCycles
idOp
- Operation IdlifecycleArray
- with first and next events to add/updateLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException
- if LifeCycle already existspublic void updateBulkLogbookLifecycle(String idOp, LogbookLifeCycleParameters[] lifecycleArray) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
LogbookLifeCycles
updateBulkLogbookLifecycle
in interface LogbookLifeCycles
idOp
- Operation IdlifecycleArray
- containing all Lifecycle Logbook in orderLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be foundLogbookAlreadyExistsException
- if LifeCycle already existspublic void commitUnit(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
LogbookLifeCycles
commitUnit
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be foundLogbookAlreadyExistsException
- if LifeCycle already existspublic void commitObjectGroup(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
LogbookLifeCycles
commitObjectGroup
in interface LogbookLifeCycles
idOperation
- the operation identifieridLc
- the lifecycle identifierLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be foundLogbookAlreadyExistsException
- if LifeCycle already existspublic void rollBackUnitsByOperation(String idOperation) throws LogbookNotFoundException, LogbookDatabaseException
LogbookLifeCycles
rollBackUnitsByOperation
in interface LogbookLifeCycles
idOperation
- the operation idLogbookNotFoundException
- if LifeCycle cannot be foundLogbookDatabaseException
- if errors occur while connecting or writing to the databasepublic void rollBackObjectGroupsByOperation(String idOperation) throws LogbookNotFoundException, LogbookDatabaseException
LogbookLifeCycles
rollBackObjectGroupsByOperation
in interface LogbookLifeCycles
idOperation
- the operation idLogbookNotFoundException
- if LifeCycle cannot be foundLogbookDatabaseException
- if errors occur while connecting or writing to the databasepublic LifeCycleStatusCode getUnitLifeCycleStatus(String unitId) throws LogbookDatabaseException, LogbookNotFoundException
LogbookLifeCycles
getUnitLifeCycleStatus
in interface LogbookLifeCycles
unitId
- the unit IdLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be foundpublic LifeCycleStatusCode getObjectGroupLifeCycleStatus(String objectGroupId) throws LogbookDatabaseException, LogbookNotFoundException
LogbookLifeCycles
getObjectGroupLifeCycleStatus
in interface LogbookLifeCycles
objectGroupId
- the objectGroup IdLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be foundpublic void bulk(LogbookCollections collections, String idOp, List<? extends LogbookLifeCycleModel> logbookLifeCycleModels) throws DatabaseException
LogbookLifeCycles
bulk
in interface LogbookLifeCycles
collections
- the logbook collectionsidOp
- operation identifierlogbookLifeCycleModels
- lifecycles to be createdDatabaseException
- if database could not be reachedCopyright © 2018 Vitam. All rights reserved.