Class JerseyCompletionStageRxInvoker
- java.lang.Object
-
- org.glassfish.jersey.client.JerseyCompletionStageRxInvoker
-
- All Implemented Interfaces:
AsyncInvoker,CompletionStageRxInvoker,RxInvoker<CompletionStage>
public class JerseyCompletionStageRxInvoker extends Object implements CompletionStageRxInvoker
Implementation of Reactive Invoker forCompletionStage. This class allows for usingInvocationCallbackinInvocation.Builder.rx(JerseyCompletionStageRxInvoker.class)requests.- Since:
- 2.26
- Author:
- Michal Gajdos
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdelete()<R> CompletableFuture<R>delete(InvocationCallback<R> callback)Invoke HTTP DELETE method for the current request asynchronously.<R> Tdelete(GenericType<R> responseType)<R> Tdelete(Class<R> responseType)Tget()<R> CompletableFuture<R>get(InvocationCallback<R> callback)Invoke HTTP GET method for the current request asynchronously.<R> Tget(GenericType<R> responseType)<R> Tget(Class<R> responseType)Thead()CompletableFuture<Response>head(InvocationCallback<Response> callback)Invoke HTTP HEAD method for the current request asynchronously.CompletableFuture<Response>method(String name)Invoke an arbitrary method for the current request asynchronously.CompletableFuture<Response>method(String name, Entity<?> entity)Invoke an arbitrary method for the current request asynchronously.<T> CompletableFuture<T>method(String name, Entity<?> entity, InvocationCallback<T> callback)Invoke an arbitrary method for the current request asynchronously.<T> CompletableFuture<T>method(String name, Entity<?> entity, GenericType<T> responseType)Invoke an arbitrary method for the current request asynchronously.<T> CompletableFuture<T>method(String name, Entity<?> entity, Class<T> responseType)Invoke an arbitrary method for the current request asynchronously.<T> CompletableFuture<T>method(String name, InvocationCallback<T> callback)Invoke an arbitrary method for the current request asynchronously.<T> CompletableFuture<T>method(String name, GenericType<T> responseType)Invoke an arbitrary method for the current request asynchronously.<T> CompletableFuture<T>method(String name, Class<T> responseType)Invoke an arbitrary method for the current request asynchronously.Toptions()<R> CompletableFuture<R>options(InvocationCallback<R> callback)Invoke HTTP OPTIONS method for the current request asynchronously.<R> Toptions(GenericType<R> responseType)<R> Toptions(Class<R> responseType)Tpost(Entity<?> entity)<R> CompletableFuture<R>post(Entity<?> entity, InvocationCallback<R> callback)Invoke HTTP POST method for the current request asynchronously.<R> Tpost(Entity<?> entity, GenericType<R> type)<R> Tpost(Entity<?> entity, Class<R> clazz)Tput(Entity<?> entity)<R> CompletableFuture<R>put(Entity<?> entity, InvocationCallback<R> callback)Invoke HTTP PUT method for the current request asynchronously.<R> Tput(Entity<?> entity, GenericType<R> type)<R> Tput(Entity<?> entity, Class<R> clazz)Ttrace()<R> CompletableFuture<R>trace(InvocationCallback<R> callback)Invoke HTTP TRACE method for the current request asynchronously.<R> Ttrace(GenericType<R> responseType)<R> Ttrace(Class<R> responseType)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
method
public CompletableFuture<Response> method(String name)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps aProcessingExceptionthrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Parameters:
name- method name.- Returns:
- invocation response
future.
-
method
public <T> CompletableFuture<T> method(String name, Class<T> responseType)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the specified response type is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Type Parameters:
T- response entity type.- Parameters:
name- method name.responseType- Java type the response entity will be converted to.- Returns:
- invocation response
future.
-
method
public <T> CompletableFuture<T> method(String name, GenericType<T> responseType)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the specified response type is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
name- method name.responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response
future.
-
method
public <T> CompletableFuture<T> method(String name, InvocationCallback<T> callback)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
name- method name.callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
method
public CompletableFuture<Response> method(String name, Entity<?> entity)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps aProcessingExceptionthrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation response
future.
-
method
public <T> CompletableFuture<T> method(String name, Entity<?> entity, Class<T> responseType)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the specified response type is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Type Parameters:
T- response entity type.- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- Java type the response entity will be converted to.- Returns:
- invocation response
future.
-
method
public <T> CompletableFuture<T> method(String name, Entity<?> entity, GenericType<T> responseType)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the specified response type is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response
future.
-
method
public <T> CompletableFuture<T> method(String name, Entity<?> entity, InvocationCallback<T> callback)
Description copied from interface:AsyncInvokerInvoke an arbitrary method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
methodin interfaceAsyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
get
public <R> CompletableFuture<R> get(InvocationCallback<R> callback)
Description copied from interface:AsyncInvokerInvoke HTTP GET method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
getin interfaceAsyncInvoker- Type Parameters:
R- generic response entity type.- Parameters:
callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
put
public <R> CompletableFuture<R> put(Entity<?> entity, InvocationCallback<R> callback)
Description copied from interface:AsyncInvokerInvoke HTTP PUT method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
putin interfaceAsyncInvoker- Type Parameters:
R- generic response entity type.- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
post
public <R> CompletableFuture<R> post(Entity<?> entity, InvocationCallback<R> callback)
Description copied from interface:AsyncInvokerInvoke HTTP POST method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
postin interfaceAsyncInvoker- Type Parameters:
R- generic response entity type.- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
delete
public <R> CompletableFuture<R> delete(InvocationCallback<R> callback)
Description copied from interface:AsyncInvokerInvoke HTTP DELETE method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
deletein interfaceAsyncInvoker- Type Parameters:
R- generic response entity type.- Parameters:
callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
head
public CompletableFuture<Response> head(InvocationCallback<Response> callback)
Description copied from interface:AsyncInvokerInvoke HTTP HEAD method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps aProcessingExceptionthrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
headin interfaceAsyncInvoker- Parameters:
callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
options
public <R> CompletableFuture<R> options(InvocationCallback<R> callback)
Description copied from interface:AsyncInvokerInvoke HTTP OPTIONS method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
optionsin interfaceAsyncInvoker- Type Parameters:
R- generic response entity type.- Parameters:
callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
trace
public <R> CompletableFuture<R> trace(InvocationCallback<R> callback)
Description copied from interface:AsyncInvokerInvoke HTTP TRACE method for the current request asynchronously.Note that calling the
Future.get()method on the returnedFutureinstance may throw anExecutionExceptionthat wraps either aProcessingExceptionthrown in case of an invocation processing failure or aWebApplicationExceptionor one of its subclasses thrown in case the received response status code is notsuccessfuland the generic type of the supplied response callback is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed.- Specified by:
tracein interfaceAsyncInvoker- Type Parameters:
R- generic response entity type.- Parameters:
callback- asynchronous invocation callback.- Returns:
- invocation response
future.
-
get
public T get()
-
get
public <R> T get(GenericType<R> responseType)
-
put
public <R> T put(Entity<?> entity, GenericType<R> type)
-
post
public <R> T post(Entity<?> entity, GenericType<R> type)
-
delete
public T delete()
-
delete
public <R> T delete(GenericType<R> responseType)
-
head
public T head()
-
options
public T options()
-
options
public <R> T options(GenericType<R> responseType)
-
trace
public T trace()
-
trace
public <R> T trace(GenericType<R> responseType)
-
-