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 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
  Modifier and Type
  Field
  Description
  `static final String`
  `RESOURCE_PATH`
  RESOURCE PATH

  ### Fields inherited from class fr.gouv.vitam.common.client.VitamClientFactory

  `clientConfiguration`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static final WorkerClientConfiguration`
  `changeConfigurationFile(String configurationPath)`
  Change client configuration from a Yaml files
  `static final void`
  `changeMode(WorkerClientConfiguration configuration)`
  `WorkerClient`
  `getClient()`
  Get the default worker client
  `static 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### RESOURCE_PATH

    public static final String RESOURCE_PATH
    RESOURCE PATH
    See Also:
      - Constant Field Values

- ## Method Details

  - ### 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(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