Interface LogbookLifeCycles
-
- All Known Implementing Classes:
LogbookLifeCyclesImpl
public interface LogbookLifeCycles
Core API for LifeCycles
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bulk(LogbookCollections collections, java.lang.String idOp, java.util.List<? extends LogbookLifeCycleModel> logbookLifeCycleModels)
Bulk methodboolean
checkObjectGroupLifecycleEntriesExistenceByLastPersistedDate(java.lang.String startDate, java.lang.String endDate)
Checks existence of new object group life cyclesboolean
checkUnitLifecycleEntriesExistenceByLastPersistedDate(java.lang.String startDate, java.lang.String endDate)
Checks existence of new unit life cyclesvoid
commitObjectGroup(java.lang.String idOperation, java.lang.String idLc)
Commits ObjectGroup lifeCyclevoid
commitUnit(java.lang.String idOperation, java.lang.String idLc)
Commits Unit lifeCyclevoid
createBulkLogbookLifecycle(java.lang.String idOp, LogbookLifeCycleParameters[] lifecycleArray)
Create one Logbook Lifecycle with already multiple sub-eventsvoid
createObjectGroup(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleObjectGroupParameters parameters)
Create and insert logbook LifeCycle entriesvoid
createUnit(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleUnitParameters parameters)
Create and insert logbook LifeCycle entriesvoid
deleteLifeCycleObjectGroups(java.util.List<java.lang.String> objectGroupIds)
delete LifeCycle ObjectGroupsvoid
deleteLifeCycleUnits(java.util.List<java.lang.String> unitsIdentifier)
delete LifeCycle UnitsLifeCycleStatusCode
getObjectGroupLifeCycleStatus(java.lang.String objectGroupId)
Returns the LifeCycle Status for a given objectGroup Idcom.fasterxml.jackson.databind.JsonNode
getRawObjectGroupLifeCycleById(java.lang.String id)
returns the raw version of object group life cyclejava.util.List<com.fasterxml.jackson.databind.JsonNode>
getRawObjectGroupLifeCycleByIds(java.util.List<java.lang.String> ids)
returns the raw version of object group life cycleCloseableIterator<com.fasterxml.jackson.databind.JsonNode>
getRawObjectGroupLifecyclesByLastPersistedDate(java.lang.String startDate, java.lang.String endDate, int limit)
Gets a list of raw object group life cycles by requestcom.fasterxml.jackson.databind.JsonNode
getRawUnitLifeCycleById(java.lang.String id)
returns the raw version of unit life cyclejava.util.List<com.fasterxml.jackson.databind.JsonNode>
getRawUnitLifeCycleByIds(java.util.List<java.lang.String> ids)
returns the raw version of unit life cycleCloseableIterator<com.fasterxml.jackson.databind.JsonNode>
getRawUnitLifecyclesByLastPersistedDate(java.lang.String startDate, java.lang.String endDate, int limit)
Gets a list of raw unit life cycles by requestLifeCycleStatusCode
getUnitLifeCycleStatus(java.lang.String unitId)
Returns the LifeCycle Status for a given unit Idvoid
rollbackObjectGroup(java.lang.String idOperation, java.lang.String idLc)
Rollback logbook LifeCycle entriesvoid
rollBackObjectGroupsByOperation(java.lang.String idOperation)
Removes the created object groups lifeCycles during a given operationvoid
rollbackUnit(java.lang.String idOperation, java.lang.String idLc)
Rollback logbook LifeCycle entriesvoid
rollBackUnitsByOperation(java.lang.String idOperation)
Removes the created unit lifeCycles during a given operationLogbookLifeCycle<?>
selectLifeCycleById(java.lang.String lifecycleId, com.fasterxml.jackson.databind.JsonNode queryDsl, boolean sliced, LogbookCollections collection)
Selects life cycle entryjava.util.List<LogbookLifeCycle<?>>
selectLifeCycles(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection)
Selects life cycle entriesvoid
updateBulkLogbookLifecycle(java.lang.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 lifecycleUnitInProcess, java.util.List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk)
updateLogbookLifeCycleBulkvoid
updateObjectGroup(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleObjectGroupParameters parameters)
Update logbook LifeCycle entriesvoid
updateObjectGroup(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleObjectGroupParameters parameters, boolean commit)
Update logbook LifeCycle entriesvoid
updateUnit(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleUnitParameters parameters)
Update logbook LifeCycle entriesvoid
updateUnit(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleUnitParameters parameters, boolean commit)
Update logbook LifeCycle entries committed or in progress
-
-
-
Method Detail
-
createUnit
void createUnit(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException
Create and insert logbook LifeCycle entries- 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 database
-
createObjectGroup
void createObjectGroup(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException
Create and insert logbook LifeCycle entries- 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 database
-
updateUnit
void updateUnit(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleUnitParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException
Update logbook LifeCycle entries- 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 exists
-
updateUnit
void updateUnit(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleUnitParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException
Update logbook LifeCycle entries committed or in progress- 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
void updateObjectGroup(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleObjectGroupParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException
Update logbook LifeCycle entries- 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 exists
-
updateObjectGroup
void updateObjectGroup(java.lang.String idOperation, java.lang.String idLc, LogbookLifeCycleObjectGroupParameters parameters, boolean commit) throws LogbookNotFoundException, LogbookDatabaseException, LogbookAlreadyExistsException
Update logbook LifeCycle entries- 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 exists
-
selectLifeCycles
java.util.List<LogbookLifeCycle<?>> selectLifeCycles(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
Selects life cycle entries- 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:
LogbookNotFoundException
- if no LifeCycle selected cannot be foundLogbookDatabaseException
- if errors occur while connecting or writing to the databaseInvalidParseOperationException
- if invalid parse for selecting the LifeCycleVitamDBException
- in case a desynchro is recorded between Mongo and ES
-
selectLifeCycleById
LogbookLifeCycle<?> selectLifeCycleById(java.lang.String lifecycleId, com.fasterxml.jackson.databind.JsonNode queryDsl, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException, InvalidCreateOperationException
Selects life cycle entry- 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:
LogbookNotFoundException
- if no LifeCycle selected cannot be foundLogbookDatabaseException
- if errors occur while connecting or writing to the databaseInvalidParseOperationException
- if invalid parse for selecting the LifeCycleInvalidParseOperationException
- if invalid parse for selecting the LifeCycleVitamDBException
- in case a desynchro is recorded between Mongo and ESInvalidCreateOperationException
-
rollbackUnit
void rollbackUnit(java.lang.String idOperation, java.lang.String idLc) throws LogbookNotFoundException, LogbookDatabaseException
Rollback logbook LifeCycle entries- 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 database
-
rollbackObjectGroup
void rollbackObjectGroup(java.lang.String idOperation, java.lang.String idLc) throws LogbookNotFoundException, LogbookDatabaseException
Rollback logbook LifeCycle entries- 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 database
-
createBulkLogbookLifecycle
void createBulkLogbookLifecycle(java.lang.String idOp, LogbookLifeCycleParameters[] lifecycleArray) throws LogbookDatabaseException, LogbookAlreadyExistsException
Create one Logbook Lifecycle with already multiple sub-events- Parameters:
idOp
- Operation IdlifecycleArray
- with first and next events to add/update- Throws:
java.lang.IllegalArgumentException
- if first argument is null or null mandatory parameters for allLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException
- if LifeCycle already exists
-
updateBulkLogbookLifecycle
void updateBulkLogbookLifecycle(java.lang.String idOp, LogbookLifeCycleParameters[] lifecycleArray) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Update one Logbook Lifecycle with multiple sub-events
It adds this new entry within the very same Logbook Lifecycle entry in "events" array.- Parameters:
idOp
- Operation IdlifecycleArray
- containing all Lifecycle Logbook in order- Throws:
java.lang.IllegalArgumentException
- if parameter has null or empty mandatory valuesLogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be foundLogbookAlreadyExistsException
- if LifeCycle already exists
-
commitUnit
void commitUnit(java.lang.String idOperation, java.lang.String idLc) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Commits Unit lifeCycle- 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
void commitObjectGroup(java.lang.String idOperation, java.lang.String idLc) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Commits ObjectGroup lifeCycle- 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
void rollBackUnitsByOperation(java.lang.String idOperation) throws LogbookNotFoundException, LogbookDatabaseException
Removes the created unit lifeCycles during a given operation- Parameters:
idOperation
- the operation id- Throws:
LogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be found
-
rollBackObjectGroupsByOperation
void rollBackObjectGroupsByOperation(java.lang.String idOperation) throws LogbookNotFoundException, LogbookDatabaseException
Removes the created object groups lifeCycles during a given operation- Parameters:
idOperation
- the operation id- Throws:
LogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if LifeCycle cannot be found
-
getUnitLifeCycleStatus
LifeCycleStatusCode getUnitLifeCycleStatus(java.lang.String unitId) throws LogbookDatabaseException, LogbookNotFoundException
Returns the LifeCycle Status for a given unit Id- 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
LifeCycleStatusCode getObjectGroupLifeCycleStatus(java.lang.String objectGroupId) throws LogbookDatabaseException, LogbookNotFoundException
Returns the LifeCycle Status for a given objectGroup Id- 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
void bulk(LogbookCollections collections, java.lang.String idOp, java.util.List<? extends LogbookLifeCycleModel> logbookLifeCycleModels) throws DatabaseException
Bulk method- Parameters:
collections
- the logbook collectionsidOp
- operation identifierlogbookLifeCycleModels
- lifecycles to be created- Throws:
DatabaseException
- if database could not be reached
-
getRawUnitLifecyclesByLastPersistedDate
CloseableIterator<com.fasterxml.jackson.databind.JsonNode> getRawUnitLifecyclesByLastPersistedDate(java.lang.String startDate, java.lang.String endDate, int limit)
Gets a list of raw unit life cycles by request- Parameters:
startDate
- the selection start dateendDate
- the selection end datelimit
- the max limit
-
getRawObjectGroupLifecyclesByLastPersistedDate
CloseableIterator<com.fasterxml.jackson.databind.JsonNode> getRawObjectGroupLifecyclesByLastPersistedDate(java.lang.String startDate, java.lang.String endDate, int limit)
Gets a list of raw object group life cycles by request- Parameters:
startDate
- the selection start dateendDate
- the selection end datelimit
- the max limit
-
checkUnitLifecycleEntriesExistenceByLastPersistedDate
boolean checkUnitLifecycleEntriesExistenceByLastPersistedDate(java.lang.String startDate, java.lang.String endDate)
Checks existence of new unit life cycles- Parameters:
startDate
- the selection start dateendDate
- the selection end date
-
checkObjectGroupLifecycleEntriesExistenceByLastPersistedDate
boolean checkObjectGroupLifecycleEntriesExistenceByLastPersistedDate(java.lang.String startDate, java.lang.String endDate)
Checks existence of new object group life cycles- Parameters:
startDate
- the selection start dateendDate
- the selection end date
-
getRawUnitLifeCycleById
com.fasterxml.jackson.databind.JsonNode getRawUnitLifeCycleById(java.lang.String id) throws LogbookNotFoundException, InvalidParseOperationException
returns the raw version of unit life cycle- Parameters:
id
- the id to retrieve- Returns:
- the unit life cycle
- Throws:
LogbookNotFoundException
InvalidParseOperationException
-
getRawUnitLifeCycleByIds
java.util.List<com.fasterxml.jackson.databind.JsonNode> getRawUnitLifeCycleByIds(java.util.List<java.lang.String> ids) throws LogbookNotFoundException, InvalidParseOperationException
returns the raw version of unit life cycle- Parameters:
ids
- the ids to retrieve- Returns:
- the unit life cycle
- Throws:
LogbookNotFoundException
InvalidParseOperationException
-
getRawObjectGroupLifeCycleById
com.fasterxml.jackson.databind.JsonNode getRawObjectGroupLifeCycleById(java.lang.String id) throws LogbookNotFoundException, InvalidParseOperationException
returns the raw version of object group life cycle- Parameters:
id
- the id to retrieve- Returns:
- the object group life cycle
- Throws:
LogbookNotFoundException
InvalidParseOperationException
-
getRawObjectGroupLifeCycleByIds
java.util.List<com.fasterxml.jackson.databind.JsonNode> getRawObjectGroupLifeCycleByIds(java.util.List<java.lang.String> ids) throws LogbookNotFoundException, InvalidParseOperationException
returns the raw version of object group life cycle- Parameters:
ids
- the ids to retrieve- Returns:
- the object group life cycle
- Throws:
LogbookNotFoundException
InvalidParseOperationException
-
updateLogbookLifeCycleBulk
void updateLogbookLifeCycleBulk(LogbookCollections lifecycleUnitInProcess, java.util.List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk)
updateLogbookLifeCycleBulk- Parameters:
lifecycleUnitInProcess
- lifecycleUnitInProcesslogbookLifeCycleParametersBulk
- logbookLifeCycleParametersBulk
-
deleteLifeCycleObjectGroups
void deleteLifeCycleObjectGroups(java.util.List<java.lang.String> objectGroupIds) throws DatabaseException
delete LifeCycle ObjectGroups- Parameters:
objectGroupIds
- objectGroupIds- Throws:
DatabaseException
- DatabaseException
-
deleteLifeCycleUnits
void deleteLifeCycleUnits(java.util.List<java.lang.String> unitsIdentifier) throws DatabaseException
delete LifeCycle Units- Parameters:
unitsIdentifier
- units lfc Identifier- Throws:
DatabaseException
- DatabaseException
-
-