-
- All Known Subinterfaces:
- Invocation.Builder
public interface SyncInvoker
Uniform interface for synchronous invocation of HTTP methods.- Since:
- 2.0
- Author:
- Marek Potociar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Response
delete()
Invoke HTTP DELETE method for the current request synchronously.<T> T
delete(Class<T> responseType)
Invoke HTTP DELETE method for the current request synchronously.<T> T
delete(GenericType<T> responseType)
Invoke HTTP DELETE method for the current request synchronously.Response
get()
Invoke HTTP GET method for the current request synchronously.<T> T
get(Class<T> responseType)
Invoke HTTP GET method for the current request synchronously.<T> T
get(GenericType<T> responseType)
Invoke HTTP GET method for the current request synchronously.Response
head()
Invoke HTTP HEAD method for the current request synchronously.Response
method(String name)
Invoke an arbitrary method for the current request synchronously.<T> T
method(String name, Class<T> responseType)
Invoke an arbitrary method for the current request synchronously.Response
method(String name, Entity<?> entity)
Invoke an arbitrary method for the current request synchronously.<T> T
method(String name, Entity<?> entity, Class<T> responseType)
Invoke an arbitrary method for the current request synchronously.<T> T
method(String name, Entity<?> entity, GenericType<T> responseType)
Invoke an arbitrary method for the current request synchronously.<T> T
method(String name, GenericType<T> responseType)
Invoke an arbitrary method for the current request synchronously.Response
options()
Invoke HTTP OPTIONS method for the current request synchronously.<T> T
options(Class<T> responseType)
Invoke HTTP OPTIONS method for the current request synchronously.<T> T
options(GenericType<T> responseType)
Invoke HTTP OPTIONS method for the current request synchronously.Response
post(Entity<?> entity)
Invoke HTTP POST method for the current request synchronously.<T> T
post(Entity<?> entity, Class<T> responseType)
Invoke HTTP POST method for the current request synchronously.<T> T
post(Entity<?> entity, GenericType<T> responseType)
Invoke HTTP POST method for the current request synchronously.Response
put(Entity<?> entity)
Invoke HTTP PUT method for the current request synchronously.<T> T
put(Entity<?> entity, Class<T> responseType)
Invoke HTTP PUT method for the current request synchronously.<T> T
put(Entity<?> entity, GenericType<T> responseType)
Invoke HTTP PUT method for the current request synchronously.Response
trace()
Invoke HTTP TRACE method for the current request synchronously.<T> T
trace(Class<T> responseType)
Invoke HTTP TRACE method for the current request synchronously.<T> T
trace(GenericType<T> responseType)
Invoke HTTP TRACE method for the current request synchronously.
-
-
-
Method Detail
-
get
Response get()
Invoke HTTP GET method for the current request synchronously.- Returns:
- invocation response.
- Throws:
ProcessingException
- in case the invocation processing has failed.
-
get
<T> T get(Class<T> responseType)
Invoke HTTP GET method for the current request synchronously.- Type Parameters:
T
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response.
- 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
<T> T get(GenericType<T> responseType)
Invoke HTTP GET method for the current request synchronously.- Type Parameters:
T
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
- 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 generic response type does not representResponse
-
put
Response put(Entity<?> entity)
Invoke HTTP PUT method for the current request synchronously.- 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.
- 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
<T> T put(Entity<?> entity, Class<T> responseType)
Invoke HTTP PUT method for the current request synchronously.- Type Parameters:
T
- 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.
- 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> T put(Entity<?> entity, GenericType<T> responseType)
Invoke HTTP PUT method for the current request synchronously.- Type Parameters:
T
- 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.
- 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 generic response type does not representResponse
.
-
post
Response post(Entity<?> entity)
Invoke HTTP POST method for the current request synchronously.- 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.
- 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
<T> T post(Entity<?> entity, Class<T> responseType)
Invoke HTTP POST method for the current request synchronously.- Type Parameters:
T
- 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.
- 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> T post(Entity<?> entity, GenericType<T> responseType)
Invoke HTTP POST method for the current request synchronously.- Type Parameters:
T
- 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.
- 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 generic response type does not representResponse
.
-
delete
Response delete()
Invoke HTTP DELETE method for the current request synchronously.- Returns:
- invocation response.
- 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
<T> T delete(Class<T> responseType)
Invoke HTTP DELETE method for the current request synchronously.- Type Parameters:
T
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response.
- 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> T delete(GenericType<T> responseType)
Invoke HTTP DELETE method for the current request synchronously.- Type Parameters:
T
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
- 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 generic response type does not representResponse
.
-
head
Response head()
Invoke HTTP HEAD method for the current request synchronously.- Returns:
- invocation response.
- 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
Response options()
Invoke HTTP OPTIONS method for the current request synchronously.- Returns:
- invocation response.
- 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> T options(Class<T> responseType)
Invoke HTTP OPTIONS method for the current request synchronously.- Type Parameters:
T
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response.
- 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
<T> T options(GenericType<T> responseType)
Invoke HTTP OPTIONS method for the current request synchronously.- Type Parameters:
T
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
- 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 generic response type does not representResponse
.
-
trace
Response trace()
Invoke HTTP TRACE method for the current request synchronously.- Returns:
- invocation response.
- 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
<T> T trace(Class<T> responseType)
Invoke HTTP TRACE method for the current request synchronously.- Type Parameters:
T
- response entity type.- Parameters:
responseType
- Java type the response entity will be converted to.- Returns:
- invocation response.
- 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> T trace(GenericType<T> responseType)
Invoke HTTP TRACE method for the current request synchronously.- Type Parameters:
T
- generic response entity type.- Parameters:
responseType
- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
- 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 generic response type does not representResponse
.
-
method
Response method(String name)
Invoke an arbitrary method for the current request synchronously.- Parameters:
name
- method name.- Returns:
- invocation response.
- 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
<T> T method(String name, Class<T> responseType)
Invoke an arbitrary method for the current request synchronously.- Type Parameters:
T
- response entity type.- Parameters:
name
- method name.responseType
- Java type the response entity will be converted to.- Returns:
- invocation response.
- 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> T method(String name, GenericType<T> responseType)
Invoke an arbitrary method for the current request synchronously.- 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.
- 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 generic response type does not representResponse
.
-
method
Response method(String name, Entity<?> entity)
Invoke an arbitrary method for the current request synchronously.- 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.
- 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
<T> T method(String name, Entity<?> entity, Class<T> responseType)
Invoke an arbitrary method for the current request synchronously.- Type Parameters:
T
- 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.
- 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> T method(String name, Entity<?> entity, GenericType<T> responseType)
Invoke an arbitrary method for the current request synchronously.- Type Parameters:
T
- 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.
- 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 generic response type does not representResponse
.
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ws/rs/client/syncinvoker.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.