Package fr.gouv.vitam.logbook.operations.client

# Class LogbookOperationsClientMock

java.lang.Object
fr.gouv.vitam.common.client.AbstractMockClient
fr.gouv.vitam.logbook.operations.client.LogbookOperationsClientMock

All Implemented Interfaces:
  `BasicClient`, `MockOrRestClient`, `VitamAutoCloseable`, `LogbookOperationsClient`, `AutoCloseable`

public class LogbookOperationsClientMock extends AbstractMockClient implements LogbookOperationsClient
Mock client implementation for logbook operation

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class fr.gouv.vitam.common.client.AbstractMockClient

  `AbstractMockClient.FakeInboundResponse`

- ## Field Summary

  ### Fields inherited from interface fr.gouv.vitam.common.client.BasicClient

  `STATUS_URL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LogbookOperationsClientMock()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LifecycleTraceabilityStatus`
  `checkLifecycleTraceabilityWorkflowStatus(String operationId)`
  Check life cycle traceability status (unit / got)
  `LogbookCheckResult`
  `checkLogbookCoherence()`
  checkLogbookCoherence
  `void`
  `create(LogbookOperationParameters... parameters)`
  Create logbook entry
  To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).
  `void`
  `create(String eventIdProc, Iterable<LogbookOperationParameters> queue)`
  Bulk Create
  To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `getLastOperationByType(String operationType)`
  `void`
  `reconstructCollection(List<ReconstructionRequestItem> reconstructionItems)`
  `ReindexationResult`
  `reindex(IndexParameters indexParam)`
  Reindex a collection with parameters
  `com.fasterxml.jackson.databind.JsonNode`
  `selectOperation(com.fasterxml.jackson.databind.JsonNode select)`
  `com.fasterxml.jackson.databind.JsonNode`
  `selectOperation(com.fasterxml.jackson.databind.JsonNode select, boolean isSliced, boolean isCrossTenant)`
  `com.fasterxml.jackson.databind.JsonNode`
  `selectOperationById(String id)`
  `com.fasterxml.jackson.databind.JsonNode`
  `selectOperationById(String processId, com.fasterxml.jackson.databind.JsonNode query, boolean isSliced, boolean isCrossTenant)`
  `SwitchIndexResult`
  `switchIndexes(SwitchIndexParameters switchIndexParam)`
  Switch indexes
  `RequestResponseOK<TenantLogbookOperationTraceabilityResult>`
  `traceability(List<Integer> tenants)`
  Call traceability logbook operation for requested tenants
  `void`
  `traceabilityAudit(int tenant, AuditLogbookOptions options)`
  `RequestResponseOK<String>`
  `traceabilityLfcObjectGroup()`
  Starts Object Group logbook lifecycle traceability
  `RequestResponseOK<String>`
  `traceabilityLfcUnit()`
  Starts Unit logbook lifecycle traceability
  `void`
  `update(LogbookOperationParameters... parameters)`
  Update logbook entry
  To be used everywhere except very first time (when eventIdentifierProcess already used once)
  `void`
  `update(String eventIdProc, Iterable<LogbookOperationParameters> queue)`
  Bulk Update
  To be used everywhere except very first time (when eventIdentifierProcess already used once)

  ### Methods inherited from class fr.gouv.vitam.common.client.AbstractMockClient

  `checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl`

  ### 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.common.client.MockOrRestClient

  `checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl`

- ## Constructor Details

  - ### LogbookOperationsClientMock

    public LogbookOperationsClientMock()

