Package org.openremote.container.web
Class WebTargetBuilder
java.lang.Object
org.openremote.container.web.WebTargetBuilder
This is a factory for creating JAX-RS
WebTarget instances. The instances share a common
Client that uses a connection pool and has the following
ContextResolvers registered (additional filters etc. should be registered on the
WebTargetBuilder instances):
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URIprotected org.jboss.resteasy.client.jaxrs.BasicAuthenticationprotected org.jboss.resteasy.client.jaxrs.ResteasyClientstatic final longstatic final intstatic final longprotected static ExecutorServiceprotected booleanprotected org.openremote.model.auth.OAuthGrant -
Constructor Summary
ConstructorsConstructorDescriptionWebTargetBuilder(org.jboss.resteasy.client.jaxrs.ResteasyClient client, URI baseUri) -
Method Summary
Modifier and TypeMethodDescriptionaddPermanentFailureResponse(Integer... responseStatus) addPermanentFailureResponse(javax.ws.rs.core.Response.Status... responseStatus) If the specified status code is returned from the server then it will be treated as a permanent failure and the web authTarget will no longer be usable (any future requests will immediately return aResponse.Status.METHOD_NOT_ALLOWEDresponse without hitting the server.org.jboss.resteasy.client.jaxrs.ResteasyWebTargetbuild()static org.jboss.resteasy.client.jaxrs.ResteasyClientcreateClient(ExecutorService executorService) static org.jboss.resteasy.client.jaxrs.ResteasyClientcreateClient(ExecutorService executorService, int connectionPoolSize, long overrideSocketTimeout, UnaryOperator<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> builderConfigurator) followRedirects(boolean followRedirects) static <K,V, W extends V>
javax.ws.rs.core.MultivaluedMap<K,V> mapToMultivaluedMap(Map<K, List<W>> map, javax.ws.rs.core.MultivaluedMap<K, V> multivaluedMap) removePermanentFailureResponse(Integer... responseStatus) removePermanentFailureResponse(javax.ws.rs.core.Response.Status... responseStatus) setBasicAuthentication(String username, String password) Add Basic authentication to requests sent by thisWebTarget; this should not be used in conjunction with any other authentication.setInjectHeaders(Map<String, List<String>> injectHeaders) setInjectQueryParameters(Map<String, List<String>> injectQueryParameters) setOAuthAuthentication(org.openremote.model.auth.OAuthGrant oAuthGrant) Add OAuth authentication to requests sent by thisWebTarget; this should not be used in conjunction with any other authentication (note if basic authentication is also set then this OAuth authentication will take precedence).
-
Field Details
-
CONNECTION_POOL_SIZE
public static final int CONNECTION_POOL_SIZE- See Also:
-
CONNECTION_CHECKOUT_TIMEOUT_MILLISECONDS
public static final long CONNECTION_CHECKOUT_TIMEOUT_MILLISECONDS- See Also:
-
CONNECTION_TIMEOUT_MILLISECONDS
public static final long CONNECTION_TIMEOUT_MILLISECONDS- See Also:
-
client
protected org.jboss.resteasy.client.jaxrs.ResteasyClient client -
executorService
-
basicAuthentication
protected org.jboss.resteasy.client.jaxrs.BasicAuthentication basicAuthentication -
oAuthGrant
protected org.openremote.model.auth.OAuthGrant oAuthGrant -
baseUri
-
failureResponses
-
injectHeaders
-
injectQueryParameters
-
followRedirects
protected boolean followRedirects
-
-
Constructor Details
-
WebTargetBuilder
-
-
Method Details
-
setBasicAuthentication
Add Basic authentication to requests sent by thisWebTarget; this should not be used in conjunction with any other authentication. -
setOAuthAuthentication
Add OAuth authentication to requests sent by thisWebTarget; this should not be used in conjunction with any other authentication (note if basic authentication is also set then this OAuth authentication will take precedence). -
setInjectHeaders
-
setInjectQueryParameters
-
addPermanentFailureResponse
public WebTargetBuilder addPermanentFailureResponse(javax.ws.rs.core.Response.Status... responseStatus) If the specified status code is returned from the server then it will be treated as a permanent failure and the web authTarget will no longer be usable (any future requests will immediately return aResponse.Status.METHOD_NOT_ALLOWEDresponse without hitting the server.NOTE: Any response in 200 range will always be treated as successful.
-
addPermanentFailureResponse
-
removePermanentFailureResponse
public WebTargetBuilder removePermanentFailureResponse(javax.ws.rs.core.Response.Status... responseStatus) -
removePermanentFailureResponse
-
followRedirects
-
build
public org.jboss.resteasy.client.jaxrs.ResteasyWebTarget build() -
createClient
public static org.jboss.resteasy.client.jaxrs.ResteasyClient createClient(ExecutorService executorService) -
createClient
public static org.jboss.resteasy.client.jaxrs.ResteasyClient createClient(ExecutorService executorService, int connectionPoolSize, long overrideSocketTimeout, UnaryOperator<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> builderConfigurator) -
mapToMultivaluedMap
-