|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.message.internal.OutboundMessageContext
org.glassfish.jersey.client.ClientRequest
public class ClientRequest
Jersey client request context.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.glassfish.jersey.message.internal.OutboundMessageContext |
|---|
OutboundMessageContext.StreamProvider |
| Constructor Summary | |
|---|---|
|
ClientRequest(ClientRequest original)
Copy constructor. |
protected |
ClientRequest(java.net.URI requestUri,
ClientConfig clientConfig,
PropertiesDelegate propertiesDelegate)
Create new Jersey client request context. |
| Method Summary | |
|---|---|
void |
abortWith(javax.ws.rs.core.Response response)
|
void |
accept(javax.ws.rs.core.MediaType... types)
Add new accepted types to the message headers. |
void |
accept(java.lang.String... types)
Add new accepted types to the message headers. |
void |
acceptLanguage(java.util.Locale... locales)
Add new accepted languages to the message headers. |
void |
acceptLanguage(java.lang.String... locales)
Add new accepted languages to the message headers. |
void |
cacheControl(javax.ws.rs.core.CacheControl cacheControl)
Add new cache control entry to the message headers. |
void |
cookie(javax.ws.rs.core.Cookie cookie)
Add new cookie to the message headers. |
void |
enableBuffering()
Enable a buffering of serialized entity. |
void |
encoding(java.lang.String encoding)
Set message encoding. |
javax.ws.rs.core.Response |
getAbortResponse()
Get the request filter chain aborting response if set, or null otherwise. |
JerseyClient |
getClient()
|
javax.ws.rs.core.Configuration |
getConfiguration()
|
java.util.Map<java.lang.String,javax.ws.rs.core.Cookie> |
getCookies()
|
java.lang.String |
getMethod()
|
java.lang.Object |
getProperty(java.lang.String name)
|
java.util.Collection<java.lang.String> |
getPropertyNames()
|
java.lang.Iterable<javax.ws.rs.ext.ReaderInterceptor> |
getReaderInterceptors()
Get reader interceptors of this request. |
java.net.URI |
getUri()
|
MessageBodyWorkers |
getWorkers()
Get the message body workers associated with the request. |
java.lang.Iterable<javax.ws.rs.ext.WriterInterceptor> |
getWriterInterceptors()
Get writer interceptors of this request. |
boolean |
isAsynchronous()
Returns true if the request is called asynchronously using AsyncInvoker |
void |
language(java.util.Locale language)
Set message language. |
void |
language(java.lang.String language)
Set message language. |
void |
removeProperty(java.lang.String name)
|
void |
setMethod(java.lang.String method)
|
void |
setProperty(java.lang.String name,
java.lang.Object object)
|
void |
setUri(java.net.URI uri)
|
void |
setWorkers(MessageBodyWorkers workers)
Set the message body workers associated with the request. |
void |
type(javax.ws.rs.core.MediaType type)
Set message content type. |
void |
type(java.lang.String type)
Set message content type. |
void |
variant(javax.ws.rs.core.Variant variant)
Set message content variant (type, language and encoding). |
void |
writeEntity()
Write (serialize) the entity set in this request into the entity stream. |
| Methods inherited from class org.glassfish.jersey.message.internal.OutboundMessageContext |
|---|
close, commitStream, enableBuffering, getAcceptableLanguages, getAcceptableMediaTypes, getAllowedMethods, getDate, getEntity, getEntityAnnotations, getEntityClass, getEntityStream, getEntityTag, getEntityType, getHeaders, getHeaderString, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getRequestCookies, getResponseCookies, getStringHeaders, hasEntity, hasLink, isCommitted, replaceHeaders, setEntity, setEntity, setEntity, setEntity, setEntityAnnotations, setEntityStream, setEntityType, setMediaType, setStreamProvider |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.ws.rs.client.ClientRequestContext |
|---|
getAcceptableLanguages, getAcceptableMediaTypes, getDate, getEntity, getEntityAnnotations, getEntityClass, getEntityStream, getEntityType, getHeaders, getHeaderString, getLanguage, getMediaType, getStringHeaders, hasEntity, setEntity, setEntity, setEntityStream |
| Constructor Detail |
|---|
protected ClientRequest(java.net.URI requestUri,
ClientConfig clientConfig,
PropertiesDelegate propertiesDelegate)
requestUri - request Uri.clientConfig - request configuration.propertiesDelegate - properties delegate.public ClientRequest(ClientRequest original)
original - original instance.| Method Detail |
|---|
public java.lang.Object getProperty(java.lang.String name)
getProperty in interface javax.ws.rs.client.ClientRequestContextpublic java.util.Collection<java.lang.String> getPropertyNames()
getPropertyNames in interface javax.ws.rs.client.ClientRequestContext
public void setProperty(java.lang.String name,
java.lang.Object object)
setProperty in interface javax.ws.rs.client.ClientRequestContextpublic void removeProperty(java.lang.String name)
removeProperty in interface javax.ws.rs.client.ClientRequestContextpublic java.net.URI getUri()
getUri in interface javax.ws.rs.client.ClientRequestContextpublic void setUri(java.net.URI uri)
setUri in interface javax.ws.rs.client.ClientRequestContextpublic java.lang.String getMethod()
getMethod in interface javax.ws.rs.client.ClientRequestContextpublic void setMethod(java.lang.String method)
setMethod in interface javax.ws.rs.client.ClientRequestContextpublic JerseyClient getClient()
getClient in interface javax.ws.rs.client.ClientRequestContextpublic void abortWith(javax.ws.rs.core.Response response)
abortWith in interface javax.ws.rs.client.ClientRequestContextpublic javax.ws.rs.core.Response getAbortResponse()
null otherwise.
null otherwise.public javax.ws.rs.core.Configuration getConfiguration()
getConfiguration in interface javax.ws.rs.client.ClientRequestContextpublic java.util.Map<java.lang.String,javax.ws.rs.core.Cookie> getCookies()
getCookies in interface javax.ws.rs.client.ClientRequestContextpublic MessageBodyWorkers getWorkers()
public void setWorkers(MessageBodyWorkers workers)
workers - message body workers.public void accept(javax.ws.rs.core.MediaType... types)
types - accepted types to be added.public void accept(java.lang.String... types)
types - accepted types to be added.public void acceptLanguage(java.util.Locale... locales)
locales - accepted languages to be added.public void acceptLanguage(java.lang.String... locales)
locales - accepted languages to be added.public void cookie(javax.ws.rs.core.Cookie cookie)
cookie - cookie to be added.public void cacheControl(javax.ws.rs.core.CacheControl cacheControl)
cacheControl - cache control entry to be added.public void encoding(java.lang.String encoding)
encoding - message encoding to be set.public void language(java.lang.String language)
language - message language to be set.public void language(java.util.Locale language)
language - message language to be set.public void type(javax.ws.rs.core.MediaType type)
type - message content type to be set.public void type(java.lang.String type)
type - message content type to be set.public void variant(javax.ws.rs.core.Variant variant)
variant - message content content variant (type, language and encoding)
to be set.public boolean isAsynchronous()
AsyncInvoker
public void enableBuffering()
CommonProperties.CONTENT_LENGTH_BUFFER.
The buffering functionality is by default disabled and could be enabled by calling this method. In this case
this method must be called before first bytes are written to the entity stream.
public void writeEntity()
throws java.io.IOException
entity stream. The method
use writer interceptors and message body writer.
This method modifies the state of this request and therefore it can be called only once per request life cycle otherwise
IllegalStateException is thrown.
Note that OutboundMessageContext.setStreamProvider(org.glassfish.jersey.message.internal.OutboundMessageContext.StreamProvider)
and optionally enableBuffering() must be called before calling this method.
java.io.IOException - In the case of IO error.public java.lang.Iterable<javax.ws.rs.ext.WriterInterceptor> getWriterInterceptors()
public java.lang.Iterable<javax.ws.rs.ext.ReaderInterceptor> getReaderInterceptors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||