Interface JAXRSProxyClientFactory

All Known Implementing Classes:
ResteasyProxyClientFactoryImpl

public interface JAXRSProxyClientFactory
A factory that builds dynamic proxy clients (using JAX-RS RESTful client interfaces) for services at a known location
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    createClient(Class<T> iface, String endpoint)
    Create a dynamic proxy client for the desired service, setting the base endpoint
    <T> T
    createClient(Class<T> iface, URI endpoint)
    Create a dynamic proxy client for the desired service, setting the base endpoint
    <T> T
    createClient(Class<T> iface, URI endpoint, boolean preemptiveAuth)
    Create a dynamic proxy client for the desired service, setting the base endpoint
    <T> T
    createClientWithBearerAuth(Class<T> iface, URI endpoint, Supplier<String> token)
    Create a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth
    <T> T
    createClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password)
    Deprecated.
    <T> T
    createClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password, boolean preemptiveAuth)
    Create a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth
    org.jboss.resteasy.client.jaxrs.ResteasyWebTarget
    createWebTarget(URI endpoint, String username, String password)
    Create a WebTarget for a fixed endpoint optionally with a given username and password
    <T> T
    getClient(Class<T> iface)
    Get a client for the provided interface, searching for the service in configuration using the default name(s)
    <T> T
    getClient(Class<T> iface, String... names)
    Retrieve a Proxy client for the service, searching for the service in configuration using the ordered list of names
    <T> T
    getClient(Class<T> iface, javax.ws.rs.client.WebTarget target)
    Get a client for the provided interface, building it from the provided WebTarget
    javax.ws.rs.client.WebTarget
    getWebTarget(Class<?> iface, String... names)
    Retrieve a WebTarget, using the configuration for the named service interface (but not creating a dynamic proxy client)
    javax.ws.rs.client.WebTarget
    getWebTarget(String... names)
    Retrieve a WebTarget for the service, searching for the service in configuration using the ordered list of names
  • Method Details

    • getWebTarget

      javax.ws.rs.client.WebTarget getWebTarget(String... names)
      Retrieve a WebTarget for the service, searching for the service in configuration using the ordered list of names
      Parameters:
      names -
      Returns:
    • getWebTarget

      javax.ws.rs.client.WebTarget getWebTarget(Class<?> iface, String... names)
      Retrieve a WebTarget, using the configuration for the named service interface (but not creating a dynamic proxy client)
      Parameters:
      iface - the service interface to read configuration (endpoint, auth policy, etc.) from
      names -
      Returns:
    • getClient

      <T> T getClient(Class<T> iface, String... names)
      Retrieve a Proxy client for the service, searching for the service in configuration using the ordered list of names
      Type Parameters:
      T -
      Parameters:
      iface - the service iface
      names -
      Returns:
    • getClient

      <T> T getClient(Class<T> iface)
      Get a client for the provided interface, searching for the service in configuration using the default name(s)
      Type Parameters:
      T -
      Parameters:
      iface - the service iface
      Returns:
    • getClient

      <T> T getClient(Class<T> iface, javax.ws.rs.client.WebTarget target)
      Get a client for the provided interface, building it from the provided WebTarget
      Type Parameters:
      T -
      Parameters:
      iface - the service iface
      target - the WebTarget to use to build the dynamic proxy client
      Returns:
    • createWebTarget

      org.jboss.resteasy.client.jaxrs.ResteasyWebTarget createWebTarget(URI endpoint, String username, String password)
      Create a WebTarget for a fixed endpoint optionally with a given username and password
      Parameters:
      endpoint -
      username -
      password -
      Returns:
    • createClient

      <T> T createClient(Class<T> iface, URI endpoint)
      Create a dynamic proxy client for the desired service, setting the base endpoint
      Type Parameters:
      T - the type of the service
      Parameters:
      iface - the service interface
      endpoint - a valid URI to use as a base point for the provided service interface
      Returns:
      a dynamic proxy for the service
    • createClient

      <T> T createClient(Class<T> iface, URI endpoint, boolean preemptiveAuth)
      Create a dynamic proxy client for the desired service, setting the base endpoint
      Type Parameters:
      T - the type of the service
      Parameters:
      iface - the service interface
      endpoint - a valid URI to use as a base point for the provided service interface
      preemptiveAuth - if true, enable pre-emptive basic authentication
      Returns:
      a dynamic proxy for the service
    • createClient

      <T> T createClient(Class<T> iface, String endpoint)
      Create a dynamic proxy client for the desired service, setting the base endpoint
      Type Parameters:
      T - the type of the service
      Parameters:
      iface - the service interface
      endpoint - a valid URI to use as a base point for the provided service interface
      Returns:
      a dynamic proxy for the service
      Throws:
      IllegalArgumentException - if endpoint cannot be parsed as a valid URI
    • createClientWithPasswordAuth

      @Deprecated <T> T createClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password)
      Deprecated.
      Create a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth
      Type Parameters:
      T - the type of the service
      Parameters:
      iface - the service interface
      endpoint - a valid URI to use as a base point for the provided service interface
      username - the username to use
      password - the password to use
      Returns:
      a dynamic proxy for the service
      Throws:
      IllegalArgumentException - if endpoint cannot be parsed as a valid URI
    • createClientWithBearerAuth

      <T> T createClientWithBearerAuth(Class<T> iface, URI endpoint, Supplier<String> token)
      Create a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth
      Type Parameters:
      T - the type of the service
      Parameters:
      iface - the service interface
      endpoint - a valid URI to use as a base point for the provided service interface
      token - a supplier that will be asked to provide a token for each HTTP call
      Returns:
      a dynamic proxy for the service
      Throws:
      IllegalArgumentException - if endpoint cannot be parsed as a valid URI
    • createClientWithPasswordAuth

      <T> T createClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password, boolean preemptiveAuth)
      Create a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth
      Type Parameters:
      T - the type of the service
      Parameters:
      iface - the service interface
      endpoint - a valid URI to use as a base point for the provided service interface
      username - the username to use
      password - the password to use
      preemptiveAuth - if true then pre-emptive basic authentication will be used if credentials are also supplied
      Returns:
      a dynamic proxy for the service
      Throws:
      IllegalArgumentException - if endpoint cannot be parsed as a valid URI