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

# Class LogbookOperationsDecorator

java.lang.Object
fr.gouv.vitam.logbook.operations.core.LogbookOperationsDecorator

All Implemented Interfaces:
  `LogbookOperations`

Direct Known Subclasses:
  `AlertLogbookOperationsDecorator`

public abstract class LogbookOperationsDecorator extends Object implements LogbookOperations
Decorator for LogbookOperations

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected LogbookOperations`
  `logbookOperations`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LogbookOperationsDecorator(LogbookOperations logbookOperations)`
  Constructor

- ## 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`
  `findFirstTraceabilityOperationOKAfterDate(LocalDateTime date)`
  Find One logbook TraceabilityOperation after a given date
  `LogbookOperation`
  `findLastLifecycleTraceabilityOperation(String eventType, boolean traceabilityWithZipOnly)`
  Find last OK or WARNING LFC traceability operation (even if no traceability zip has been generated)
  `LogbookOperation`
  `findLastTraceabilityOperationOK()`
  Find last successful traceability operation
  `LogbookOperation`
  `getById(String IdProcess)`
  `ReindexationResult`
  `reindex(IndexParameters indexParameters)`
  Reindex one or more collections
  `com.mongodb.client.MongoCursor<LogbookOperation>`
  `selectOperationsByLastPersistenceDateInterval(LocalDateTime startDate, LocalDateTime endDate)`
  Select all logbook operations entries persisted within provided interval
  `SwitchIndexResult`
  `switchIndex(String alias, String newIndexName)`
  Switch indexes for one or more collections
  `void`
  `update(String operationId, LogbookOperationParameters... parameters)`
  Update and insert logbook operation entries

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

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

  ### Methods inherited from interface fr.gouv.vitam.logbook.operations.api.LogbookOperations

  `findLastOperationByType, getById, selectOperations, selectOperations, selectOperationsAsRequestResponse`

- ## Field Details

  - ### logbookOperations

    protected LogbookOperations logbookOperations

- ## Constructor Details

  - ### LogbookOperationsDecorator

    public LogbookOperationsDecorator(LogbookOperations logbookOperations)
    Constructor
    Parameters:
      `logbookOperations` -

- ## 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`
    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`
    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

  - ### getById

    public LogbookOperation getById(String IdProcess) throws LogbookDatabaseException, LogbookNotFoundException
    Specified by:
      `getById` in interface `LogbookOperations`
    Throws:
      `LogbookDatabaseException`
      `LogbookNotFoundException`

  - ### selectOperationsByLastPersistenceDateInterval

    public com.mongodb.client.MongoCursor<LogbookOperation> selectOperationsByLastPersistenceDateInterval(LocalDateTime startDate, LocalDateTime endDate) throws LogbookDatabaseException, LogbookNotFoundException, InvalidParseOperationException, InvalidCreateOperationException
    Description copied from interface: `LogbookOperations`
    Select all logbook operations entries persisted within provided interval
    Specified by:
      `selectOperationsByLastPersistenceDateInterval` in interface `LogbookOperations`
    Parameters:
      `startDate` - the start date
      `endDate` - the end date
    Returns:
      the Closeable MongoCursor of LogbookOperation
    Throws:
      `LogbookDatabaseException` - if errors occur while connecting or writing to the database
      `LogbookNotFoundException` - if no operation selected cannot be found
      `InvalidParseOperationException` - if invalid parse for selecting the operation
      `InvalidCreateOperationException` - if the query could not be created

  - ### findFirstTraceabilityOperationOKAfterDate

    public LogbookOperation findFirstTraceabilityOperationOKAfterDate(LocalDateTime date) throws InvalidCreateOperationException, LogbookNotFoundException, LogbookDatabaseException
    Description copied from interface: `LogbookOperations`
    Find One logbook TraceabilityOperation after a given date
    Specified by:
      `findFirstTraceabilityOperationOKAfterDate` in interface `LogbookOperations`
    Parameters:
      `date` - the select request in format of JsonNode
    Returns:
      the LogbookOperation
    Throws:
      `InvalidCreateOperationException` - if the query could not be created
      `LogbookNotFoundException` - if no operation selected cannot be found
      `LogbookDatabaseException` - if errors occur while connecting or writing to the database

  - ### findLastTraceabilityOperationOK

    public LogbookOperation findLastTraceabilityOperationOK() throws InvalidCreateOperationException, LogbookNotFoundException, LogbookDatabaseException, InvalidParseOperationException
    Description copied from interface: `LogbookOperations`
    Find last successful traceability operation
    Specified by:
      `findLastTraceabilityOperationOK` in interface `LogbookOperations`
    Returns:
      the last valid traceability operation
    Throws:
      `InvalidCreateOperationException` - if the query could not be created
      `LogbookNotFoundException` - if no operation selected cannot be found
      `LogbookDatabaseException` - if errors occur while connecting or writing to the database
      `InvalidParseOperationException` - if the query could not be created

  - ### 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`
    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

  - ### reindex

    public ReindexationResult reindex(IndexParameters indexParameters)
    Description copied from interface: `LogbookOperations`
    Reindex one or more collections
    Specified by:
      `reindex` in interface `LogbookOperations`
    Parameters:
      `indexParameters` - the parameters specifying what to reindex
    Returns:
      the reindexation result as a IndexationResult Object

  - ### switchIndex

    public SwitchIndexResult switchIndex(String alias, String newIndexName) throws DatabaseException
    Description copied from interface: `LogbookOperations`
    Switch indexes for one or more collections
    Specified by:
      `switchIndex` in interface `LogbookOperations`
    Parameters:
      `alias` - the alias name
      `newIndexName` - the new index to be pointed on
    Returns:
    Throws:
      `DatabaseException` - in case error with database occurs

  - ### checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation

    public boolean checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation(LocalDateTime traceabilityStartDate, LocalDateTime traceabilityEndDate) throws LogbookDatabaseException
    Specified by:
      `checkNewEligibleLogbookOperationsSinceLastTraceabilityOperation` in interface `LogbookOperations`
    Throws:
      `LogbookDatabaseException`