Interface LogbookOperations
-
- All Known Implementing Classes:
AlertLogbookOperationsDecorator,LogbookOperationsDecorator,LogbookOperationsImpl
public interface LogbookOperationsLogbook operations interface for database operations
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreate(LogbookOperationParameters parameters)Create and insert logbook operation entriesvoidcreateBulkLogbookOperation(LogbookOperationParameters[] operationArray)Create one Logbook Operation with already multiple sub-eventsLogbookOperationfindFirstTraceabilityOperationOKAfterDate(java.time.LocalDateTime date)Find One logbook TraceabilityOperation after a given dateLogbookOperationfindLastTraceabilityOperationOK()Find last successful traceability operationLogbookOperationgetById(java.lang.String IdProcess)Select logbook operation by the operation's IDIndexationResultreindex(IndexParameters indexParameters)Reindex one or more collectionsjava.util.List<LogbookOperation>select(com.fasterxml.jackson.databind.JsonNode select)Select logbook operation entriesjava.util.List<LogbookOperation>select(com.fasterxml.jackson.databind.JsonNode select, boolean sliced)Select logbook operation entriesRequestResponse<LogbookOperation>selectOperations(com.fasterxml.jackson.databind.JsonNode select)com.mongodb.client.MongoCursor<LogbookOperation>selectOperationsByLastPersistenceDateInterval(java.time.LocalDateTime startDate, java.time.LocalDateTime endDate)Select all logbook operations entries persisted within provided intervalvoidswitchIndex(java.lang.String alias, java.lang.String newIndexName)Switch indexes for one or more collectionsvoidupdate(LogbookOperationParameters parameters)Update and insert logbook operation entriesvoidupdateBulkLogbookOperation(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.
-
-
-
Method Detail
-
create
void create(LogbookOperationParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException
Create and insert logbook operation entries- Parameters:
parameters- the entry parameters- Throws:
LogbookAlreadyExistsException- if an operation with the same eventIdentifierProcess and outcome="Started" already existsLogbookDatabaseException- if errors occur while connecting or writing to the database
-
update
void update(LogbookOperationParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException
Update and insert logbook operation entries- Parameters:
parameters- the entry parameters- Throws:
LogbookNotFoundException- if no operation with the same eventIdentifierProcess existsLogbookDatabaseException- if errors occur while connecting or writing to the database
-
select
java.util.List<LogbookOperation> select(com.fasterxml.jackson.databind.JsonNode select) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
Select logbook operation entries- Parameters:
select- the select request in format of JsonNode- Returns:
- List of the logbook operation
- Throws:
LogbookNotFoundException- if no operation selected cannot be foundLogbookDatabaseException- if errors occur while connecting or writing to the databaseInvalidParseOperationException- if invalid parse for selecting the operationVitamDBException- in case a desynchro is recorded between Mongo and ES
-
selectOperations
RequestResponse<LogbookOperation> selectOperations(com.fasterxml.jackson.databind.JsonNode select) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
-
select
java.util.List<LogbookOperation> select(com.fasterxml.jackson.databind.JsonNode select, boolean sliced) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, VitamDBException
Select logbook operation entries- Parameters:
select- the select request in format of JsonNodesliced- the boolean sliced to filter events or not- Returns:
- List of the logbook operation
- Throws:
LogbookNotFoundException- if no operation selected cannot be foundLogbookDatabaseException- if errors occur while connecting or writing to the databaseInvalidParseOperationException- if invalid parse for selecting the operationVitamDBException- in case a desynchro is recorded between Mongo and ES
-
getById
LogbookOperation getById(java.lang.String IdProcess) throws LogbookDatabaseException, LogbookNotFoundException
Select logbook operation by the operation's ID- Parameters:
IdProcess- the operation identifier- Returns:
- the logbook operation found by the ID
- Throws:
LogbookDatabaseException- if errors occur while connecting or writing to the databaseLogbookNotFoundException- if no operation selected cannot be found
-
createBulkLogbookOperation
void createBulkLogbookOperation(LogbookOperationParameters[] operationArray) throws LogbookDatabaseException, LogbookAlreadyExistsException
Create one Logbook Operation with already multiple sub-events- Parameters:
operationArray- 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 logbook already exists
-
updateBulkLogbookOperation
void updateBulkLogbookOperation(LogbookOperationParameters[] operationArray) throws LogbookDatabaseException, LogbookNotFoundException
Update one Logbook Operation with multiple sub-events
It adds this new entry within the very same Logbook Operaton entry in "events" array.- Parameters:
operationArray- containing all operations 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 no operation selected cannot be found
-
selectOperationsByLastPersistenceDateInterval
com.mongodb.client.MongoCursor<LogbookOperation> selectOperationsByLastPersistenceDateInterval(java.time.LocalDateTime startDate, java.time.LocalDateTime endDate) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, InvalidCreateOperationException
Select all logbook operations entries persisted within provided interval- Parameters:
startDate- the start dateendDate- the end date- Returns:
- the Closeable MongoCursor of LogbookOperation
- Throws:
LogbookNotFoundException- if no operation selected cannot be foundLogbookDatabaseException- if errors occur while connecting or writing to the databaseInvalidParseOperationException- if invalid parse for selecting the operationInvalidCreateOperationException- if the query could not be created
-
findFirstTraceabilityOperationOKAfterDate
LogbookOperation findFirstTraceabilityOperationOKAfterDate(java.time.LocalDateTime date) throws InvalidCreateOperationException, LogbookNotFoundException, LogbookDatabaseException
Find One logbook TraceabilityOperation after a given date- Parameters:
date- the select request in format of JsonNode- Returns:
- the LogbookOperation
- Throws:
LogbookNotFoundException- if no operation selected cannot be foundLogbookDatabaseException- if errors occur while connecting or writing to the databaseInvalidParseOperationException- if invalid parse for selecting the operationInvalidCreateOperationException- if the query could not be created
-
findLastTraceabilityOperationOK
LogbookOperation findLastTraceabilityOperationOK() throws InvalidCreateOperationException, LogbookNotFoundException, LogbookDatabaseException, InvalidParseOperationException
Find last successful traceability operation- Returns:
- the last valid traceability operation
- Throws:
InvalidCreateOperationException- 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 created
-
reindex
IndexationResult reindex(IndexParameters indexParameters)
Reindex one or more collections- Parameters:
indexParameters- the parameters specifying what to reindex- Returns:
- the reindexation result as a IndexationResult Object
-
switchIndex
void switchIndex(java.lang.String alias, java.lang.String newIndexName) throws DatabaseExceptionSwitch indexes for one or more collections- Parameters:
alias- the alias namenewIndexName- the new index to be pointed on- Throws:
DatabaseException- in case error with database occurs
-
-