Class LogbookOperationsClientFactory
java.lang.Object
fr.gouv.vitam.common.client.VitamClientFactory<LogbookOperationsClient>
fr.gouv.vitam.logbook.operations.client.LogbookOperationsClientFactory
- All Implemented Interfaces:
VitamClientFactoryInterface<LogbookOperationsClient>
Logbook client factory
Used to get a client logbook depending on its type. Example of operation creation:
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);
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface fr.gouv.vitam.common.client.VitamClientFactoryInterface
VitamClientFactoryInterface.VitamClientType
-
Field Summary
Fields inherited from class fr.gouv.vitam.common.client.VitamClientFactory
clientConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
changeMode
(ClientConfiguration configuration) Get the default type logbook clientstatic final LogbookOperationsClientFactory
Get the LogbookClientFactory instanceMethods 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 LogbookClientFactory instance- Returns:
- the instance
-
getClient
Get the default type logbook client- Returns:
- the default logbook client
-
changeMode
- Parameters:
configuration
- null for MOCK
-