public class WorkerClientFactory extends VitamClientFactory<WorkerClient>
WorkerClient factory
Used to get a worker client depending on its type. Example :
{ @code // Retrieves a worker client given a configuration WorkerClientConfiguration configuration1 = new WorkerClientConfiguration("localhost",8076); WorkerClient client = WorkerClientFactory.getInstance(configuration1).getWorkerClient(); // Exists client.exists(asyncId); }You can change the type of the client to get. The types are defined in the enum
WorkerClientType
. Use the
changeDefaultClientType method to change the client type.VitamClientFactoryInterface.VitamClientType
Modifier and Type | Field and Description |
---|---|
static String |
RESOURCE_PATH
RESOURCE PATH
|
clientConfiguration
Modifier and Type | Method and Description |
---|---|
static WorkerClientConfiguration |
changeConfigurationFile(String configurationPath)
Change client configuration from a Yaml files
|
static void |
changeMode(WorkerClientConfiguration configuration) |
WorkerClient |
getClient()
Get the default worker client
|
static WorkerClientFactory |
getInstance(WorkerClientConfiguration configuration)
get Specifique workerfactory 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 WorkerClientFactory getInstance(WorkerClientConfiguration configuration)
configuration
- the worker client configurationpublic WorkerClient getClient()
public static final WorkerClientConfiguration changeConfigurationFile(String configurationPath)
configurationPath
- the path to the configuration filepublic static final void changeMode(WorkerClientConfiguration configuration)
configuration
- null for MOCKCopyright © 2018 Vitam. All rights reserved.