public class LogbookLifeCyclesImpl extends Object implements LogbookLifeCycles
| Constructor and Description |
|---|
LogbookLifeCyclesImpl(LogbookDbAccess mongoDbAccess)
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
|
void |
deleteLifeCycleObjectGroups(List<String> objectGroupIds)
delete LifeCycle ObjectGroups
|
void |
deleteLifeCycleUnits(List<String> unitsIdentifier)
delete LifeCycle Units
|
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
|
com.fasterxml.jackson.databind.JsonNode |
getRawObjectGroupLifeCycleById(String id)
returns the raw version of object group life cycle
|
List<com.fasterxml.jackson.databind.JsonNode> |
getRawObjectGroupLifecyclesByLastPersistedDate(String startDate,
String endDate,
int limit)
Gets a list of raw object group life cycles by request
|
com.fasterxml.jackson.databind.JsonNode |
getRawUnitLifeCycleById(String id)
returns the raw version of unit life cycle
|
List<com.fasterxml.jackson.databind.JsonNode> |
getRawUnitLifecyclesByLastPersistedDate(String startDate,
String endDate,
int limit)
Gets a list of raw unit life cycles by request
|
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 |
updateLogbookLifeCycleBulk(LogbookCollections logbookCollections,
List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk)
updateLogbookLifeCycleBulk
|
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 void createUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCyclescreateUnit in interface LogbookLifeCyclesidOperation - 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 databaseIllegalArgumentExceptionpublic void createObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCyclescreateObjectGroup in interface LogbookLifeCyclesidOperation - 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 databaseIllegalArgumentExceptionpublic void updateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookDatabaseException, IllegalArgumentException, LogbookNotFoundException, LogbookAlreadyExistsException
LogbookLifeCyclesupdateUnit in interface LogbookLifeCyclesidOperation - 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 existsIllegalArgumentExceptionpublic void updateUnit(String idOperation, String idLc, LogbookLifeCycleUnitParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException
LogbookLifeCyclesupdateUnit in interface LogbookLifeCyclesidOperation - 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
LogbookLifeCyclesupdateObjectGroup in interface LogbookLifeCyclesidOperation - 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 existsIllegalArgumentExceptionpublic void updateObjectGroup(String idOperation, String idLc, LogbookLifeCycleObjectGroupParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException, LogbookAlreadyExistsException
LogbookLifeCyclesupdateObjectGroup in interface LogbookLifeCyclesidOperation - 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 existsIllegalArgumentExceptionpublic LogbookLifeCycleUnit getUnitByOperationIdAndByUnitId(String idOperation, String idLc) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException
LogbookLifeCyclesgetUnitByOperationIdAndByUnitId in interface LogbookLifeCyclesidOperation - 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
LogbookLifeCyclesgetObjectGroupByOperationIdAndByObjectGroupId in interface LogbookLifeCyclesidOperation - 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 LifeCycleIllegalArgumentExceptionpublic List<LogbookLifeCycle> selectUnit(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
LogbookLifeCyclesselectUnit in interface LogbookLifeCyclesselect - 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
LogbookLifeCyclesselectObjectGroup in interface LogbookLifeCyclesselect - 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
LogbookLifeCyclesselectObjectGroup in interface LogbookLifeCyclesselect - 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
LogbookLifeCyclesrollbackUnit in interface LogbookLifeCyclesidOperation - the operation identifieridLc - the lifecycle identifierLogbookNotFoundException - if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException - if errors occur while connecting or writing to the databaseIllegalArgumentExceptionpublic void rollbackObjectGroup(String idOperation, String idLc) throws LogbookNotFoundException, LogbookDatabaseException, IllegalArgumentException
LogbookLifeCyclesrollbackObjectGroup in interface LogbookLifeCyclesidOperation - the operation identifieridLc - the lifecycle identifierLogbookNotFoundException - if no LifeCycle with the same eventIdentifierProcess existsLogbookDatabaseException - if errors occur while connecting or writing to the databaseIllegalArgumentExceptionpublic LogbookLifeCycleUnit getUnitById(String idUnit) throws LogbookDatabaseException, LogbookNotFoundException
LogbookLifeCyclesgetUnitById in interface LogbookLifeCyclesidUnit - 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
LogbookLifeCyclesgetUnitById in interface LogbookLifeCyclesqueryDsl - 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
LogbookLifeCyclesgetObjectGroupById in interface LogbookLifeCyclesidObjectGroup - 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
LogbookLifeCyclescreateBulkLogbookLifecycle in interface LogbookLifeCyclesidOp - 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
LogbookLifeCyclesupdateBulkLogbookLifecycle in interface LogbookLifeCyclesidOp - 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
LogbookLifeCyclescommitUnit in interface LogbookLifeCyclesidOperation - 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
LogbookLifeCyclescommitObjectGroup in interface LogbookLifeCyclesidOperation - 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
LogbookLifeCyclesrollBackUnitsByOperation in interface LogbookLifeCyclesidOperation - 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
LogbookLifeCyclesrollBackObjectGroupsByOperation in interface LogbookLifeCyclesidOperation - 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
LogbookLifeCyclesgetUnitLifeCycleStatus in interface LogbookLifeCyclesunitId - 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
LogbookLifeCyclesgetObjectGroupLifeCycleStatus in interface LogbookLifeCyclesobjectGroupId - 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
LogbookLifeCyclesbulk in interface LogbookLifeCyclescollections - the logbook collectionsidOp - operation identifierlogbookLifeCycleModels - lifecycles to be createdDatabaseException - if database could not be reachedpublic List<com.fasterxml.jackson.databind.JsonNode> getRawUnitLifecyclesByLastPersistedDate(String startDate, String endDate, int limit) throws InvalidParseOperationException
LogbookLifeCyclesgetRawUnitLifecyclesByLastPersistedDate in interface LogbookLifeCyclesstartDate - the selection start dateendDate - the selection end datelimit - the max limitInvalidParseOperationExceptionpublic List<com.fasterxml.jackson.databind.JsonNode> getRawObjectGroupLifecyclesByLastPersistedDate(String startDate, String endDate, int limit) throws InvalidParseOperationException
LogbookLifeCyclesgetRawObjectGroupLifecyclesByLastPersistedDate in interface LogbookLifeCyclesstartDate - the selection start dateendDate - the selection end datelimit - the max limitInvalidParseOperationExceptionpublic com.fasterxml.jackson.databind.JsonNode getRawUnitLifeCycleById(String id) throws LogbookNotFoundException, InvalidParseOperationException
LogbookLifeCyclesgetRawUnitLifeCycleById in interface LogbookLifeCyclesid - the id to retrieveLogbookNotFoundExceptionInvalidParseOperationExceptionpublic com.fasterxml.jackson.databind.JsonNode getRawObjectGroupLifeCycleById(String id) throws LogbookNotFoundException, InvalidParseOperationException
LogbookLifeCyclesgetRawObjectGroupLifeCycleById in interface LogbookLifeCyclesid - the id to retrieveLogbookNotFoundExceptionInvalidParseOperationExceptionpublic void updateLogbookLifeCycleBulk(LogbookCollections logbookCollections, List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk)
LogbookLifeCyclesupdateLogbookLifeCycleBulk in interface LogbookLifeCycleslogbookCollections - lifecycleUnitInProcesslogbookLifeCycleParametersBulk - logbookLifeCycleParametersBulkpublic void deleteLifeCycleObjectGroups(List<String> objectGroupIds) throws DatabaseException
LogbookLifeCyclesdeleteLifeCycleObjectGroups in interface LogbookLifeCyclesobjectGroupIds - objectGroupIdsDatabaseException - DatabaseExceptionpublic void deleteLifeCycleUnits(List<String> unitsIdentifier) throws DatabaseException
LogbookLifeCyclesdeleteLifeCycleUnits in interface LogbookLifeCyclesunitsIdentifier - units lfc IdentifierDatabaseException - DatabaseExceptionCopyright © 2018 Vitam. All rights reserved.