Package javax.ws.rs.client
Interface RxInvoker<T>
-
- Type Parameters:
T
- a type representing the asynchronous computation.
- All Known Subinterfaces:
CompletionStageRxInvoker
public interface RxInvoker<T>
Uniform interface for reactive invocation of HTTP methods. All reactive invokers must implement this interface. The type parameterT
represents the Java type of an asynchronous computation. All API implementations MUST support the default reactive invoker based onCompletionStage
.- Since:
- 2.1
- Author:
- Marek Potociar, Santiago Pericas-Geertsen
- See Also:
CompletionStageRxInvoker
-
-
Method Summary
Modifier and Type Method Description T
delete()
Invoke HTTP DELETE method for the current request.<R> T
delete(Class<R> responseType)
Invoke HTTP DELETE method for the current request.<R> T
delete(GenericType<R> responseType)
Invoke HTTP DELETE method for the current request.T
get()
Invoke HTTP GET method for the current request.<R> T
get(Class<R> responseType)
Invoke HTTP GET method for the current request.<R> T
get(GenericType<R> responseType)
Invoke HTTP GET method for the current request.T
head()
Invoke HTTP HEAD method for the current request.T
method(String name)
Invoke an arbitrary method for the current request.<R> T
method(String name, Class<R> responseType)
Invoke an arbitrary method for the current request.T
method(String name, Entity<?> entity)
Invoke an arbitrary method for the current request.<R> T
method(String name, Entity<?> entity, Class<R> responseType)
Invoke an arbitrary method for the current request.<R> T
method(String name, Entity<?> entity, GenericType<R> responseType)
Invoke an arbitrary method for the current request.<R> T
method(String name, GenericType<R> responseType)
Invoke an arbitrary method for the current request.T
options()
Invoke HTTP OPTIONS method for the current request.<R> T
options(Class<R> responseType)
Invoke HTTP OPTIONS method for the current request.<R> T
options(GenericType<R> responseType)
Invoke HTTP OPTIONS method for the current request.T
post(Entity<?> entity)
Invoke HTTP POST method for the current request.<R> T
post(Entity<?> entity, Class<R> responseType)
Invoke HTTP POST method for the current request.<R> T
post(Entity<?> entity, GenericType<R> responseType)
Invoke HTTP POST method for the current request.T
put(Entity<?> entity)
Invoke HTTP PUT method for the current request.<R> T
put(Entity<?> entity, Class<R> responseType)
Invoke HTTP PUT method for the current request.<R> T
put(Entity<?> entity, GenericType<R> responseType)
Invoke HTTP PUT method for the current request.T
trace()
Invoke HTTP TRACE method for the current request.<R> T
trace(Class<R> responseType)
Invoke HTTP TRACE method for the current request.<R> T
trace(GenericType<R> responseType)
Invoke HTTP TRACE method for the current request.
-
-
-
Method Detail
-
get
T get()
Invoke HTTP GET method for the current request.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
get
<R> T get(Class<R> responseType)
Invoke HTTP GET method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
get
<R> T get(GenericType<R> responseType)
Invoke HTTP GET method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
put
T put(Entity<?> entity)
Invoke HTTP PUT method for the current request.- Parameters:
entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-Encoding
) will be overwritten using the entity variant information.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
put
<R> T put(Entity<?> entity, Class<R> responseType)
Invoke HTTP PUT method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-Encoding
) will be overwritten using the entity variant information.responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
put
<R> T put(Entity<?> entity, GenericType<R> responseType)
Invoke HTTP PUT method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-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 wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
post
T post(Entity<?> entity)
Invoke HTTP POST method for the current request.- Parameters:
entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-Encoding
) will be overwritten using the entity variant information.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
post
<R> T post(Entity<?> entity, Class<R> responseType)
Invoke HTTP POST method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-Encoding
) will be overwritten using the entity variant information.responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
post
<R> T post(Entity<?> entity, GenericType<R> responseType)
Invoke HTTP POST method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-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 wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
delete
T delete()
Invoke HTTP DELETE method for the current request.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
delete
<R> T delete(Class<R> responseType)
Invoke HTTP DELETE method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
delete
<R> T delete(GenericType<R> responseType)
Invoke HTTP DELETE method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
head
T head()
Invoke HTTP HEAD method for the current request.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
options
T options()
Invoke HTTP OPTIONS method for the current request.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
options
<R> T options(Class<R> responseType)
Invoke HTTP OPTIONS method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
options
<R> T options(GenericType<R> responseType)
Invoke HTTP OPTIONS method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
trace
T trace()
Invoke HTTP TRACE method for the current request.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
trace
<R> T trace(Class<R> responseType)
Invoke HTTP TRACE method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
trace
<R> T trace(GenericType<R> responseType)
Invoke HTTP TRACE method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type.
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
method
T method(String name)
Invoke an arbitrary method for the current request.- Parameters:
name
- method name.- Returns:
- invocation response wrapped in the completion aware type..
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
method
<R> T method(String name, Class<R> responseType)
Invoke an arbitrary method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
name
- method name.responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type..
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
method
<R> T method(String name, GenericType<R> responseType)
Invoke an arbitrary method for the current request.- Type Parameters:
R
- 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 wrapped in the completion aware type..
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
method
T method(String name, Entity<?> entity)
Invoke an arbitrary method for the current request.- Parameters:
name
- method name.entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-Encoding
) will be overwritten using the entity variant information.- Returns:
- invocation response wrapped in the completion aware type..
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.
-
method
<R> T method(String name, Entity<?> entity, Class<R> responseType)
Invoke an arbitrary method for the current request.- Type Parameters:
R
- response entity type.- Parameters:
name
- method name.entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-Encoding
) will be overwritten using the entity variant information.responseType
- Java type the response entity will be converted to.- Returns:
- invocation response wrapped in the completion aware type..
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
method
<R> T method(String name, Entity<?> entity, GenericType<R> responseType)
Invoke an arbitrary method for the current request.- Type Parameters:
R
- generic response entity type.- Parameters:
name
- method name.entity
- request entity, including it's fullVariant
information. Any variant-related HTTP headers previously set (namelyContent-Type
,Content-Language
andContent-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 wrapped in the completion aware type..
- Throws:
ResponseProcessingException
- in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).ProcessingException
- in case the request processing or subsequent I/O operation fails.WebApplicationException
- in case the response status code of the response returned by the server is notsuccessful
and the specified response type is notResponse
.
-
-