Class ApacheConnectorProvider

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Connector getConnector​(javax.ws.rs.client.Client client, javax.ws.rs.core.Configuration runtimeConfig)
      Get a Jersey client connector instance for a given client instance and Jersey client runtime configuration.
      private static ApacheConnector getConnector​(javax.ws.rs.core.Configurable<?> component)  
      static org.apache.http.client.CookieStore getCookieStore​(javax.ws.rs.core.Configurable<?> component)
      Retrieve the underlying Apache CookieStore instance from JerseyClient or JerseyWebTarget configured to use ApacheConnectorProvider.
      static org.apache.http.client.HttpClient getHttpClient​(javax.ws.rs.core.Configurable<?> component)
      Retrieve the underlying Apache HttpClient instance from JerseyClient or JerseyWebTarget configured to use ApacheConnectorProvider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ApacheConnectorProvider

        public ApacheConnectorProvider()
    • Method Detail

      • getConnector

        public Connector getConnector​(javax.ws.rs.client.Client client,
                                      javax.ws.rs.core.Configuration runtimeConfig)
        Description copied from interface: ConnectorProvider
        Get a Jersey client connector instance for a given client instance and Jersey client runtime configuration.

        Note that the supplied runtime configuration can be different from the client instance configuration as a single client can be used to serve multiple differently configured runtimes. While the SSL context or hostname verifier are shared, other configuration properties may change in each runtime.

        Based on the supplied client and runtime configuration data, it is up to each connector provider implementation to decide whether a new dedicated connector instance is required or if the existing, previously create connector instance can be reused.

        Specified by:
        getConnector in interface ConnectorProvider
        Parameters:
        client - Jersey client instance.
        runtimeConfig - Jersey client runtime configuration.
        Returns:
        configured Connector instance to be used by the client.
      • getHttpClient

        public static org.apache.http.client.HttpClient getHttpClient​(javax.ws.rs.core.Configurable<?> component)
        Retrieve the underlying Apache HttpClient instance from JerseyClient or JerseyWebTarget configured to use ApacheConnectorProvider.
        Parameters:
        component - JerseyClient or JerseyWebTarget instance that is configured to use ApacheConnectorProvider.
        Returns:
        underlying Apache HttpClient instance.
        Throws:
        java.lang.IllegalArgumentException - in case the component is neither JerseyClient nor JerseyWebTarget instance or in case the component is not configured to use a ApacheConnectorProvider.
        Since:
        2.8
      • getCookieStore

        public static org.apache.http.client.CookieStore getCookieStore​(javax.ws.rs.core.Configurable<?> component)
        Retrieve the underlying Apache CookieStore instance from JerseyClient or JerseyWebTarget configured to use ApacheConnectorProvider.
        Parameters:
        component - JerseyClient or JerseyWebTarget instance that is configured to use ApacheConnectorProvider.
        Returns:
        underlying Apache CookieStore instance.
        Throws:
        java.lang.IllegalArgumentException - in case the component is neither JerseyClient nor JerseyWebTarget instance or in case the component is not configured to use a ApacheConnectorProvider.
        Since:
        2.16
      • getConnector

        private static ApacheConnector getConnector​(javax.ws.rs.core.Configurable<?> component)