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
Example of operation update: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); }{ @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 java.lang.String
RESOURCE_PATH
RESOURCE PATH-
Fields inherited from class fr.gouv.vitam.common.client.VitamClientFactory
clientConfiguration
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
changeMode(ClientConfiguration configuration)
LogbookOperationsClient
getClient()
Get the default type logbook clientstatic LogbookOperationsClientFactory
getInstance()
Get the LogbookClientFactory instance-
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
-
-
-
-
Field Detail
-
RESOURCE_PATH
public static final java.lang.String RESOURCE_PATH
RESOURCE PATH- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-