Class LogbookLifeCyclesClientFactory

  • All Implemented Interfaces:
    VitamClientFactoryInterface<LogbookLifeCyclesClient>

    public class LogbookLifeCyclesClientFactory
    extends VitamClientFactory<LogbookLifeCyclesClient>
    Logbook lifecycles client factory

    Use to get a logbook lifecycles client in function of its type. Example of lifecycle creation:
     {
         @code
         // Retrieve default lifecycles client
         LogbookLifeCycleClient client = LogbookClientFactory.getInstance().getLogbookLifeCyclesClient();
    
         // Retrieve lifecycles parameters class (check LogbookParameterHelper for more informations)
         LogbookParameters parameters = LogbookParameterHelper.newLogbookLifeCyclesParameters();
    
         // Use setters
         parameters.setParameterValue(LogbookParameterName.eventTypeProcess, LogbookParameterName.eventTypeProcess
             .name()).setParameterValue(LogbookParameterName.outcome, StatusCode.STARTED.name());
    
         client.create(parameters);
     }
     
    Example for update lifecycles:
     {
         @code
         // Retrieve default lifecycles client
         LogbookLifeCycleClient client = LogbookClientFactory.getInstance().getLogbookLifeCyclesClient();
    
         // Retrieve lifecycles parameters class (check LogbookParameterHelper for more informations)
         LogbookParameters parameters = LogbookParameterHelper.newLogbookLifeCyclesParameters();
    
         // Event GUID
         parameters.setParameterValue(LogbookParameterName.eventIdentifier,
             GUIDFactory.newLifeCyclesIdGUID(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 LogbookLifeCyclesClient 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