Package fr.gouv.vitam.common.client

# Class VitamClientFactory<T extends MockOrRestClient>

java.lang.Object
fr.gouv.vitam.common.client.VitamClientFactory<T>

Type Parameters:
  `T` - MockOrRestClient class

All Implemented Interfaces:
  `VitamClientFactoryInterface<T>`

Direct Known Subclasses:
  `AccessInternalClientFactory`, `AdminManagementClientFactory`, `BatchReportClientFactory`, `CollectInternalClientFactory`, `IhmRecetteClientFactory`, `IngestInternalClientFactory`, `InternalSecurityClientFactory`, `LogbookLifeCyclesClientFactory`, `LogbookOperationsClientFactory`, `MetaDataClientFactory`, `ProcessingManagementClientFactory`, `SchedulerClientFactory`, `SiegfriedClientFactory`, `StorageClientFactory`, `TestVitamClientFactory`, `WorkerClientFactory`, `WorkspaceClientFactory`

public abstract class VitamClientFactory<T extends MockOrRestClient> extends Object implements VitamClientFactoryInterface<T>
General VitamClientFactory for non SSL client

- ## 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
  `protected ClientConfiguration`
  `clientConfiguration`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `VitamClientFactory(ClientConfiguration configuration, String resourcePath)`
  Constructor with standard configuration
  `protected`
  `VitamClientFactory(ClientConfiguration configuration, String resourcePath, boolean cacheable)`
  Constructor with standard configuration
  `protected`
  `VitamClientFactory(ClientConfiguration configuration, String resourcePath, boolean chunkedMode, boolean cacheable)`
  Constructor to allow to enable Multipart support or Chunked mode.
  `protected`
  `VitamClientFactory(ClientConfiguration configuration, String resourcePath, jakarta.ws.rs.client.Client client)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `changeResourcePath(String resourcePath)`
  Change the server resourcePath to use.
  `void`
  `changeServerPort(int port)`
  Change the server port to use.
  `protected void`
  `disableUseAuthorizationFilter()`
  `protected void`
  `enableUseAuthorizationFilter()`
  `final ClientConfiguration`
  `getClientConfiguration()`
  `final Map<VitamRestEasyConfiguration,Object>`
  `getDefaultConfigCient()`
  `final Map<VitamRestEasyConfiguration,Object>`
  `getDefaultConfigCient(boolean chunkedMode)`
  `jakarta.ws.rs.client.Client`
  `getHttpClient()`
  Get the internal Http client
  `jakarta.ws.rs.client.Client`
  `getHttpClient(boolean useChunkedMode)`
  Get the internal Http client according to the chunk mode
  `String`
  `getResourcePath()`
  Get the resource path of the server.
  `String`
  `getServiceUrl()`
  Get the service URL
  `VitamClientFactoryInterface.VitamClientType`
  `getVitamClientType()`
  `VitamThreadPoolExecutor`
  `getVitamThreadPoolExecutor()`
  `protected final void`
  `initialisation(ClientConfiguration configuration, String resourcePath)`
  Initialize default resource path, service Url, pool manager, ssl configuration and the VitamApacheHttpClient for RestEasy
  `protected boolean`
  `isAllowGzipDecoded()`
  `protected boolean`
  `isAllowGzipEncoded()`
  `static void`
  `resetConnections()`
  Closes any pending connection.
  `void`
  `resume(jakarta.ws.rs.client.Client client, boolean chunk)`
  Reset the client into the Client pool if possible
  `void`
  `setGzipdecoded(boolean allowGzipDecoded)`
  Allow or not the GzipDecoded input from server
  `void`
  `setGzipEncoded(boolean allowGzipEncoded)`
  Allow or not the GzipEncoded output from client
  `VitamClientFactory<T>`
  `setVitamClientType(VitamClientFactoryInterface.VitamClientType vitamClientType)`
  `void`
  `shutdown()`
  Shutdown the global Connection Manager (cannot be restarted yet)
  `String`
  `toString()`

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

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

  ### Methods inherited from interface fr.gouv.vitam.common.client.VitamClientFactoryInterface

  `getClient`

- ## Field Details

  - ### clientConfiguration

    protected ClientConfiguration clientConfiguration

- ## Constructor Details

  - ### VitamClientFactory

    protected VitamClientFactory(ClientConfiguration configuration, String resourcePath)
    Constructor with standard configuration
    Parameters:
      `configuration` - The client configuration
      `resourcePath` - the resource path of the server for the client calls
    Throws:
      `UnsupportedOperationException` - HTTPS not implemented yet

  - ### VitamClientFactory

    protected VitamClientFactory(ClientConfiguration configuration, String resourcePath, boolean cacheable)
    Constructor with standard configuration
    Parameters:
      `configuration` - The client configuration
      `resourcePath` - the resource path of the server for the client calls
    Throws:
      `UnsupportedOperationException` - HTTPS not implemented yet

  - ### VitamClientFactory

    protected VitamClientFactory(ClientConfiguration configuration, String resourcePath, boolean chunkedMode, boolean cacheable)
    Constructor to allow to enable Multipart support or Chunked mode.
    Parameters:
      `configuration` - The client configuration
      `resourcePath` - the resource path of the server for the client calls
      `chunkedMode` - one can managed here if the client is in default chunkedMode or not
    Throws:
      `UnsupportedOperationException` - HTTPS not implemented yet

  - ### VitamClientFactory

    protected VitamClientFactory(ClientConfiguration configuration, String resourcePath, jakarta.ws.rs.client.Client client)
    Parameters:
      `configuration` - the client configuration
      `resourcePath` - the resource path of the server for the client calls
      `client` - the HTTP client to use
    Throws:
      `UnsupportedOperationException` - HTTPS not implemented yet

- ## Method Details

  - ### disableUseAuthorizationFilter

    protected void disableUseAuthorizationFilter()

  - ### enableUseAuthorizationFilter

    protected void enableUseAuthorizationFilter()

  - ### setGzipEncoded

    public void setGzipEncoded(boolean allowGzipEncoded)
    Allow or not the GzipEncoded output from client
    Parameters:
      `allowGzipEncoded` -

  - ### isAllowGzipEncoded

    protected boolean isAllowGzipEncoded()
    Returns:
      true if client is allowed to gzip encoded

  - ### setGzipdecoded

    public void setGzipdecoded(boolean allowGzipDecoded)
    Allow or not the GzipDecoded input from server
    Parameters:
      `allowGzipDecoded` -

  - ### isAllowGzipDecoded

    protected boolean isAllowGzipDecoded()
    Returns:
      true if client is allowed to gzip decoded

  - ### initialisation

    protected final void initialisation(ClientConfiguration configuration, String resourcePath)
    Initialize default resource path, service Url, pool manager, ssl configuration and the VitamApacheHttpClient for RestEasy
    Parameters:
      `configuration` -
      `resourcePath` -

  - ### changeResourcePath

    public void changeResourcePath(String resourcePath)
    Description copied from interface: `VitamClientFactoryInterface`
    Change the server resourcePath to use. Only in JUNIT
    Specified by:
      `changeResourcePath` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Parameters:
      `resourcePath` -

  - ### changeServerPort

    public void changeServerPort(int port)
    Description copied from interface: `VitamClientFactoryInterface`
    Change the server port to use. Only in JUNIT
    Specified by:
      `changeServerPort` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Parameters:
      `port` -

  - ### getVitamClientType

    public VitamClientFactoryInterface.VitamClientType getVitamClientType()
    Specified by:
      `getVitamClientType` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Returns:
      the current `VitamClientFactoryInterface.VitamClientType`

  - ### setVitamClientType

    public VitamClientFactory<T> setVitamClientType(VitamClientFactoryInterface.VitamClientType vitamClientType)
    Specified by:
      `setVitamClientType` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Parameters:
      `vitamClientType` - to set
    Returns:
      this

  - ### resume

    public void resume(jakarta.ws.rs.client.Client client, boolean chunk)
    Description copied from interface: `VitamClientFactoryInterface`
    Reset the client into the Client pool if possible
    Specified by:
      `resume` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Parameters:
      `client` -
      `chunk` -

  - ### getHttpClient

    public jakarta.ws.rs.client.Client getHttpClient()
    Description copied from interface: `VitamClientFactoryInterface`
    Get the internal Http client
    Specified by:
      `getHttpClient` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Returns:
      the client

  - ### getHttpClient

    public jakarta.ws.rs.client.Client getHttpClient(boolean useChunkedMode)
    Description copied from interface: `VitamClientFactoryInterface`
    Get the internal Http client according to the chunk mode
    Specified by:
      `getHttpClient` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Parameters:
      `useChunkedMode` -
    Returns:
      the client

  - ### getResourcePath

    public String getResourcePath()
    Description copied from interface: `VitamClientFactoryInterface`
    Get the resource path of the server.
    Specified by:
      `getResourcePath` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Returns:
      the resource path as string

  - ### getServiceUrl

    public String getServiceUrl()
    Description copied from interface: `VitamClientFactoryInterface`
    Get the service URL
    Specified by:
      `getServiceUrl` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Returns:
      the service URL

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getClientConfiguration

    public final ClientConfiguration getClientConfiguration()
    Specified by:
      `getClientConfiguration` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Returns:
      the Vitam client configuration

  - ### getDefaultConfigCient

    public final Map<VitamRestEasyConfiguration,Object> getDefaultConfigCient()
    Specified by:
      `getDefaultConfigCient` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Returns:
      the Default Client configuration (Chunked Mode)

  - ### getDefaultConfigCient

    public final Map<VitamRestEasyConfiguration,Object> getDefaultConfigCient(boolean chunkedMode)
    Specified by:
      `getDefaultConfigCient` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`
    Parameters:
      `chunkedMode` -
    Returns:
      the Default Client configuration according to the chunked mode

  - ### shutdown

    public void shutdown()
    Shutdown the global Connection Manager (cannot be restarted yet)
    Specified by:
      `shutdown` in interface `VitamClientFactoryInterface<T extends MockOrRestClient>`

  - ### resetConnections

    public static void resetConnections()
    Closes any pending connection.

  - ### getVitamThreadPoolExecutor

    public VitamThreadPoolExecutor getVitamThreadPoolExecutor()
    Returns:
      the VitamThreadPoolExecutor used by the server