Package fr.gouv.vitam.logbook.operations.core

# 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, List<LogbookEvent> alertEvents)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation(LocalDateTime traceabilityStartDate, LocalDateTime traceabilityEndDate)`
  `void`
  `create(String operationId, LogbookOperationParameters... parameters)`
  Create and insert logbook operation entries
  `LogbookOperation`
  `findLastLifecycleTraceabilityOperation(String eventType, boolean traceabilityWithZipOnly)`
  Find last OK or WARNING LFC traceability operation (even if no traceability zip has been generated)
  `Optional<LogbookOperation>`
  `findLastOperationByType(String operationType)`
  FInd last event of last operation by type
  `LogbookOperation`
  `getById(String idProcess, com.fasterxml.jackson.databind.JsonNode query, boolean sliced, boolean crossTenant)`
  Select logbook operation by the operation's ID
  `List<LogbookOperation>`
  `selectOperations(com.fasterxml.jackson.databind.JsonNode select)`
  Select logbook operation entries
  `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(String operationId, LogbookOperationParameters... parameters)`
  Update and insert logbook operation entries

  ### Methods inherited from class fr.gouv.vitam.logbook.operations.core.LogbookOperationsDecorator

  `findFirstTraceabilityOperationOKAfterDate, findLastTraceabilityOperationOK, getById, reindex, selectOperationsByLastPersistenceDateInterval, switchIndex`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AlertLogbookOperationsDecorator

    public AlertLogbookOperationsDecorator(LogbookOperations logbookOperations, List<LogbookEvent> alertEvents)

- ## Method Details

  - ### create

    public void create(String operationId, LogbookOperationParameters... parameters) throws LogbookAlreadyExistsException, LogbookDatabaseException
    Description copied from interface: `LogbookOperations`
    Create and insert logbook operation entries
    Specified by:
      `create` in interface `LogbookOperations`
    Overrides:
      `create` in class `LogbookOperationsDecorator`
    Parameters:
      `parameters` - the entry parameters
    Throws:
      `LogbookAlreadyExistsException` - if an operation with the same eventIdentifierProcess and outcome="Started" already exists
      `LogbookDatabaseException` - if errors occur while connecting or writing to the database

  - ### update

    public void update(String operationId, LogbookOperationParameters... parameters) throws LogbookNotFoundException, LogbookDatabaseException
    Description copied from interface: `LogbookOperations`
    Update and insert logbook operation entries
    Specified by:
      `update` in interface `LogbookOperations`
    Overrides:
      `update` in class `LogbookOperationsDecorator`
    Parameters:
      `parameters` - the entry parameters
    Throws:
      `LogbookNotFoundException` - if no operation with the same eventIdentifierProcess exists
      `LogbookDatabaseException` - if errors occur while connecting or writing to the database

  - ### selectOperations

    public 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 database
      `InvalidParseOperationException` - if invalid parse for selecting the operation
      `VitamDBException` - in case a desynchro is recorded between Mongo and ES

  - ### selectOperations

    public List<LogbookOperation> selectOperations(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant) throws VitamDBException, LogbookDatabaseException
    Throws:
      `VitamDBException`
      `LogbookDatabaseException`

  - ### selectOperationsAsRequestResponse

    public RequestResponseOK<LogbookOperation> selectOperationsAsRequestResponse(com.fasterxml.jackson.databind.JsonNode select, boolean sliced, boolean crossTenant) throws VitamDBException, LogbookDatabaseException
    Throws:
      `VitamDBException`
      `LogbookDatabaseException`

  - ### getById

    public LogbookOperation getById(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
      `query` -
      `sliced` -
      `crossTenant` -
    Returns:
      the logbook operation found by the ID
    Throws:
      `LogbookDatabaseException` - if errors occur while connecting or writing to the database
      `LogbookNotFoundException` - if no operation selected cannot be found

  - ### findLastLifecycleTraceabilityOperation

    public LogbookOperation findLastLifecycleTraceabilityOperation(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 interface `LogbookOperations`
    Overrides:
      `findLastLifecycleTraceabilityOperation` in class `LogbookOperationsDecorator`
    Parameters:
      `eventType` - Logbook event type
      `traceabilityWithZipOnly` - 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(LocalDateTime traceabilityStartDate, LocalDateTime traceabilityEndDate) throws LogbookDatabaseException
    Specified by:
      `checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation` in interface `LogbookOperations`
    Overrides:
      `checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation` in class `LogbookOperationsDecorator`
    Throws:
      `LogbookDatabaseException`

  - ### findLastOperationByType

    public Optional<LogbookOperation> findLastOperationByType(String operationType) throws InvalidCreateOperationException, LogbookDatabaseException, InvalidParseOperationException
    Description copied from interface: `LogbookOperations`
    FInd last event of last operation by type
    Parameters:
      `operationType` -
    Returns:
    Throws:
      `InvalidCreateOperationException`
      `LogbookDatabaseException`
      `InvalidParseOperationException`