public class RestClient extends Object implements AutoCloseable
A REST client that can make synchronous and asynchronous calls.
For asynchronous call, please refer to https://dennis-xlc.gitbooks.io/restful-java-with-jax-rs-2-0-2rd-edition/en/part1/chapter13/async_invoker_client_api.html
to understand why we’d better not mix to using callback or Java Future.
| Constructor and Description |
|---|
RestClient(javax.ws.rs.client.Client client,
EntityFactory entityFactory,
JaxRsCircuitBreaker circuitBreaker)
Create a new client that uses a provided client to make all its requests.
|
RestClient(javax.ws.rs.client.Client client,
EntityFactory entityFactory,
JaxRsCircuitBreaker circuitBreaker,
boolean isApacheNonBufferingClient)
Create a new client that uses a provided client to make all its requests.
|
RestClient(javax.ws.rs.client.Client client,
EntityFactory entityFactory,
JaxRsCircuitBreaker circuitBreaker,
boolean isApacheNonBufferingClient,
ClientConfigurator clientConfigurator)
Create a new client that uses a provided client to make all its requests.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<T extends BmcRequest> |
delete(WrappedInvocationBuilder ib,
T request)
Execute a delete on a resource and get the response.
|
<T extends BmcRequest> |
delete(WrappedInvocationBuilder ib,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Execute a delete on a resource asynchronously and get the response.
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
deleteFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the delete request and returns the future. |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
deleteFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use the method without Guava parameters instead
|
<T extends BmcRequest> |
get(WrappedInvocationBuilder ib,
T request)
Request a resource.
|
<T extends BmcRequest> |
get(WrappedInvocationBuilder ib,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Request a resource asynchronously.
|
WrappedWebTarget |
getBaseTarget()
Gets the target (endpoint) for this client.
|
JaxRsCircuitBreaker |
getCircuitBreaker()
Gets the underlying circuitBreaker implementation for this client
|
ClientConfigurator |
getClientConfigurator()
The client configurator used for configuring the client.
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
getFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the get request and returns the future. |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
getFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
Use the method without Guava parameters instead
|
String |
getRequestUri()
Gets the requestURI for this client.
|
<T extends BmcRequest> |
head(WrappedInvocationBuilder ib,
T request)
Execute a head request for a resource and return the response.
|
<T extends BmcRequest> |
head(WrappedInvocationBuilder ib,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Execute a head request for a resource asynchronously and return the
response.
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
headFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the head request and returns the future. |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
headFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use method without Guava parameters instead
|
<T extends BmcRequest> |
patch(WrappedInvocationBuilder ib,
Object body,
T request)
Patch a request object to the endpoint represented by the web target and
get the response.
|
<T extends BmcRequest> |
patch(WrappedInvocationBuilder ib,
Object body,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Patch a request object to the endpoint represented by the web target
asynchronously and get the response.
|
<T extends BmcRequest> |
patch(WrappedInvocationBuilder ib,
T request)
Patch a request object without body to the endpoint represented by the web target and
get the response.
|
<T extends BmcRequest> |
patch(WrappedInvocationBuilder ib,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Patch a request object without body to the endpoint represented by the web target
asynchronously and get the response.
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
patchFutureSupplier(REQUEST interceptedRequest,
Object body,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the patch request and returns the future |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
patchFutureSupplier(REQUEST interceptedRequest,
Object body,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use method without Guava parameters instead
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
patchFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the patch request and returns the future |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
patchFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use method without Guava parameters instead
|
<T extends BmcRequest> |
post(WrappedInvocationBuilder ib,
Object body,
T request)
Post a request object to the endpoint represented by the web target and
get the response.
|
<T extends BmcRequest> |
post(WrappedInvocationBuilder ib,
Object body,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Post a request object to the endpoint represented by the web target
asynchronously and get the response.
|
<T extends BmcRequest> |
post(WrappedInvocationBuilder ib,
T request)
Post an empty body to the endpoint represented by the web target and get
the response.
|
<T extends BmcRequest> |
post(WrappedInvocationBuilder ib,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Post an empty body to the endpoint represented by the web target
asynchronously and get the response.
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
postFutureSupplier(REQUEST interceptedRequest,
Object body,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the post request and returns
the future |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
postFutureSupplier(REQUEST interceptedRequest,
Object body,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use the method without Guava parameters instead
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
postFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the post request and returns the future |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
postFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use method without GUava parameters instead
|
<T extends BmcRequest> |
put(WrappedInvocationBuilder ib,
Object body,
T request)
Put a request object to the endpoint represented by the web target and
get the response.
|
<T extends BmcRequest> |
put(WrappedInvocationBuilder ib,
Object body,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Put a request object to the endpoint represented by the web target
asynchronously and get the response.
|
<T extends BmcRequest> |
put(WrappedInvocationBuilder ib,
T request)
Put a request object without body to the endpoint represented by the web target and
get the response.
|
<T extends BmcRequest> |
put(WrappedInvocationBuilder ib,
T request,
Consumer<javax.ws.rs.core.Response> onSuccess,
Consumer<Throwable> onError)
Put a request object without body to the endpoint represented by the web target
asynchronously and get the response.
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
putFutureSupplier(REQUEST interceptedRequest,
Object body,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the put request and returns the future |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
putFutureSupplier(REQUEST interceptedRequest,
Object body,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use the method without Guava parameters instead
|
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
putFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an
AsyncHandler, makes the put request and returns the future |
<B,REQUEST extends BmcRequest<B>,RESPONSE> |
putFutureSupplier(REQUEST interceptedRequest,
WrappedInvocationBuilder ib,
com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Deprecated.
use the method without Guava parameters instead
|
void |
setEndpoint(String endpoint)
Sets the endpoint that this client should talk to.
|
void |
setRequestUri(String requestUri)
Sets the requestURI for this client.
|
public RestClient(@Nonnull javax.ws.rs.client.Client client, @Nonnull EntityFactory entityFactory, JaxRsCircuitBreaker circuitBreaker)
Create a new client that uses a provided client to make all its requests. It’s up to the caller to properly configure the client.
client - A HTTP client to make all requests with.entityFactory - An entity factory to create entities for POST/PUT operations.circuitBreaker - A circuit breaker instance to decorate http clientpublic RestClient(@Nonnull javax.ws.rs.client.Client client, @Nonnull EntityFactory entityFactory, JaxRsCircuitBreaker circuitBreaker, boolean isApacheNonBufferingClient)
Create a new client that uses a provided client to make all its requests. It’s up to the caller to properly configure the client.
client - A HTTP client to make all requests with.entityFactory - An entity factory to create entities for POST/PUT operations.circuitBreaker - A circuit breaker instance to decorate http clientisApacheNonBufferingClient - A boolean value to disable buffering of entities in memory for Apache clientpublic RestClient(@Nonnull javax.ws.rs.client.Client client, @Nonnull EntityFactory entityFactory, JaxRsCircuitBreaker circuitBreaker, boolean isApacheNonBufferingClient, ClientConfigurator clientConfigurator)
Create a new client that uses a provided client to make all its requests. It’s up to the caller to properly configure the client.
client - A HTTP client to make all requests with.entityFactory - An entity factory to create entities for POST/PUT operations.circuitBreaker - A circuit breaker instance to decorate http clientisApacheNonBufferingClient - A boolean value to disable buffering of entities in memory for Apache clientclientConfigurator - The client configurator used when creating the clientpublic void setEndpoint(@Nonnull String endpoint)
Sets the endpoint that this client should talk to.
endpoint - The endpoint.public void close()
close in interface AutoCloseablepublic WrappedWebTarget getBaseTarget()
Gets the target (endpoint) for this client.
public String getRequestUri()
Gets the requestURI for this client.
public void setRequestUri(@Nonnull String requestUri)
Sets the requestURI for this client.
public JaxRsCircuitBreaker getCircuitBreaker()
Gets the underlying circuitBreaker implementation for this client
public <T extends BmcRequest> javax.ws.rs.core.Response get(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request) throws BmcException
Request a resource.
ib - The invocation builder to use when making the request.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> get(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Request a resource asynchronously.
ib - The invocation builder to use when making the request.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> getFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the get request and returns the future.
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> getFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the get request and returns the future.
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <T extends BmcRequest> javax.ws.rs.core.Response post(@Nonnull WrappedInvocationBuilder ib, @Nullable Object body, @Nonnull T request) throws BmcException
Post a request object to the endpoint represented by the web target and get the response.
ib - An invocation builder to execute requests with.body - The content body to post to the web target.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> post(@Nonnull WrappedInvocationBuilder ib, @Nullable Object body, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Post a request object to the endpoint represented by the web target asynchronously and get the response.
ib - An invocation builder to execute requests with.body - The content body to post to the web target.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> postFutureSupplier(REQUEST interceptedRequest, Object body, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the post request and returns
the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestbody - the body of the requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> postFutureSupplier(REQUEST interceptedRequest, Object body, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the post request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestbody - the body of the requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> postFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the post request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> postFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the post request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <T extends BmcRequest> javax.ws.rs.core.Response post(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request)
Post an empty body to the endpoint represented by the web target and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> post(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Post an empty body to the endpoint represented by the web target asynchronously and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <T extends BmcRequest> javax.ws.rs.core.Response patch(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request)
Patch a request object without body to the endpoint represented by the web target and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> javax.ws.rs.core.Response patch(@Nonnull WrappedInvocationBuilder ib, @Nullable Object body, @Nonnull T request) throws BmcException
Patch a request object to the endpoint represented by the web target and get the response.
ib - An invocation builder to execute requests with.body - The content body to post to the web target.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> patch(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Patch a request object without body to the endpoint represented by the web target asynchronously and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> patch(@Nonnull WrappedInvocationBuilder ib, @Nullable Object body, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Patch a request object to the endpoint represented by the web target asynchronously and get the response.
ib - An invocation builder to execute requests with.body - The content body object to post to the web target.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> patchFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the patch request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> patchFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the patch request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> patchFutureSupplier(REQUEST interceptedRequest, Object body, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the patch request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestbody - the body of the requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> patchFutureSupplier(REQUEST interceptedRequest, Object body, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the patch request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestbody - the body of the requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <T extends BmcRequest> javax.ws.rs.core.Response put(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request)
Put a request object without body to the endpoint represented by the web target and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> javax.ws.rs.core.Response put(@Nonnull WrappedInvocationBuilder ib, @Nullable Object body, @Nonnull T request) throws BmcException
Put a request object to the endpoint represented by the web target and get the response.
ib - An invocation builder to execute requests with.body - The content body to post to the web target.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> put(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Put a request object without body to the endpoint represented by the web target asynchronously and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> put(@Nonnull WrappedInvocationBuilder ib, @Nullable Object body, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Put a request object to the endpoint represented by the web target asynchronously and get the response.
ib - An invocation builder to execute requests with.body - The content body to post to the web target.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> putFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the put request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> putFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the put request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> putFutureSupplier(REQUEST interceptedRequest, Object body, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the put request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestbody - the body of the requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> putFutureSupplier(REQUEST interceptedRequest, Object body, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the put request and returns the future
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestbody - the body of the requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <T extends BmcRequest> javax.ws.rs.core.Response delete(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request) throws BmcException
Execute a delete on a resource and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> delete(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Execute a delete on a resource asynchronously and get the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> deleteFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the delete request and returns the future.
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> deleteFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the delete request and returns the future.
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic <T extends BmcRequest> javax.ws.rs.core.Response head(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request) throws BmcException
Execute a head request for a resource and return the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.Response object.BmcException - If an error was encountered while invoking the request.public <T extends BmcRequest> Future<javax.ws.rs.core.Response> head(@Nonnull WrappedInvocationBuilder ib, @Nonnull T request, @Nullable Consumer<javax.ws.rs.core.Response> onSuccess, @Nullable Consumer<Throwable> onError)
Execute a head request for a resource asynchronously and return the response.
ib - An invocation builder to execute requests with.request - The original client request object given to the service
client.onSuccess - The callback to invoke on success.onError - The callback to invoke on failure.public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> headFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the head request and returns the future.
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model response@Deprecated public <B,REQUEST extends BmcRequest<B>,RESPONSE> Function<AsyncHandler<REQUEST,RESPONSE>,Future<RESPONSE>> headFutureSupplier(REQUEST interceptedRequest, WrappedInvocationBuilder ib, com.google.common.base.Function<javax.ws.rs.core.Response,RESPONSE> transformer)
Return the function that, given an AsyncHandler, makes the head request and returns the future.
B - type of the bodyREQUEST - type of the requestRESPONSE - type of the responseinterceptedRequest - intercepted requestib - invocation buildertransformer - transformer from JAX-RS response to model responsepublic ClientConfigurator getClientConfigurator()
The client configurator used for configuring the client. May be null.
Copyright © 2016–2022. All rights reserved.