Top Description Methods
javax.ws.rs.client

public Interface SyncInvoker

Known Direct Subinterfaces
javax.ws.rs.client.Invocation.Builder
Imports
javax.ws.rs.ProcessingException, .WebApplicationException, javax.ws.rs.core.GenericType, .Response

Uniform interface for synchronous invocation of HTTP methods.
Author
Marek Potociar
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public Response

Returns:

invocation response.
delete
()

Invoke HTTP DELETE method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
delete
(Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke HTTP DELETE method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
delete
(GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke HTTP DELETE method for the current request synchronously.

public Response

Returns:

invocation response.
get
()

Invoke HTTP GET method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
get
(Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke HTTP GET method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
get
(GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke HTTP GET method for the current request synchronously.

public Response

Returns:

invocation response.
head
()

Invoke HTTP HEAD method for the current request synchronously.

public Response

Returns:

invocation response.
method
(String
method name.
name
)

Invoke an arbitrary method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
method
(String
method name.
name
,
Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke an arbitrary method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
method
(String
method name.
name
,
GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke an arbitrary method for the current request synchronously.

public Response

Returns:

invocation response.
method
(String
method name.
name
,
Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
)

Invoke an arbitrary method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
method
(String
method name.
name
,
Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
,
Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke an arbitrary method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
method
(String
method name.
name
,
Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
,
GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke an arbitrary method for the current request synchronously.

public Response

Returns:

invocation response.
options
()

Invoke HTTP OPTIONS method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
options
(Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke HTTP OPTIONS method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
options
(GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke HTTP OPTIONS method for the current request synchronously.

public Response

Returns:

invocation response.
post
(Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
)

Invoke HTTP POST method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
post
(Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
,
Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke HTTP POST method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
post
(Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
,
GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke HTTP POST method for the current request synchronously.

public Response

Returns:

invocation response.
put
(Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
)

Invoke HTTP PUT method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
put
(Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
,
Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke HTTP PUT method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
put
(Entity<?>
request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
entity
,
GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke HTTP PUT method for the current request synchronously.

public Response

Returns:

invocation response.
trace
()

Invoke HTTP TRACE method for the current request synchronously.

public <
response entity type.
T
>
T

Returns:

invocation response.
trace
(Class<T>
Java type the response entity will be converted to.
responseType
)

Invoke HTTP TRACE method for the current request synchronously.

public <
generic response entity type.
T
>
T

Returns:

invocation response.
trace
(GenericType<T>
representation of a generic Java type the response entity will be converted to.
responseType
)

Invoke HTTP TRACE method for the current request synchronously.

Method Detail

deleteback to summary
public Response delete()

Invoke HTTP DELETE method for the current request synchronously.

Returns:Response

invocation response.

Exceptions
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.
deleteback to summary
public <T> T delete(Class<T> responseType)

Invoke HTTP DELETE method for the current request synchronously.

Parameters
<T>
response entity type.
responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
deleteback to summary
public <T> T delete(GenericType<T> responseType)

Invoke HTTP DELETE method for the current request synchronously.

Parameters
<T>
generic response entity type.
responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.
getback to summary
public Response get()

Invoke HTTP GET method for the current request synchronously.

Returns:Response

invocation response.

Exceptions
ProcessingException:
in case the invocation processing has failed.
getback to summary
public <T> T get(Class<T> responseType)

Invoke HTTP GET method for the current request synchronously.

Parameters
<T>
response entity type.
responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
getback to summary
public <T> T get(GenericType<T> responseType)

Invoke HTTP GET method for the current request synchronously.

Parameters
<T>
generic response entity type.
responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response
headback to summary
public Response head()

Invoke HTTP HEAD method for the current request synchronously.

Returns:Response

invocation response.

Exceptions
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.
methodback to summary
public Response method(String name)

Invoke an arbitrary method for the current request synchronously.

Parameters
name:String

method name.

Returns:Response

invocation response.

Exceptions
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.
methodback to summary
public <T> T method(String name, Class<T> responseType)

Invoke an arbitrary method for the current request synchronously.

Parameters
<T>
response entity type.
name:String

method name.

responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
methodback to summary
public <T> T method(String name, GenericType<T> responseType)

Invoke an arbitrary method for the current request synchronously.

Parameters
<T>
generic response entity type.
name:String

method name.

responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.
methodback to summary
public Response method(String name, Entity<?> entity)

Invoke an arbitrary method for the current request synchronously.

Parameters
name:String

method name.

entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

Returns:Response

invocation response.

Exceptions
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.
methodback to summary
public <T> T method(String name, Entity<?> entity, Class<T> responseType)

Invoke an arbitrary method for the current request synchronously.

Parameters
<T>
response entity type.
name:String

method name.

entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
methodback to summary
public <T> T method(String name, Entity<?> entity, GenericType<T> responseType)

Invoke an arbitrary method for the current request synchronously.

Parameters
<T>
generic response entity type.
name:String

method name.

entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.
optionsback to summary
public Response options()

Invoke HTTP OPTIONS method for the current request synchronously.

Returns:Response

invocation response.

Exceptions
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.
optionsback to summary
public <T> T options(Class<T> responseType)

Invoke HTTP OPTIONS method for the current request synchronously.

Parameters
<T>
response entity type.
responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
optionsback to summary
public <T> T options(GenericType<T> responseType)

Invoke HTTP OPTIONS method for the current request synchronously.

Parameters
<T>
generic response entity type.
responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.
postback to summary
public Response post(Entity<?> entity)

Invoke HTTP POST method for the current request synchronously.

Parameters
entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

Returns:Response

invocation response.

Exceptions
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.
postback to summary
public <T> T post(Entity<?> entity, Class<T> responseType)

Invoke HTTP POST method for the current request synchronously.

Parameters
<T>
response entity type.
entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
postback to summary
public <T> T post(Entity<?> entity, GenericType<T> responseType)

Invoke HTTP POST method for the current request synchronously.

Parameters
<T>
generic response entity type.
entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.
putback to summary
public Response put(Entity<?> entity)

Invoke HTTP PUT method for the current request synchronously.

Parameters
entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

Returns:Response

invocation response.

Exceptions
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.
putback to summary
public <T> T put(Entity<?> entity, Class<T> responseType)

Invoke HTTP PUT method for the current request synchronously.

Parameters
<T>
response entity type.
entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
putback to summary
public <T> T put(Entity<?> entity, GenericType<T> responseType)

Invoke HTTP PUT method for the current request synchronously.

Parameters
<T>
generic response entity type.
entity:Entity<?>

request entity, including it's full javax.ws.rs.core.Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.

responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.
traceback to summary
public Response trace()

Invoke HTTP TRACE method for the current request synchronously.

Returns:Response

invocation response.

Exceptions
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.
traceback to summary
public <T> T trace(Class<T> responseType)

Invoke HTTP TRACE method for the current request synchronously.

Parameters
<T>
response entity type.
responseType:Class<T>

Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified response type is not javax.ws.rs.core.Response.
traceback to summary
public <T> T trace(GenericType<T> responseType)

Invoke HTTP TRACE method for the current request synchronously.

Parameters
<T>
generic response entity type.
responseType:GenericType<T>

representation of a generic Java type the response entity will be converted to.

Returns:T

invocation response.

Exceptions
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 not successful and the specified generic response type does not represent javax.ws.rs.core.Response.