Class LogbookMongoDbAccessImpl
- java.lang.Object
-
- fr.gouv.vitam.common.database.server.mongodb.MongoDbAccess
-
- fr.gouv.vitam.logbook.common.server.database.collections.LogbookMongoDbAccessImpl
-
- All Implemented Interfaces:
DatabaseConnection
,LogbookDbAccess
public final class LogbookMongoDbAccessImpl extends MongoDbAccess implements LogbookDbAccess
MongoDb Access implementation base class
-
-
Constructor Summary
Constructors Constructor Description LogbookMongoDbAccessImpl(com.mongodb.MongoClient mongoClient, java.lang.String dbname, boolean recreate, LogbookElasticsearchAccess esClient, LogbookTransformData logbookTransformData, OntologyLoader ontologyLoader)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bulkInsert(LogbookCollections lifecycleUnit, java.util.List<? extends LogbookLifeCycleModel> logbookLifeCycleModels)
void
close()
Close database accessvoid
createBulkLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupParameters... lifecycleItems)
Create one Logbook LifeCycle with already multiple sub-eventsvoid
createBulkLogbookLifeCycleUnit(LogbookLifeCycleUnitParameters... lifecycleItems)
Create one Logbook LifeCycle with already multiple sub-eventsvoid
createBulkLogbookOperation(LogbookOperationParameters... operationItems)
Create one Logbook Operation with already multiple sub-eventsvoid
createLogbookLifeCycleForUpdate(LogbookCollections inProccessCollection, LogbookLifeCycle<?> logbookLifeCycleInProd)
void
createLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupInProcess logbookLifeCycleObjectGroupInProcess)
Creates ObjectGroup lifeCycle from a LogbookLifeCycleObjectGroupInProcess instancevoid
createLogbookLifeCycleObjectGroup(java.lang.String idOperation, LogbookLifeCycleObjectGroupParameters lifecycleItem)
Create one Logbook LifeCycle object groupvoid
createLogbookLifeCycleUnit(LogbookLifeCycleUnitInProcess logbookLifeCycleUnitInProcess)
Creates Unit lifeCycle from a LogbookLifeCycleUnitInProcess instancevoid
createLogbookLifeCycleUnit(java.lang.String idOperation, LogbookLifeCycleUnitParameters lifecycleItem)
Create one Logbook LifeCycle unitvoid
createLogbookOperation(LogbookOperationParameters operationItem)
Create one Logbook Operationvoid
deleteCollectionForTesting(LogbookCollections collection)
Delete logbook collectionboolean
existsLogbookLifeCycleObjectGroup(java.lang.String objectGroupId)
Check if one eventIdentifier for Lifecycle exists alreadyboolean
existsLogbookLifeCycleObjectGroupInProcess(java.lang.String objectGroupId)
Check if one eventIdentifier for Lifecycle exists alreadyboolean
existsLogbookLifeCycleUnit(java.lang.String unitId)
Check if one eventIdentifier for Lifecycle exists alreadyboolean
existsLogbookLifeCycleUnitInProcess(java.lang.String unitId)
Check if one eventIdentifier for Lifecycle exists alreadyboolean
existsLogbookOperation(java.lang.String operationItem)
Check if one eventIdentifier for Operation exists alreadyLogbookElasticsearchAccess
getEsClient()
java.lang.String
getInfo()
Get information on a DatabaseLogbookLifeCycleObjectGroupInProcess
getLogbookLifeCycleObjectGroupInProcess(java.lang.String objectGroupId)
Gets ObjectGroup LifeCycle In processVitamMongoCursor<LogbookLifeCycleObjectGroup>
getLogbookLifeCycleObjectGroupsFull(LogbookCollections collection, Select select)
Get a list of Logbook LifeCycle through Closeable MongoCursorcom.mongodb.client.MongoCursor<LogbookLifeCycle<?>>
getLogbookLifeCycles(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection)
Get a list of Logbook LifeCycles through Closeable MongoCursorLogbookLifeCycleUnitInProcess
getLogbookLifeCycleUnitInProcess(java.lang.String unitId)
Get Unit LifeCycle In processVitamMongoCursor<LogbookLifeCycleUnit>
getLogbookLifeCycleUnitsFull(LogbookCollections collection, Select select)
Get a list of Logbook LifeCycle through Closeable MongoCursorlong
getLogbookLifeCyleObjectGroupInProcessSize()
long
getLogbookLifeCyleObjectGroupSize()
long
getLogbookLifeCyleUnitInProcessSize()
long
getLogbookLifeCyleUnitSize()
LogbookOperation
getLogbookOperationById(java.lang.String eventIdentifierProcess)
Get one OperationLogbookOperation
getLogbookOperationById(java.lang.String eventIdentifierProcess, com.fasterxml.jackson.databind.JsonNode query, boolean sliced, boolean crossTenant)
Get one OperationVitamMongoCursor<LogbookOperation>
getLogbookOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced)
VitamMongoCursor<LogbookOperation>
getLogbookOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant)
Get a list of Logbook Operation through Closeable MongoCursorlong
getLogbookOperationSize()
LogbookLifeCycle<?>
getOneLogbookLifeCycle(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection)
Get a list of Logbook LifeCycles through Closeable MongoCursorvoid
rollbackLogbookLifeCycleObjectGroup(java.lang.String idOperation, java.lang.String lifecycleItem)
Rollback one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
rollbackLogbookLifeCycleUnit(java.lang.String idOperation, java.lang.String lifecycleItem)
Rollback one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
rollBackObjectGroupLifeCyclesByOperation(java.lang.String operationId)
Rolls back all the created objectGroups lifeCycles during a given operationvoid
rollBackUnitLifeCyclesByOperation(java.lang.String operationId)
Rolls back all the created unit lifeCycles during a given operationvoid
updateBulkLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupParameters... lifecycleItems)
Update one Logbook LifeCycle with multiple sub-events
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
updateBulkLogbookLifeCycleUnit(LogbookLifeCycleUnitParameters... lifecycleItems)
Update one Logbook LifeCycle with multiple sub-events
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
updateBulkLogbookOperation(LogbookOperationParameters... operationItems)
Update one Logbook Operation with multiple sub-events
It adds this new entry within the very same Logbook Operaton entry in "events" array.void
updateLogbookLifeCycle(LogbookCollections collection, java.util.List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk)
void
updateLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupInProcess logbookLifeCycleObjectGrouptInProcess)
Updates ObjectGroup lifeCycle from a LogbookLifeCycleObjectGroupInProcess instancevoid
updateLogbookLifeCycleObjectGroup(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleObjectGroupParameters lifecycleItem)
Update one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
updateLogbookLifeCycleObjectGroup(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleObjectGroupParameters lifecycleItem, boolean commit)
Update one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
updateLogbookLifeCycleUnit(LogbookLifeCycleUnitInProcess logbookLifeCycleUnitInProcess)
Updates Unit lifeCycle from a LogbookLifeCycleUnitInProcess instancevoid
updateLogbookLifeCycleUnit(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleUnitParameters lifecycleItem)
Update one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
updateLogbookLifeCycleUnit(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleUnitParameters lifecycleItem, boolean commit)
Update one Logbook LifeCycle (in progress or committed
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.void
updateLogbookOperation(LogbookOperationParameters item)
Update one Logbook Operation
It adds this new entry within the very same Logbook Operaton entry in "events" array.-
Methods inherited from class fr.gouv.vitam.common.database.server.mongodb.MongoDbAccess
checkConnection, createMongoClient, getMongoAdmin, getMongoClient, getMongoDatabase, setDatabase, setMongoAdmin, setMongoClient, setMongoDatabase
-
-
-
-
Constructor Detail
-
LogbookMongoDbAccessImpl
public LogbookMongoDbAccessImpl(com.mongodb.MongoClient mongoClient, java.lang.String dbname, boolean recreate, LogbookElasticsearchAccess esClient, LogbookTransformData logbookTransformData, OntologyLoader ontologyLoader)
Constructor- Parameters:
mongoClient
- MongoClientdbname
- MongoDB database namerecreate
- True to recreate the indexesClient
- elastic search clientontologyLoader
-- Throws:
java.lang.IllegalArgumentException
- if mongoClient or dbname is null
-
-
Method Detail
-
close
public final void close()
Close database access- Specified by:
close
in interfaceLogbookDbAccess
- Overrides:
close
in classMongoDbAccess
-
getInfo
public java.lang.String getInfo()
Description copied from interface:DatabaseConnection
Get information on a Database- Specified by:
getInfo
in interfaceDatabaseConnection
- Specified by:
getInfo
in interfaceLogbookDbAccess
- Overrides:
getInfo
in classMongoDbAccess
- Returns:
- information on the database
-
getEsClient
public LogbookElasticsearchAccess getEsClient()
- Returns:
- the Elasticsearch Acess Logbook client
-
getLogbookOperationSize
public final long getLogbookOperationSize()
- Specified by:
getLogbookOperationSize
in interfaceLogbookDbAccess
- Returns:
- the current number of Logbook Operation
-
getLogbookLifeCyleUnitSize
public final long getLogbookLifeCyleUnitSize()
- Specified by:
getLogbookLifeCyleUnitSize
in interfaceLogbookDbAccess
- Returns:
- the current number of Logbook LifeCyle
-
getLogbookLifeCyleObjectGroupSize
public final long getLogbookLifeCyleObjectGroupSize()
- Specified by:
getLogbookLifeCyleObjectGroupSize
in interfaceLogbookDbAccess
- Returns:
- the current number of Logbook LifeCyle
-
getLogbookLifeCyleUnitInProcessSize
public long getLogbookLifeCyleUnitInProcessSize()
- Specified by:
getLogbookLifeCyleUnitInProcessSize
in interfaceLogbookDbAccess
- Returns:
- the current number of LogbookLifeCyle created in working unit collection
-
getLogbookLifeCyleObjectGroupInProcessSize
public long getLogbookLifeCyleObjectGroupInProcessSize()
- Specified by:
getLogbookLifeCyleObjectGroupInProcessSize
in interfaceLogbookDbAccess
- Returns:
- the current number of LogbookLifeCyle created in working objectGroup collection
-
getLogbookOperations
public VitamMongoCursor<LogbookOperation> getLogbookOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced) throws LogbookDatabaseException, VitamDBException
- Specified by:
getLogbookOperations
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
VitamDBException
-
getLogbookOperations
public VitamMongoCursor<LogbookOperation> getLogbookOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant) throws LogbookDatabaseException, VitamDBException
Description copied from interface:LogbookDbAccess
Get a list of Logbook Operation through Closeable MongoCursor- Specified by:
getLogbookOperations
in interfaceLogbookDbAccess
sliced
- If true will return the first and last events only- Returns:
- the Closeable MongoCursor of LogbookOperation
- Throws:
LogbookDatabaseException
VitamDBException
-
getOneLogbookLifeCycle
public LogbookLifeCycle<?> getOneLogbookLifeCycle(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, LogbookNotFoundException, VitamDBException
Description copied from interface:LogbookDbAccess
Get a list of Logbook LifeCycles through Closeable MongoCursor- Specified by:
getOneLogbookLifeCycle
in interfaceLogbookDbAccess
collection
- the collection on which the select operation will be done : Production collection (LIFECYCLE_UNIT/LIFECYCLE_OBJECT_GROUP) or Working collection (LIFECYCLE_UNIT_IN_PROCESS/LIFECYCLE_OBJECT_GROUP_IN_PROCESS)- Returns:
- the Closeable MongoCursor of LogbookLifeCycle
- Throws:
LogbookDatabaseException
- if more than one resultLogbookNotFoundException
- if no resultVitamDBException
-
getLogbookLifeCycles
public com.mongodb.client.MongoCursor<LogbookLifeCycle<?>> getLogbookLifeCycles(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, LogbookCollections collection) throws LogbookDatabaseException, VitamDBException
Description copied from interface:LogbookDbAccess
Get a list of Logbook LifeCycles through Closeable MongoCursor- Specified by:
getLogbookLifeCycles
in interfaceLogbookDbAccess
collection
- the collection on which the select operation will be done : Production collection (LIFECYCLE_UNIT/LIFECYCLE_OBJECT_GROUP) or Working collection (LIFECYCLE_UNIT_IN_PROCESS/LIFECYCLE_OBJECT_GROUP_IN_PROCESS)- Returns:
- the Closeable MongoCursor of LogbookLifeCycle
- Throws:
LogbookDatabaseException
VitamDBException
-
getLogbookLifeCycleUnitsFull
public VitamMongoCursor<LogbookLifeCycleUnit> getLogbookLifeCycleUnitsFull(LogbookCollections collection, Select select) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Get a list of Logbook LifeCycle through Closeable MongoCursor- Specified by:
getLogbookLifeCycleUnitsFull
in interfaceLogbookDbAccess
- Parameters:
collection
- the collection on which the select operation will be done : Production collection (LIFECYCLE_UNIT) or Working collection (LIFECYCLE_UNIT_IN_PROCESS)- Returns:
- the Closeable MongoCursor of LogbookLifeCycle
- Throws:
LogbookDatabaseException
-
getLogbookLifeCycleObjectGroupsFull
public VitamMongoCursor<LogbookLifeCycleObjectGroup> getLogbookLifeCycleObjectGroupsFull(LogbookCollections collection, Select select) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Get a list of Logbook LifeCycle through Closeable MongoCursor- Specified by:
getLogbookLifeCycleObjectGroupsFull
in interfaceLogbookDbAccess
- Parameters:
collection
- the collection on which the select operation will be done : Production collection (LIFECYCLE_OBJECT_GROUP) or Working collection (LIFECYCLE_OBJECT_GROUP_IN_PROCESS)- Returns:
- the Closeable MongoCursor of LogbookLifeCycle
- Throws:
LogbookDatabaseException
-
existsLogbookOperation
public final boolean existsLogbookOperation(java.lang.String operationItem) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Check if one eventIdentifier for Operation exists already- Specified by:
existsLogbookOperation
in interfaceLogbookDbAccess
- Returns:
- True if one LogbookOperation exists with this id
- Throws:
LogbookDatabaseException
-
existsLogbookLifeCycleUnit
public boolean existsLogbookLifeCycleUnit(java.lang.String unitId) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Check if one eventIdentifier for Lifecycle exists already- Specified by:
existsLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Returns:
- True if one LogbookLibeCycle exists with this id
- Throws:
LogbookDatabaseException
-
existsLogbookLifeCycleObjectGroup
public boolean existsLogbookLifeCycleObjectGroup(java.lang.String objectGroupId) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Check if one eventIdentifier for Lifecycle exists already- Specified by:
existsLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Returns:
- True if one LogbookLibeCycle exists with this id
- Throws:
LogbookDatabaseException
-
getLogbookOperationById
public LogbookOperation getLogbookOperationById(java.lang.String eventIdentifierProcess) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Get one Operation- Specified by:
getLogbookOperationById
in interfaceLogbookDbAccess
- Returns:
- the corresponding LogbookOperation if it exists
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
getLogbookOperationById
public LogbookOperation getLogbookOperationById(@Nonnull java.lang.String eventIdentifierProcess, @Nonnull com.fasterxml.jackson.databind.JsonNode query, boolean sliced, boolean crossTenant) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Get one Operation- Specified by:
getLogbookOperationById
in interfaceLogbookDbAccess
- Returns:
- the corresponding LogbookOperation if it exists
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
createLogbookOperation
public void createLogbookOperation(LogbookOperationParameters operationItem) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Create one Logbook Operation- Specified by:
createLogbookOperation
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
createLogbookLifeCycleUnit
public void createLogbookLifeCycleUnit(java.lang.String idOperation, LogbookLifeCycleUnitParameters lifecycleItem) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Create one Logbook LifeCycle unit- Specified by:
createLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
createLogbookLifeCycleObjectGroup
public void createLogbookLifeCycleObjectGroup(java.lang.String idOperation, LogbookLifeCycleObjectGroupParameters lifecycleItem) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Create one Logbook LifeCycle object group- Specified by:
createLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
updateLogbookOperation
public void updateLogbookOperation(LogbookOperationParameters item) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Update one Logbook Operation
It adds this new entry within the very same Logbook Operaton entry in "events" array.- Specified by:
updateLogbookOperation
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
updateLogbookLifeCycle
public void updateLogbookLifeCycle(LogbookCollections collection, java.util.List<LogbookLifeCycleParametersBulk> logbookLifeCycleParametersBulk)
- Specified by:
updateLogbookLifeCycle
in interfaceLogbookDbAccess
-
updateLogbookLifeCycleUnit
public void updateLogbookLifeCycleUnit(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleUnitParameters lifecycleItem) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Update one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
updateLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
LogbookAlreadyExistsException
-
updateLogbookLifeCycleUnit
public void updateLogbookLifeCycleUnit(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleUnitParameters lifecycleItem, boolean commit) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Update one Logbook LifeCycle (in progress or committed
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
updateLogbookLifeCycleUnit
in interfaceLogbookDbAccess
commit
- if true update committed LFC else update in progress LFC- Throws:
LogbookDatabaseException
LogbookNotFoundException
LogbookAlreadyExistsException
-
updateLogbookLifeCycleObjectGroup
public void updateLogbookLifeCycleObjectGroup(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleObjectGroupParameters lifecycleItem) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Update one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
updateLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
LogbookAlreadyExistsException
-
updateLogbookLifeCycleObjectGroup
public void updateLogbookLifeCycleObjectGroup(java.lang.String idOperation, java.lang.String idLfc, LogbookLifeCycleObjectGroupParameters lifecycleItem, boolean commit) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Update one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
updateLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
commit
- if true update is done on committed collection otherwise on inProcess one- Throws:
LogbookDatabaseException
LogbookNotFoundException
LogbookAlreadyExistsException
-
rollbackLogbookLifeCycleUnit
public void rollbackLogbookLifeCycleUnit(java.lang.String idOperation, java.lang.String lifecycleItem) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Rollback one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
rollbackLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
rollbackLogbookLifeCycleObjectGroup
public void rollbackLogbookLifeCycleObjectGroup(java.lang.String idOperation, java.lang.String lifecycleItem) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Rollback one Logbook LifeCycle
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
rollbackLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
createBulkLogbookOperation
public final void createBulkLogbookOperation(LogbookOperationParameters... operationItems) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Create one Logbook Operation with already multiple sub-events- Specified by:
createBulkLogbookOperation
in interfaceLogbookDbAccess
- Parameters:
operationItems
- with first and next events to add/update- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
createBulkLogbookLifeCycleUnit
public final void createBulkLogbookLifeCycleUnit(LogbookLifeCycleUnitParameters... lifecycleItems) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Create one Logbook LifeCycle with already multiple sub-events- Specified by:
createBulkLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Parameters:
lifecycleItems
- with first and next events to add/update- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
createBulkLogbookLifeCycleObjectGroup
public final void createBulkLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupParameters... lifecycleItems) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Create one Logbook LifeCycle with already multiple sub-events- Specified by:
createBulkLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Parameters:
lifecycleItems
- with first and next events to add/update- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
updateBulkLogbookOperation
public final void updateBulkLogbookOperation(LogbookOperationParameters... operationItems) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Update one Logbook Operation with multiple sub-events
It adds this new entry within the very same Logbook Operaton entry in "events" array.- Specified by:
updateBulkLogbookOperation
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
updateBulkLogbookLifeCycleUnit
public void updateBulkLogbookLifeCycleUnit(LogbookLifeCycleUnitParameters... lifecycleItems) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Update one Logbook LifeCycle with multiple sub-events
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
updateBulkLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
LogbookAlreadyExistsException
-
updateBulkLogbookLifeCycleObjectGroup
public void updateBulkLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupParameters... lifecycleItems) throws LogbookDatabaseException, LogbookNotFoundException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Update one Logbook LifeCycle with multiple sub-events
It adds this new entry within the very same Logbook LifeCycle entry in "events" array.- Specified by:
updateBulkLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookNotFoundException
LogbookAlreadyExistsException
-
deleteCollectionForTesting
public void deleteCollectionForTesting(LogbookCollections collection) throws DatabaseException, LogbookExecutionException
Description copied from interface:LogbookDbAccess
Delete logbook collection- Specified by:
deleteCollectionForTesting
in interfaceLogbookDbAccess
- Parameters:
collection
- the logbook collection to delete- Throws:
DatabaseException
- thrown when error on deleteLogbookExecutionException
-
getLogbookLifeCycleUnitInProcess
public LogbookLifeCycleUnitInProcess getLogbookLifeCycleUnitInProcess(java.lang.String unitId) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Get Unit LifeCycle In process- Specified by:
getLogbookLifeCycleUnitInProcess
in interfaceLogbookDbAccess
- Parameters:
unitId
- the unit id- Returns:
- the corresponding LogbookLifeCycleUnitInProcess if it exists
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
getLogbookLifeCycleObjectGroupInProcess
public LogbookLifeCycleObjectGroupInProcess getLogbookLifeCycleObjectGroupInProcess(java.lang.String objectGroupId) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Gets ObjectGroup LifeCycle In process- Specified by:
getLogbookLifeCycleObjectGroupInProcess
in interfaceLogbookDbAccess
- Parameters:
objectGroupId
- the object group id- Returns:
- the corresponding LogbookLifeCycleObjectGroupInProcess if it exists
- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
createLogbookLifeCycleUnit
public void createLogbookLifeCycleUnit(LogbookLifeCycleUnitInProcess logbookLifeCycleUnitInProcess) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Creates Unit lifeCycle from a LogbookLifeCycleUnitInProcess instance- Specified by:
createLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Parameters:
logbookLifeCycleUnitInProcess
- a LogbookLifeCycleUnitInProcess instance- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
createLogbookLifeCycleObjectGroup
public void createLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupInProcess logbookLifeCycleObjectGroupInProcess) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookDbAccess
Creates ObjectGroup lifeCycle from a LogbookLifeCycleObjectGroupInProcess instance- Specified by:
createLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Throws:
LogbookDatabaseException
LogbookAlreadyExistsException
-
createLogbookLifeCycleForUpdate
public void createLogbookLifeCycleForUpdate(LogbookCollections inProccessCollection, LogbookLifeCycle<?> logbookLifeCycleInProd) throws LogbookDatabaseException, LogbookAlreadyExistsException
- Parameters:
inProccessCollection
- collection of logbook in processlogbookLifeCycleInProd
- to create logbook lfc Unit/GroupObject- Throws:
LogbookDatabaseException
- if mongo execution errorLogbookAlreadyExistsException
- if duplicated key in mongo
-
updateLogbookLifeCycleUnit
public void updateLogbookLifeCycleUnit(LogbookLifeCycleUnitInProcess logbookLifeCycleUnitInProcess) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Updates Unit lifeCycle from a LogbookLifeCycleUnitInProcess instance- Specified by:
updateLogbookLifeCycleUnit
in interfaceLogbookDbAccess
- Parameters:
logbookLifeCycleUnitInProcess
- a LogbookLifeCycleUnitInProcess instance- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
updateLogbookLifeCycleObjectGroup
public void updateLogbookLifeCycleObjectGroup(LogbookLifeCycleObjectGroupInProcess logbookLifeCycleObjectGrouptInProcess) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookDbAccess
Updates ObjectGroup lifeCycle from a LogbookLifeCycleObjectGroupInProcess instance- Specified by:
updateLogbookLifeCycleObjectGroup
in interfaceLogbookDbAccess
- Parameters:
logbookLifeCycleObjectGrouptInProcess
- a LogbookLifeCycleObjectGroupInProcess instance- Throws:
LogbookDatabaseException
LogbookNotFoundException
-
rollBackUnitLifeCyclesByOperation
public void rollBackUnitLifeCyclesByOperation(java.lang.String operationId) throws LogbookNotFoundException, LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Rolls back all the created unit lifeCycles during a given operation- Specified by:
rollBackUnitLifeCyclesByOperation
in interfaceLogbookDbAccess
- Parameters:
operationId
- an operation id- Throws:
LogbookNotFoundException
LogbookDatabaseException
-
rollBackObjectGroupLifeCyclesByOperation
public void rollBackObjectGroupLifeCyclesByOperation(java.lang.String operationId) throws LogbookNotFoundException, LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Rolls back all the created objectGroups lifeCycles during a given operation- Specified by:
rollBackObjectGroupLifeCyclesByOperation
in interfaceLogbookDbAccess
- Parameters:
operationId
- an operation Id- Throws:
LogbookNotFoundException
LogbookDatabaseException
-
existsLogbookLifeCycleUnitInProcess
public boolean existsLogbookLifeCycleUnitInProcess(java.lang.String unitId) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Check if one eventIdentifier for Lifecycle exists already- Specified by:
existsLogbookLifeCycleUnitInProcess
in interfaceLogbookDbAccess
- Returns:
- True if one LogbookLibeCycle exists with this id
- Throws:
LogbookDatabaseException
-
existsLogbookLifeCycleObjectGroupInProcess
public boolean existsLogbookLifeCycleObjectGroupInProcess(java.lang.String objectGroupId) throws LogbookDatabaseException
Description copied from interface:LogbookDbAccess
Check if one eventIdentifier for Lifecycle exists already- Specified by:
existsLogbookLifeCycleObjectGroupInProcess
in interfaceLogbookDbAccess
- Returns:
- True if one LogbookLibeCycle exists with this id
- Throws:
LogbookDatabaseException
-
bulkInsert
public void bulkInsert(LogbookCollections lifecycleUnit, java.util.List<? extends LogbookLifeCycleModel> logbookLifeCycleModels) throws DatabaseException
- Specified by:
bulkInsert
in interfaceLogbookDbAccess
- Throws:
DatabaseException
-
-