Class AlertLogbookOperationsDecorator
- java.lang.Object
-
- fr.gouv.vitam.logbook.operations.core.LogbookOperationsDecorator
-
- fr.gouv.vitam.logbook.operations.core.AlertLogbookOperationsDecorator
-
- All Implemented Interfaces:
LogbookOperations
public class AlertLogbookOperationsDecorator extends LogbookOperationsDecorator
LogbookOperationsDecorator implementation. This implementation create a LogbookOperation and if necessary create an alert
-
-
Field Summary
-
Fields inherited from class fr.gouv.vitam.logbook.operations.core.LogbookOperationsDecorator
logbookOperations
-
-
Constructor Summary
Constructors Constructor Description AlertLogbookOperationsDecorator(LogbookOperations logbookOperations, java.util.List<LogbookEvent> alertEvents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation(java.time.LocalDateTime traceabilityStartDate, java.time.LocalDateTime traceabilityEndDate)
void
create(LogbookOperationParameters parameters)
Create and insert logbook operation entriesvoid
createBulkLogbookOperation(LogbookOperationParameters[] operationArray)
Create one Logbook Operation with already multiple sub-eventsLogbookOperation
findLastLifecycleTraceabilityOperation(java.lang.String eventType, boolean traceabilityWithZipOnly)
Find last OK or WARNING LFC traceability operation (even if no traceability zip has been generated)java.util.Optional<LogbookOperation>
findLastOperationByType(java.lang.String operationType)
FInd last event of last operation by typeLogbookOperation
getById(java.lang.String idProcess, com.fasterxml.jackson.databind.JsonNode query, boolean sliced, boolean crossTenant)
Select logbook operation by the operation's IDjava.util.List<LogbookOperation>
selectOperations(com.fasterxml.jackson.databind.JsonNode select)
Select logbook operation entriesjava.util.List<LogbookOperation>
selectOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant)
RequestResponseOK<LogbookOperation>
selectOperationsAsRequestResponse(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant)
void
update(LogbookOperationParameters parameters)
Update and insert logbook operation entriesvoid
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.-
Methods inherited from class fr.gouv.vitam.logbook.operations.core.LogbookOperationsDecorator
findFirstTraceabilityOperationOKAfterDate, findLastTraceabilityOperationOK, getById, reindex, selectOperationsByLastPersistenceDateInterval, switchIndex
-
-
-
-
Constructor Detail
-
AlertLogbookOperationsDecorator
public AlertLogbookOperationsDecorator(LogbookOperations logbookOperations, java.util.List<LogbookEvent> alertEvents)
-
-
Method Detail
-
create
public void create(LogbookOperationParameters parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException
Description copied from interface:LogbookOperations
Create and insert logbook operation entries- Specified by:
create
in interfaceLogbookOperations
- Overrides:
create
in classLogbookOperationsDecorator
- 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
public void update(LogbookOperationParameters parameters) throws LogbookNotFoundException, LogbookDatabaseException
Description copied from interface:LogbookOperations
Update and insert logbook operation entries- Specified by:
update
in interfaceLogbookOperations
- Overrides:
update
in classLogbookOperationsDecorator
- 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
-
selectOperations
public java.util.List<LogbookOperation> selectOperations(com.fasterxml.jackson.databind.JsonNode select) throws LogbookDatabaseException, InvalidParseOperationException, VitamDBException
Description copied from interface:LogbookOperations
Select logbook operation entries- Parameters:
select
- the select request in format of JsonNode- Returns:
- List of the logbook operation
- Throws:
LogbookDatabaseException
- 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
public java.util.List<LogbookOperation> selectOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant) throws VitamDBException, LogbookDatabaseException
-
selectOperationsAsRequestResponse
public RequestResponseOK<LogbookOperation> selectOperationsAsRequestResponse(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant) throws VitamDBException, LogbookDatabaseException
-
getById
public LogbookOperation getById(java.lang.String idProcess, com.fasterxml.jackson.databind.JsonNode query, boolean sliced, boolean crossTenant) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookOperations
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
public void createBulkLogbookOperation(LogbookOperationParameters[] operationArray) throws LogbookDatabaseException, LogbookAlreadyExistsException
Description copied from interface:LogbookOperations
Create one Logbook Operation with already multiple sub-events- Specified by:
createBulkLogbookOperation
in interfaceLogbookOperations
- Overrides:
createBulkLogbookOperation
in classLogbookOperationsDecorator
- Parameters:
operationArray
- with first and next events to add/update- Throws:
LogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookAlreadyExistsException
- if logbook already exists
-
updateBulkLogbookOperation
public void updateBulkLogbookOperation(LogbookOperationParameters[] operationArray) throws LogbookDatabaseException, LogbookNotFoundException
Description copied from interface:LogbookOperations
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 interfaceLogbookOperations
- Overrides:
updateBulkLogbookOperation
in classLogbookOperationsDecorator
- Parameters:
operationArray
- containing all operations Logbook in order- Throws:
LogbookDatabaseException
- if errors occur while connecting or writing to the databaseLogbookNotFoundException
- if no operation selected cannot be found
-
findLastLifecycleTraceabilityOperation
public LogbookOperation findLastLifecycleTraceabilityOperation(java.lang.String eventType, boolean traceabilityWithZipOnly) throws VitamException
Description copied from interface:LogbookOperations
Find last OK or WARNING LFC traceability operation (even if no traceability zip has been generated)- Specified by:
findLastLifecycleTraceabilityOperation
in interfaceLogbookOperations
- Overrides:
findLastLifecycleTraceabilityOperation
in classLogbookOperationsDecorator
- Parameters:
eventType
- Logbook event typetraceabilityWithZipOnly
- if true, skip operation without Zip (empty operations)- Returns:
- the last valid traceability operation
- Throws:
VitamException
- if errors occur while retrieving data
-
checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation
public boolean checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation(java.time.LocalDateTime traceabilityStartDate, java.time.LocalDateTime traceabilityEndDate) throws LogbookDatabaseException
- Specified by:
checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation
in interfaceLogbookOperations
- Overrides:
checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation
in classLogbookOperationsDecorator
- Throws:
LogbookDatabaseException
-
findLastOperationByType
public java.util.Optional<LogbookOperation> findLastOperationByType(java.lang.String operationType) throws InvalidCreateOperationException, LogbookDatabaseException, InvalidParseOperationException
Description copied from interface:LogbookOperations
FInd last event of last operation by type
-
-