- ## Method Details

  - ### create

    public void create(LogbookOperationParameters... parameters) throws LogbookClientBadRequestException, LogbookClientAlreadyExistsException, LogbookClientServerException
    Description copied from interface: `LogbookOperationsClient`
    Create logbook entry
    To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).
    Specified by:
      `create` in interface `LogbookOperationsClient`
    Parameters:
      `parameters` - the entry parameters
    Throws:
      `LogbookClientBadRequestException` - if the argument is incorrect
      `LogbookClientAlreadyExistsException` - if the element already exists
      `LogbookClientServerException` - if the Server got an internal error

  - ### update

    public void update(LogbookOperationParameters... parameters) throws LogbookClientBadRequestException, LogbookClientNotFoundException, LogbookClientServerException
    Description copied from interface: `LogbookOperationsClient`
    Update logbook entry
    To be used everywhere except very first time (when eventIdentifierProcess already used once)
    Specified by:
      `update` in interface `LogbookOperationsClient`
    Parameters:
      `parameters` - the entry parameters
    Throws:
      `LogbookClientBadRequestException` - if the argument is incorrect
      `LogbookClientNotFoundException` - if the element was not created before
      `LogbookClientServerException` - if the Server got an internal error

  - ### selectOperation

    public com.fasterxml.jackson.databind.JsonNode selectOperation(com.fasterxml.jackson.databind.JsonNode select) throws LogbookClientException, InvalidParseOperationException
    Specified by:
      `selectOperation` in interface `LogbookOperationsClient`
    Parameters:
      `select` -
    Returns:
      logbook operation as JsonNode
    Throws:
      `LogbookClientException`
      `InvalidParseOperationException`

  - ### selectOperation

    public com.fasterxml.jackson.databind.JsonNode selectOperation(com.fasterxml.jackson.databind.JsonNode select, boolean isSliced, boolean isCrossTenant) throws LogbookClientException, InvalidParseOperationException
    Specified by:
      `selectOperation` in interface `LogbookOperationsClient`
    Throws:
      `LogbookClientException`
      `InvalidParseOperationException`

  - ### selectOperationById

    public com.fasterxml.jackson.databind.JsonNode selectOperationById(String processId, com.fasterxml.jackson.databind.JsonNode query, boolean isSliced, boolean isCrossTenant) throws LogbookClientException, InvalidParseOperationException
    Specified by:
      `selectOperationById` in interface `LogbookOperationsClient`
    Throws:
      `LogbookClientException`
      `InvalidParseOperationException`

  - ### selectOperationById

    public com.fasterxml.jackson.databind.JsonNode selectOperationById(String id) throws LogbookClientException, InvalidParseOperationException
    Specified by:
      `selectOperationById` in interface `LogbookOperationsClient`
    Parameters:
      `id` - identifier
    Returns:
      logbook operation as String
    Throws:
      `LogbookClientException` - LogbookClientException
      `InvalidParseOperationException` - InvalidParseOperationException

  - ### traceability

    public RequestResponseOK<TenantLogbookOperationTraceabilityResult> traceability(List<Integer> tenants)
    Description copied from interface: `LogbookOperationsClient`
    Call traceability logbook operation for requested tenants
    Specified by:
      `traceability` in interface `LogbookOperationsClient`
    Returns:
      logbook operation result per tenant

  - ### create

    public void create(String eventIdProc, Iterable<LogbookOperationParameters> queue) throws LogbookClientBadRequestException
    Description copied from interface: `LogbookOperationsClient`
    Bulk Create
    To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).
    Specified by:
      `create` in interface `LogbookOperationsClient`
    Parameters:
      `eventIdProc` - event Process Identifier
      `queue` - queue of LogbookOperationParameters to create
    Throws:
      `LogbookClientBadRequestException` - if the argument is incorrect

  - ### update

    public void update(String eventIdProc, Iterable<LogbookOperationParameters> queue) throws LogbookClientBadRequestException
    Description copied from interface: `LogbookOperationsClient`
    Bulk Update
    To be used everywhere except very first time (when eventIdentifierProcess already used once)
    Specified by:
      `update` in interface `LogbookOperationsClient`
    Parameters:
      `eventIdProc` - event Process Identifier
      `queue` - queue of LogbookOperationParameters to update
    Throws:
      `LogbookClientBadRequestException` - if the argument is incorrect

  - ### traceabilityLfcUnit

    public RequestResponseOK<String> traceabilityLfcUnit()
    Description copied from interface: `LogbookOperationsClient`
    Starts Unit logbook lifecycle traceability
    Specified by:
      `traceabilityLfcUnit` in interface `LogbookOperationsClient`
    Returns:
      logbook lifecycles as String

  - ### traceabilityLfcObjectGroup

    public RequestResponseOK<String> traceabilityLfcObjectGroup()
    Description copied from interface: `LogbookOperationsClient`
    Starts Object Group logbook lifecycle traceability
    Specified by:
      `traceabilityLfcObjectGroup` in interface `LogbookOperationsClient`
    Returns:
      logbook lifecycles as String

  - ### reindex

    public ReindexationResult reindex(IndexParameters indexParam) throws InvalidParseOperationException
    Description copied from interface: `LogbookOperationsClient`
    Reindex a collection with parameters
    Specified by:
      `reindex` in interface `LogbookOperationsClient`
    Parameters:
      `indexParam` - reindexation parameters
    Returns:
      JsonObject containing information about the newly created index
    Throws:
      `InvalidParseOperationException`

  - ### switchIndexes

    public SwitchIndexResult switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException
    Description copied from interface: `LogbookOperationsClient`
    Switch indexes
    Specified by:
      `switchIndexes` in interface `LogbookOperationsClient`
    Parameters:
      `switchIndexParam` - switch index parameters
    Returns:
      JsonObject containing information about the newly created index
    Throws:
      `InvalidParseOperationException`

  - ### traceabilityAudit

    public void traceabilityAudit(int tenant, AuditLogbookOptions options)
    Specified by:
      `traceabilityAudit` in interface `LogbookOperationsClient`

  - ### checkLogbookCoherence

    public LogbookCheckResult checkLogbookCoherence()
    Description copied from interface: `LogbookOperationsClient`
    checkLogbookCoherence
    Specified by:
      `checkLogbookCoherence` in interface `LogbookOperationsClient`
    Returns:
      result

  - ### getLastOperationByType

    public RequestResponse<com.fasterxml.jackson.databind.JsonNode> getLastOperationByType(String operationType)
    Specified by:
      `getLastOperationByType` in interface `LogbookOperationsClient`

  - ### reconstructCollection

    public void reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) throws LogbookClientServerException
    Specified by:
      `reconstructCollection` in interface `LogbookOperationsClient`
    Throws:
      `LogbookClientServerException`

  - ### checkLifecycleTraceabilityWorkflowStatus

    public LifecycleTraceabilityStatus checkLifecycleTraceabilityWorkflowStatus(String operationId)
    Description copied from interface: `LogbookOperationsClient`
    Check life cycle traceability status (unit / got)
    Specified by:
      `checkLifecycleTraceabilityWorkflowStatus` in interface `LogbookOperationsClient`
    Parameters:
      `operationId` - the process id
    Returns:
      lifecycle traceability status