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

# Class LogbookOperationsClientFactory

java.lang.Object
fr.gouv.vitam.common.client.VitamClientFactory<LogbookOperationsClient>
fr.gouv.vitam.logbook.operations.client.LogbookOperationsClientFactory

All Implemented Interfaces:
  `VitamClientFactoryInterface<LogbookOperationsClient>`

public class LogbookOperationsClientFactory extends VitamClientFactory<LogbookOperationsClient>
Logbook client factory
Used to get a client logbook depending on its type. Example of operation creation:

     {
         @code
         // Retrieve default operation client
         LogbookClient client = LogbookClientFactory.getInstance().getLogbookOperationClient();

         // Retrieve operation parameters class (check LogbookParameterHelper for more informations)
         LogbookParameters parameters = LogbookParametersFactory.newLogbookOperationParameters();

         // Use setters
         parameters.setParameterValue(LogbookParameterName.eventTypeProcess, LogbookParameterName.eventTypeProcess
             .name()).setParameterValue(LogbookParameterName.outcome, StatusCode.STARTED.name());

         client.create(parameters);
     }

Example of operation update:

     {
         @code
         // Retrieve default operation client
         LogbookClient client = LogbookClientFactory.getInstance().getLogbookOperationClient();

         // Retrieve operation parameters class (check LogbookParameterHelper for more informations)
         LogbookParameters parameters = LogbookParametersFactory.newLogbookOperationParameters();

         // Event GUID
         parameters.setParameterValue(LogbookParameterName.eventIdentifier,
             GUIDFactory.newOperationIdGUID(tenantId).toString());

         // Event type
         parameters.setParameterValue(LogbookParameterName.eventType, "UNZIP");
         parameters.setParameterValue(LogbookParameterName.outcome, StatusCode.STARTED.name());

         client.update(parameters);
     }

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface fr.gouv.vitam.common.client.VitamClientFactoryInterface

  `VitamClientFactoryInterface.VitamClientType`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `RESOURCE_PATH`
  RESOURCE PATH

  ### Fields inherited from class fr.gouv.vitam.common.client.VitamClientFactory

  `clientConfiguration`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static final void`
  `changeMode(ClientConfiguration configuration)`
  `LogbookOperationsClient`
  `getClient()`
  This method returns the correct Client adapted to the business case
  `static final LogbookOperationsClientFactory`
  `getInstance()`
  Get the LogbookOperationsClientFactory instance
  `static LogbookOperationsClientFactory`
  `getInstance(WorkFlowExecutionContext executionContext)`
  Get the LogbookOperationsClientFactory instance for the given workflow execution context

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

  `changeResourcePath, changeServerPort, disableUseAuthorizationFilter, enableUseAuthorizationFilter, getClientConfiguration, getDefaultConfigCient, getDefaultConfigCient, getHttpClient, getHttpClient, getResourcePath, getServiceUrl, getVitamClientType, getVitamThreadPoolExecutor, initialisation, isAllowGzipDecoded, isAllowGzipEncoded, resetConnections, resume, setGzipdecoded, setGzipEncoded, setVitamClientType, shutdown, toString`

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

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

- ## Field Details

  - ### RESOURCE_PATH

    public static final String RESOURCE_PATH
    RESOURCE PATH
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getInstance

    public static final LogbookOperationsClientFactory getInstance()
    Get the LogbookOperationsClientFactory instance
    Returns:
      the instance

  - ### getInstance

    public static LogbookOperationsClientFactory getInstance(WorkFlowExecutionContext executionContext)
    Get the LogbookOperationsClientFactory instance for the given workflow execution context
    Parameters:
      `executionContext` - the workflow execution context
    Returns:
      the instance

  - ### getClient

    public LogbookOperationsClient getClient()
    Description copied from interface: `VitamClientFactoryInterface`
    This method returns the correct Client adapted to the business case
    Returns:
      the Vitam client

  - ### changeMode

    public static final void changeMode(ClientConfiguration configuration)
    Parameters:
      `configuration` - null for MOCK