Class LogbookLifeCyclesClientFactory
java.lang.Object
fr.gouv.vitam.common.client.VitamClientFactory<LogbookLifeCyclesClient>
fr.gouv.vitam.logbook.lifecycles.client.LogbookLifeCyclesClientFactory
- All Implemented Interfaces:
VitamClientFactoryInterface<LogbookLifeCyclesClient>
Logbook lifecycles client factory
Use to get a logbook lifecycles client in function of its type. Example of lifecycle creation:
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);
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface fr.gouv.vitam.common.client.VitamClientFactoryInterface
VitamClientFactoryInterface.VitamClientType
-
Field Summary
FieldsFields inherited from class fr.gouv.vitam.common.client.VitamClientFactory
clientConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
changeMode
(ClientConfiguration configuration) This method returns the correct Client adapted to the business casestatic final LogbookLifeCyclesClientFactory
Get the LogbookLifeCyclesClientFactory instancegetInstance
(WorkFlowExecutionContext executionContext) Get the LogbookLifeCyclesClientFactory instance for the given workflow execution contextMethods 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 Details
-
RESOURCE_PATH
RESOURCE PATH- See Also:
-
-
Method Details
-
getInstance
Get the LogbookLifeCyclesClientFactory instance- Returns:
- the instance
-
getInstance
Get the LogbookLifeCyclesClientFactory instance for the given workflow execution context- Parameters:
executionContext
- the workflow execution context- Returns:
- the instance
-
getClient
Description copied from interface:VitamClientFactoryInterface
This method returns the correct Client adapted to the business case- Returns:
- the Vitam client
-
changeMode
- Parameters:
configuration
- null for MOCK
-