Package fr.gouv.vitam.storage.engine.client

# Class StorageClientFactory

java.lang.Object
fr.gouv.vitam.common.client.VitamClientFactory<StorageClient>
fr.gouv.vitam.storage.engine.client.StorageClientFactory

All Implemented Interfaces:
  `VitamClientFactoryInterface<StorageClient>`

public class StorageClientFactory extends VitamClientFactory<StorageClient>

StorageClient factory

Use to get a storage client in function of its type. Example :

     {
         @code
         // Retrieve default storage client
         StorageClient client = StorageClientFactory.getInstance().getStorageClient();

         // Exists
         client.exists(tenantId, strategyId);
     }

You can change the type of the client to get. The types are define into the enum `StorageClient`. 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`
  Default path

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

  `clientConfiguration`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static final void`
  `changeMode(ClientConfiguration configuration)`
  `StorageClient`
  `getClient()`
  This method returns the correct Client adapted to the business case
  `static StorageClientFactory`
  `getInstance()`
  Get the StorageClientFactory instance
  `static StorageClientFactory`
  `getInstance(WorkFlowExecutionContext executionContext)`
  Get the StorageClientFactory instance for the given workflow execution context

  ### 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
    Default path
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getInstance

    public static StorageClientFactory getInstance()
    Get the StorageClientFactory instance
    Returns:
      the instance

  - ### getInstance

    public static StorageClientFactory getInstance(WorkFlowExecutionContext executionContext)
    Get the StorageClientFactory instance for the given workflow execution context
    Parameters:
      `executionContext` - the workflow execution context
    Returns:
      the instance

  - ### getClient

    public StorageClient getClient()
    Description copied from interface: `VitamClientFactoryInterface`
    This method returns the correct Client adapted to the business case
    Returns:
      the Vitam client

  - ### changeMode

    public static final void changeMode(ClientConfiguration configuration)