|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.client.JerseyInvocation.Builder
public static class JerseyInvocation.Builder
Jersey-specific client invocation builder.
| Constructor Summary | |
|---|---|
protected |
JerseyInvocation.Builder(URI uri,
ClientConfig configuration)
Create new Jersey-specific client invocation builder. |
| Method Summary | ||
|---|---|---|
JerseyInvocation.Builder |
accept(MediaType... mediaTypes)
Add the accepted response media types. |
|
JerseyInvocation.Builder |
accept(String... mediaTypes)
Add the accepted response media types. |
|
Invocation.Builder |
acceptEncoding(String... encodings)
Add acceptable encodings. |
|
JerseyInvocation.Builder |
acceptLanguage(Locale... locales)
Add acceptable languages. |
|
JerseyInvocation.Builder |
acceptLanguage(String... locales)
Add acceptable languages. |
|
AsyncInvoker |
async()
Access the asynchronous uniform request invocation interface to asynchronously invoke the built request. |
|
JerseyInvocation |
build(String method)
Build a request invocation using an arbitrary request method name. |
|
JerseyInvocation |
build(String method,
Entity<?> entity)
Build a request invocation using an arbitrary request method name and request entity. |
|
JerseyInvocation |
buildDelete()
Build a DELETE request invocation. |
|
JerseyInvocation |
buildGet()
Build a GET request invocation. |
|
JerseyInvocation |
buildPost(Entity<?> entity)
Build a POST request invocation. |
|
JerseyInvocation |
buildPut(Entity<?> entity)
Build a PUT request invocation. |
|
JerseyInvocation.Builder |
cacheControl(CacheControl cacheControl)
Set the cache control data of the message. |
|
JerseyInvocation.Builder |
cookie(Cookie cookie)
Add a cookie to be set. |
|
JerseyInvocation.Builder |
cookie(String name,
String value)
Add a cookie to be set. |
|
Response |
delete()
Invoke HTTP DELETE method for the current request synchronously. |
|
|
delete(Class<T> responseType)
Invoke HTTP DELETE method for the current request synchronously. |
|
|
delete(GenericType<T> responseType)
Invoke HTTP DELETE method for the current request synchronously. |
|
Response |
get()
Invoke HTTP GET method for the current request synchronously. |
|
|
get(Class<T> responseType)
Invoke HTTP GET method for the current request synchronously. |
|
|
get(GenericType<T> responseType)
Invoke HTTP GET method for the current request synchronously. |
|
Response |
head()
Invoke HTTP HEAD method for the current request synchronously. |
|
JerseyInvocation.Builder |
header(String name,
Object value)
Add an arbitrary header. |
|
JerseyInvocation.Builder |
headers(MultivaluedMap<String,Object> headers)
Replaces all existing headers with the newly supplied headers. |
|
Response |
method(String name)
Invoke an arbitrary method for the current request synchronously. |
|
|
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. |
|
|
method(String name,
Entity<?> entity,
Class<T> responseType)
Invoke an arbitrary method for the current request synchronously. |
|
|
method(String name,
Entity<?> entity,
GenericType<T> responseType)
Invoke an arbitrary method for the current request synchronously. |
|
|
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. |
|
|
options(Class<T> responseType)
Invoke HTTP OPTIONS method for the current request synchronously. |
|
|
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. |
|
|
post(Entity<?> entity,
Class<T> responseType)
Invoke HTTP POST method for the current request synchronously. |
|
|
post(Entity<?> entity,
GenericType<T> responseType)
Invoke HTTP POST method for the current request synchronously. |
|
JerseyInvocation.Builder |
property(String name,
Object value)
Set a new property in the context of a request represented by this invocation builder. |
|
Response |
put(Entity<?> entity)
Invoke HTTP PUT method for the current request synchronously. |
|
|
put(Entity<?> entity,
Class<T> responseType)
Invoke HTTP PUT method for the current request synchronously. |
|
|
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. |
|
|
trace(Class<T> responseType)
Invoke HTTP TRACE method for the current request synchronously. |
|
|
trace(GenericType<T> responseType)
Invoke HTTP TRACE method for the current request synchronously. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected JerseyInvocation.Builder(URI uri,
ClientConfig configuration)
uri - invoked request URI.configuration - Jersey client configuration.| Method Detail |
|---|
public JerseyInvocation build(String method)
Invocation.Builder
build in interface Invocation.Buildermethod - request method name.
public JerseyInvocation build(String method,
Entity<?> entity)
Invocation.Builder
build in interface Invocation.Buildermethod - request method name.entity - request entity, including it's full 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.
public JerseyInvocation buildGet()
Invocation.Builder
buildGet in interface Invocation.Builderpublic JerseyInvocation buildDelete()
Invocation.Builder
buildDelete in interface Invocation.Builderpublic JerseyInvocation buildPost(Entity<?> entity)
Invocation.Builder
buildPost in interface Invocation.Builderentity - request entity, including it's full 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.
public JerseyInvocation buildPut(Entity<?> entity)
Invocation.Builder
buildPut in interface Invocation.Builderentity - request entity, including it's full 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.
public AsyncInvoker async()
Invocation.Builder
async in interface Invocation.Builderpublic JerseyInvocation.Builder accept(String... mediaTypes)
Invocation.Builder
accept in interface Invocation.BuildermediaTypes - accepted response media types.
public JerseyInvocation.Builder accept(MediaType... mediaTypes)
Invocation.Builder
accept in interface Invocation.BuildermediaTypes - accepted response media types.
public Invocation.Builder acceptEncoding(String... encodings)
Invocation.Builder
acceptEncoding in interface Invocation.Builderencodings - an array of the acceptable encodings.
public JerseyInvocation.Builder acceptLanguage(Locale... locales)
Invocation.Builder
acceptLanguage in interface Invocation.Builderlocales - an array of the acceptable languages.
public JerseyInvocation.Builder acceptLanguage(String... locales)
Invocation.Builder
acceptLanguage in interface Invocation.Builderlocales - an array of the acceptable languages.
public JerseyInvocation.Builder cookie(Cookie cookie)
Invocation.Builder
cookie in interface Invocation.Buildercookie - to be set.
public JerseyInvocation.Builder cookie(String name,
String value)
Invocation.Builder
cookie in interface Invocation.Buildername - the name of the cookie.value - the value of the cookie.
public JerseyInvocation.Builder cacheControl(CacheControl cacheControl)
Invocation.Builder
cacheControl in interface Invocation.BuildercacheControl - the cache control directives, if null
any existing cache control directives will be removed.
public JerseyInvocation.Builder header(String name,
Object value)
Invocation.Builder
header in interface Invocation.Buildername - the name of the headervalue - the value of the header, the header will be serialized
using a RuntimeDelegate.HeaderDelegate if
one is available via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the class of value or using its toString method
if a header delegate is not available. If value is null
then all current headers of the same name will be removed.
public JerseyInvocation.Builder headers(MultivaluedMap<String,Object> headers)
Invocation.Builder
headers in interface Invocation.Builderheaders - new headers to be set, if null all existing
headers will be removed.
public Response get()
throws ProcessingException
SyncInvoker
get in interface SyncInvokerProcessingException - in case the invocation processing has failed.
public <T> T get(Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
get in interface SyncInvokerT - response entity type.responseType - Java type the response entity will be converted to.
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
Response.
public <T> T get(GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
get in interface SyncInvokerT - generic response entity type.responseType - representation of a generic Java type the response
entity will be converted to.
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
Response
public Response put(Entity<?> entity)
throws ProcessingException
SyncInvoker
put in interface SyncInvokerentity - request entity, including it's full 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.
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.
public <T> T put(Entity<?> entity,
Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
put in interface SyncInvokerT - response entity type.entity - request entity, including it's full 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 - Java type the response entity will be converted to.
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
Response.
public <T> T put(Entity<?> entity,
GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
put in interface SyncInvokerT - generic response entity type.entity - request entity, including it's full 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 - representation of a generic Java type the response
entity will be converted to.
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
Response.
public Response post(Entity<?> entity)
throws ProcessingException
SyncInvoker
post in interface SyncInvokerentity - request entity, including it's full 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.
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.
public <T> T post(Entity<?> entity,
Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
post in interface SyncInvokerT - response entity type.entity - request entity, including it's full 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 - Java type the response entity will be converted to.
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
Response.
public <T> T post(Entity<?> entity,
GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
post in interface SyncInvokerT - generic response entity type.entity - request entity, including it's full 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 - representation of a generic Java type the response
entity will be converted to.
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
Response.
public Response delete()
throws ProcessingException
SyncInvoker
delete in interface SyncInvokerResponseProcessingException - 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.
public <T> T delete(Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
delete in interface SyncInvokerT - response entity type.responseType - Java type the response entity will be converted to.
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
Response.
public <T> T delete(GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
delete in interface SyncInvokerT - generic response entity type.responseType - representation of a generic Java type the response
entity will be converted to.
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
Response.
public Response head()
throws ProcessingException
SyncInvoker
head in interface SyncInvokerResponseProcessingException - 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.
public Response options()
throws ProcessingException
SyncInvoker
options in interface SyncInvokerResponseProcessingException - 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.
public <T> T options(Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
options in interface SyncInvokerT - response entity type.responseType - Java type the response entity will be converted to.
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
Response.
public <T> T options(GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
options in interface SyncInvokerT - generic response entity type.responseType - representation of a generic Java type the response
entity will be converted to.
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
Response.
public Response trace()
throws ProcessingException
SyncInvoker
trace in interface SyncInvokerResponseProcessingException - 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.
public <T> T trace(Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
trace in interface SyncInvokerT - response entity type.responseType - Java type the response entity will be converted to.
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
Response.
public <T> T trace(GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
trace in interface SyncInvokerT - generic response entity type.responseType - representation of a generic Java type the response
entity will be converted to.
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
Response.
public Response method(String name)
throws ProcessingException
SyncInvoker
method in interface SyncInvokername - method name.
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.
public <T> T method(String name,
Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
method in interface SyncInvokerT - response entity type.name - method name.responseType - Java type the response entity will be converted to.
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
Response.
public <T> T method(String name,
GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
method in interface SyncInvokerT - generic response entity type.name - method name.responseType - representation of a generic Java type the response
entity will be converted to.
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
Response.
public Response method(String name,
Entity<?> entity)
throws ProcessingException
SyncInvoker
method in interface SyncInvokername - method name.entity - request entity, including it's full 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.
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.
public <T> T method(String name,
Entity<?> entity,
Class<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
method in interface SyncInvokerT - response entity type.name - method name.entity - request entity, including it's full 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 - Java type the response entity will be converted to.
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
Response.
public <T> T method(String name,
Entity<?> entity,
GenericType<T> responseType)
throws ProcessingException,
WebApplicationException
SyncInvoker
method in interface SyncInvokerT - generic response entity type.name - method name.entity - request entity, including it's full 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 - representation of a generic Java type the response
entity will be converted to.
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
Response.
public JerseyInvocation.Builder property(String name,
Object value)
Invocation.Builder
The property is available for a later retrieval via ClientRequestContext.getProperty(String)
or InterceptorContext.getProperty(String).
If a property with a given name is already set in the request context,
the existing value of the property will be updated.
Setting a null value into a property effectively removes the property
from the request property bag.
property in interface Invocation.Buildername - property name.value - (new) property value. null value removes the property
with the given name.
Invocation.property(String, Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||