Class 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 Detail

      • RESOURCE_PATH

        public static final java.lang.String RESOURCE_PATH
        RESOURCE PATH
        See Also:
        Constant Field Values
    • Method Detail

      • 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