Class ResteasyProxyClientFactoryImpl
java.lang.Object
com.peterphi.std.guice.restclient.resteasy.impl.ResteasyProxyClientFactoryImpl
- All Implemented Interfaces:
JAXRSProxyClientFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanstatic final StringA Bearer Token generator that generates Delegated Tokens for an OAuth2 user session when calling other services -
Constructor Summary
ConstructorsConstructorDescriptionResteasyProxyClientFactoryImpl(ResteasyClientFactoryImpl clientFactory, GuiceConfig config) -
Method Summary
Modifier and TypeMethodDescription<T> TcreateClient(Class<T> iface, String endpoint) Create a dynamic proxy client for the desired service, setting the base endpoint<T> TcreateClient(Class<T> iface, URI endpoint) Create a dynamic proxy client for the desired service, setting the base endpoint<T> TcreateClient(Class<T> iface, URI endpoint, boolean preemptiveAuth) Create a dynamic proxy client for the desired service, setting the base endpoint<T> TcreateClientWithBearerAuth(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> TcreateClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password) Deprecated.<T> TcreateClientWithPasswordAuth(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.ResteasyWebTargetcreateWebTarget(URI endpoint, String username, String password) Create a WebTarget for a fixed endpoint optionally with a given username and password<T> TGet a client for the provided interface, searching for the service in configuration using the default name(s)<T> TRetrieve a Proxy client for the service, searching for the service in configuration using the ordered list of names<T> TGet a client for the provided interface, building it from the provided WebTargetorg.jboss.resteasy.client.jaxrs.ResteasyWebTargetgetWebTarget(Class<?> iface, String... names) Retrieve a WebTarget, using the configuration for the named service interface (but not creating a dynamic proxy client)org.jboss.resteasy.client.jaxrs.ResteasyWebTargetgetWebTarget(String... names) Retrieve a WebTarget for the service, searching for the service in configuration using the ordered list of names
-
Field Details
-
OAUTH_DELEGATING_BEARER_GENERATOR
A Bearer Token generator that generates Delegated Tokens for an OAuth2 user session when calling other services- See Also:
-
defaultStoreCookies
@Inject(optional=true) public boolean defaultStoreCookies
-
-
Constructor Details
-
ResteasyProxyClientFactoryImpl
public ResteasyProxyClientFactoryImpl() -
ResteasyProxyClientFactoryImpl
-
-
Method Details
-
getWebTarget
Description copied from interface:JAXRSProxyClientFactoryRetrieve a WebTarget for the service, searching for the service in configuration using the ordered list of names- Specified by:
getWebTargetin interfaceJAXRSProxyClientFactory- Returns:
-
getWebTarget
public org.jboss.resteasy.client.jaxrs.ResteasyWebTarget getWebTarget(Class<?> iface, String... names) Description copied from interface:JAXRSProxyClientFactoryRetrieve a WebTarget, using the configuration for the named service interface (but not creating a dynamic proxy client)- Specified by:
getWebTargetin interfaceJAXRSProxyClientFactory- Parameters:
iface- the service interface to read configuration (endpoint, auth policy, etc.) from- Returns:
-
getClient
Description copied from interface:JAXRSProxyClientFactoryRetrieve a Proxy client for the service, searching for the service in configuration using the ordered list of names- Specified by:
getClientin interfaceJAXRSProxyClientFactory- Parameters:
iface- the service iface- Returns:
-
getClient
Description copied from interface:JAXRSProxyClientFactoryGet a client for the provided interface, searching for the service in configuration using the default name(s)- Specified by:
getClientin interfaceJAXRSProxyClientFactory- Parameters:
iface- the service iface- Returns:
-
getClient
Description copied from interface:JAXRSProxyClientFactoryGet a client for the provided interface, building it from the provided WebTarget- Specified by:
getClientin interfaceJAXRSProxyClientFactory- Parameters:
iface- the service ifacetarget- the WebTarget to use to build the dynamic proxy client- Returns:
-
createWebTarget
public org.jboss.resteasy.client.jaxrs.ResteasyWebTarget createWebTarget(URI endpoint, String username, String password) Description copied from interface:JAXRSProxyClientFactoryCreate a WebTarget for a fixed endpoint optionally with a given username and password- Specified by:
createWebTargetin interfaceJAXRSProxyClientFactory- Returns:
-
createClient
Description copied from interface:JAXRSProxyClientFactoryCreate a dynamic proxy client for the desired service, setting the base endpoint- Specified by:
createClientin interfaceJAXRSProxyClientFactory- 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
Description copied from interface:JAXRSProxyClientFactoryCreate a dynamic proxy client for the desired service, setting the base endpoint- Specified by:
createClientin interfaceJAXRSProxyClientFactory- 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
Description copied from interface:JAXRSProxyClientFactoryCreate a dynamic proxy client for the desired service, setting the base endpoint- Specified by:
createClientin interfaceJAXRSProxyClientFactory- 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
-
createClientWithPasswordAuth
@Deprecated public <T> T createClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password) Deprecated.Description copied from interface:JAXRSProxyClientFactoryCreate a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth- Specified by:
createClientWithPasswordAuthin interfaceJAXRSProxyClientFactory- 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
-
createClientWithBearerAuth
Description copied from interface:JAXRSProxyClientFactoryCreate a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth- Specified by:
createClientWithBearerAuthin interfaceJAXRSProxyClientFactory- 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
-
createClientWithPasswordAuth
public <T> T createClientWithPasswordAuth(Class<T> iface, URI endpoint, String username, String password, boolean preemptiveAuth) Description copied from interface:JAXRSProxyClientFactoryCreate a dynamic proxy client for the desired service, setting the base endpoint & setting up HTTP Basic auth- Specified by:
createClientWithPasswordAuthin interfaceJAXRSProxyClientFactory- 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
-