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);
 }
 
  • Field Details

  • Method Details

    • getInstance

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

      public LogbookOperationsClient getClient()
      Get the default type logbook client
      Returns:
      the default logbook client
    • changeMode

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