Package fr.gouv.vitam.worker.client
Class WorkerClientFactory
- java.lang.Object
-
- fr.gouv.vitam.common.client.VitamClientFactory<WorkerClient>
-
- fr.gouv.vitam.worker.client.WorkerClientFactory
-
- All Implemented Interfaces:
VitamClientFactoryInterface<WorkerClient>
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 enumWorkerClient
. Use the changeDefaultClientType method to change the client type.
-
-
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 WorkerClientConfiguration
changeConfigurationFile(java.lang.String configurationPath)
Change client configuration from a Yaml filesstatic void
changeMode(WorkerClientConfiguration configuration)
WorkerClient
getClient()
Get the default worker clientstatic WorkerClientFactory
getInstance(WorkerClientConfiguration configuration)
get Specifique workerfactory 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 WorkerClientFactory getInstance(WorkerClientConfiguration configuration)
get Specifique workerfactory instance- Parameters:
configuration
- the worker client configuration- Returns:
- an instance of WorkerClientFactory
-
getClient
public WorkerClient getClient()
Get the default worker client- Returns:
- the default worker client
-
changeConfigurationFile
public static final WorkerClientConfiguration changeConfigurationFile(java.lang.String configurationPath)
Change client configuration from a Yaml files- Parameters:
configurationPath
- the path to the configuration file- Returns:
- un instance of WorkerClientConfiguration
-
changeMode
public static final void changeMode(WorkerClientConfiguration configuration)
- Parameters:
configuration
- null for MOCK
-
-