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 TypeMethodDescription<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 authorg.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
Get a client for the provided interface, searching for the service in configuration using the default name(s)<T> T
Retrieve a Proxy client for the service, searching for the service in configuration using the ordered list of names<T> T
Get a client for the provided interface, building it from the provided WebTargetjavax.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
Retrieve a WebTarget for the service, searching for the service in configuration using the ordered list of names- Parameters:
names
-- Returns:
-
getWebTarget
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.) fromnames
-- Returns:
-
getClient
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 ifacenames
-- Returns:
-
getClient
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
Get a client for the provided interface, building it from the provided WebTarget- Type Parameters:
T
-- Parameters:
iface
- the service ifacetarget
- 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
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 interfaceendpoint
- a valid URI to use as a base point for the provided service interface- Returns:
- a dynamic proxy for the service
-
createClient
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 interfaceendpoint
- a valid URI to use as a base point for the provided service interfacepreemptiveAuth
- if true, enable pre-emptive basic authentication- Returns:
- a dynamic proxy for the service
-
createClient
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 interfaceendpoint
- a valid URI to use as a base point for the provided service interface- Returns:
- a dynamic proxy for the service
- Throws:
IllegalArgumentException
- ifendpoint
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 interfaceendpoint
- a valid URI to use as a base point for the provided service interfaceusername
- the username to usepassword
- the password to use- Returns:
- a dynamic proxy for the service
- Throws:
IllegalArgumentException
- ifendpoint
cannot be parsed as a valid URI
-
createClientWithBearerAuth
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 interfaceendpoint
- a valid URI to use as a base point for the provided service interfacetoken
- a supplier that will be asked to provide a token for each HTTP call- Returns:
- a dynamic proxy for the service
- Throws:
IllegalArgumentException
- ifendpoint
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 interfaceendpoint
- a valid URI to use as a base point for the provided service interfaceusername
- the username to usepassword
- the password to usepreemptiveAuth
- if true then pre-emptive basic authentication will be used if credentials are also supplied- Returns:
- a dynamic proxy for the service
- Throws:
IllegalArgumentException
- ifendpoint
cannot be parsed as a valid URI
-