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>
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
WorkerClient
. 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 inherited from class fr.gouv.vitam.common.client.VitamClientFactory
clientConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionstatic final WorkerClientConfiguration
changeConfigurationFile
(String configurationPath) Change client configuration from a Yaml filesstatic final void
changeMode
(WorkerClientConfiguration configuration) Get the default worker clientstatic WorkerClientFactory
getInstance
(WorkerClientConfiguration configuration) get Specifique workerfactory 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 Specifique workerfactory instance- Parameters:
configuration
- the worker client configuration- Returns:
- an instance of WorkerClientFactory
-
getClient
Get the default worker client- Returns:
- the default worker client
-
changeConfigurationFile
Change client configuration from a Yaml files- Parameters:
configurationPath
- the path to the configuration file- Returns:
- un instance of WorkerClientConfiguration
-
changeMode
- Parameters:
configuration
- null for MOCK
-