public class LogbookOperationsImpl extends Object implements LogbookOperations
| Modifier and Type | Field and Description |
|---|---|
static String |
STRATEGY_ID |
| Constructor and Description |
|---|
LogbookOperationsImpl(LogbookDbAccess mongoDbAccess)
Constructor
|
LogbookOperationsImpl(LogbookDbAccess mongoDbAccess,
WorkspaceClientFactory workspaceClientFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(LogbookOperationParameters parameters)
Create and insert logbook operation entries
|
void |
createBulkLogbookOperation(LogbookOperationParameters[] operationArray)
Create one Logbook Operation with already multiple sub-events
|
LogbookOperation |
findFirstTraceabilityOperationOKAfterDate(LocalDateTime date)
Find One logbook TraceabilityOperation after a given date
|
LogbookOperation |
findLastTraceabilityOperationOK()
Find last successful traceability operation
|
LogbookOperation |
getById(String idProcess)
Select logbook operation by the operation's ID
|
IndexationResult |
reindex(IndexParameters indexParameters)
Reindex one or more collections
|
List<LogbookOperation> |
select(com.fasterxml.jackson.databind.JsonNode select)
Select logbook operation entries
|
List<LogbookOperation> |
select(com.fasterxml.jackson.databind.JsonNode select,
boolean sliced)
Select logbook operation entries
|
com.mongodb.client.MongoCursor<LogbookOperation> |
selectOperationsPersistedAfterDate(LocalDateTime date)
Select all logbook operations entries after a given date
|
void |
switchIndex(String alias,
String newIndexName)
Switch indexes for one or more collections
|
void |
update(LogbookOperationParameters parameters)
Update and insert logbook operation entries
|
void |
updateBulkLogbookOperation(LogbookOperationParameters[] operationArray)
Update one Logbook Operation with multiple sub-events
It adds this new entry within the very same Logbook Operaton entry in "events" array. |
public static final String STRATEGY_ID
public LogbookOperationsImpl(LogbookDbAccess mongoDbAccess)
mongoDbAccess - of logbookpublic LogbookOperationsImpl(LogbookDbAccess mongoDbAccess, WorkspaceClientFactory workspaceClientFactory)
public void create(LogbookOperationParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException
LogbookOperationscreate in interface LogbookOperationsparameters - the entry parametersLogbookAlreadyExistsException - if an operation with the same
eventIdentifierProcess and outcome="Started" already existsLogbookDatabaseException - if errors occur while connecting
or writing to the databasepublic void update(LogbookOperationParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException
LogbookOperationsupdate in interface LogbookOperationsparameters - the entry parametersLogbookNotFoundException - if no operation with the same
eventIdentifierProcess existsLogbookDatabaseException - if errors occur while connecting
or writing to the databasepublic List<LogbookOperation> select(com.fasterxml.jackson.databind.JsonNode select) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
LogbookOperationsselect in interface LogbookOperationsselect - the select request in format of JsonNodeLogbookDatabaseException - if errors occur while connecting or writing to the databaseLogbookNotFoundException - if no operation selected cannot be foundInvalidParseOperationException - if invalid parse for selecting the operationVitamDBException - in case a desynchro is recorded between Mongo and ESpublic List<LogbookOperation> select(com.fasterxml.jackson.databind.JsonNode select, boolean sliced) throws LogbookNotFoundException, LogbookDatabaseException, VitamDBException
LogbookOperationsselect in interface LogbookOperationsselect - the select request in format of JsonNodesliced - the boolean sliced to filter events or notLogbookNotFoundException - if no operation selected cannot be foundLogbookDatabaseException - if errors occur while connecting or writing to the databaseVitamDBException - in case a desynchro is recorded between Mongo and ESpublic LogbookOperation getById(String idProcess) throws LogbookDatabaseException, LogbookNotFoundException
LogbookOperationsgetById in interface LogbookOperationsidProcess - the operation identifierLogbookDatabaseException - if errors occur while connecting or writing to the databaseLogbookNotFoundException - if no operation selected cannot be foundpublic final void createBulkLogbookOperation(LogbookOperationParameters[] operationArray) throws LogbookDatabaseException, LogbookAlreadyExistsException
LogbookOperationscreateBulkLogbookOperation in interface LogbookOperationsoperationArray - with first and next events to add/updateLogbookDatabaseException - if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException - if logbook already existspublic final void updateBulkLogbookOperation(LogbookOperationParameters[] operationArray) throws LogbookDatabaseException, LogbookNotFoundException
LogbookOperationsupdateBulkLogbookOperation in interface LogbookOperationsoperationArray - containing all operations Logbook in orderLogbookDatabaseException - if errors occur while connecting or writing to the databaseLogbookNotFoundException - if no operation selected cannot be foundpublic com.mongodb.client.MongoCursor<LogbookOperation> selectOperationsPersistedAfterDate(LocalDateTime date) throws LogbookDatabaseException, LogbookNotFoundException, InvalidCreateOperationException, InvalidParseOperationException
LogbookOperationsselectOperationsPersistedAfterDate in interface LogbookOperationsdate - the select request in format of JsonNodeLogbookDatabaseException - if errors occur while connecting or writing to the databaseLogbookNotFoundException - if no operation selected cannot be foundInvalidCreateOperationException - if the query could not be createdInvalidParseOperationException - if invalid parse for selecting the operationpublic LogbookOperation findFirstTraceabilityOperationOKAfterDate(LocalDateTime date) throws InvalidCreateOperationException, LogbookNotFoundException, LogbookDatabaseException
LogbookOperationsfindFirstTraceabilityOperationOKAfterDate in interface LogbookOperationsdate - the select request in format of JsonNodeInvalidCreateOperationException - if the query could not be createdLogbookNotFoundException - if no operation selected cannot be foundLogbookDatabaseException - if errors occur while connecting or writing to the databasepublic LogbookOperation findLastTraceabilityOperationOK() throws InvalidCreateOperationException, LogbookNotFoundException, LogbookDatabaseException, InvalidParseOperationException
LogbookOperationsfindLastTraceabilityOperationOK in interface LogbookOperationsInvalidCreateOperationException - if the query could not be createdLogbookNotFoundException - if no operation selected cannot be foundLogbookDatabaseException - if errors occur while connecting or writing to the databaseInvalidParseOperationException - if the query could not be createdpublic IndexationResult reindex(IndexParameters indexParameters)
LogbookOperationsreindex in interface LogbookOperationsindexParameters - the parameters specifying what to reindexpublic void switchIndex(String alias, String newIndexName) throws DatabaseException
LogbookOperationsswitchIndex in interface LogbookOperationsalias - the alias namenewIndexName - the new index to be pointed onDatabaseException - in case error with database occursCopyright © 2018 Vitam. All rights reserved.