public class LogbookOperationsClientFactory extends VitamClientFactory<LogbookOperationsClient>
{
@code
// Retrieve default operation client
LogbookClient client = LogbookClientFactory.getInstance().getLogbookOperationClient();
// Retrieve operation parameters class (check LogbookParametersFactory
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 LogbookParametersFactory
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);
}
VitamClientFactoryInterface.VitamClientType
Modifier and Type | Field and Description |
---|---|
static String |
RESOURCE_PATH
RESOURCE PATH
|
clientConfiguration
Modifier and Type | Method and Description |
---|---|
static void |
changeMode(ClientConfiguration configuration) |
LogbookOperationsClient |
getClient()
Get the default type logbook client
|
static LogbookOperationsClientFactory |
getInstance()
Get the LogbookClientFactory instance
|
changeResourcePath, changeServerPort, disableUseAuthorizationFilter, enableUseAuthorizationFilter, getClientConfiguration, getDefaultConfigCient, getDefaultConfigCient, getHttpClient, getHttpClient, getResourcePath, getServiceUrl, getVitamClientType, getVitamThreadPoolExecutor, initialisation, isAllowGzipDecoded, isAllowGzipEncoded, resume, setGzipdecoded, setGzipEncoded, setVitamClientType, shutdown, toString
public static final String RESOURCE_PATH
public static final LogbookOperationsClientFactory getInstance()
public LogbookOperationsClient getClient()
public static final void changeMode(ClientConfiguration configuration)
configuration
- null for MOCKCopyright © 2018 Vitam. All rights reserved.