org.glassfish.jersey.client
Class ClientResponse

java.lang.Object
  extended by org.glassfish.jersey.message.internal.InboundMessageContext
      extended by org.glassfish.jersey.client.ClientResponse
All Implemented Interfaces:
ClientResponseContext

public class ClientResponse
extends InboundMessageContext
implements ClientResponseContext

Jersey client response context.

Author:
Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
ClientResponse(ClientRequest requestContext, Response response)
          Create new Jersey client response context initialized from a JAX-RS response.
ClientResponse(Response.StatusType status, ClientRequest requestContext)
          Create a new Jersey client response context.
 
Method Summary
 java.util.Map<java.lang.String,NewCookie> getCookies()
          Get any new cookies set on the response message.
 ClientRequest getRequestContext()
          Get the associated client request context paired with this response context.
 int getStatus()
          Get the status code associated with the response.
 Response.StatusType getStatusInfo()
          Get the complete status information associated with the response.
 void setStatus(int code)
          Set a new response status code.
 void setStatusInfo(Response.StatusType status)
          Set the complete status information associated with the response.
 
Methods inherited from class org.glassfish.jersey.message.internal.InboundMessageContext
bufferEntity, close, getAllowedMethods, getDate, getEntityStream, getEntityTag, getHeaders, getHeaderString, getIfMatch, getIfNoneMatch, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getQualifiedAcceptableLanguages, getQualifiedAcceptableMediaTypes, getQualifiedAcceptCharset, getQualifiedAcceptEncoding, getRequestCookies, getResponseCookies, getWorkers, hasEntity, hasLink, header, headers, headers, headers, headers, readEntity, readEntity, readEntity, readEntity, remove, setEntityStream, setWorkers
 
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.ClientResponseContext
getAllowedMethods, getDate, getEntityStream, getEntityTag, getHeaders, getHeaderString, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, hasEntity, hasLink, setEntityStream
 

Constructor Detail

ClientResponse

public ClientResponse(ClientRequest requestContext,
                      Response response)
Create new Jersey client response context initialized from a JAX-RS response.

Parameters:
requestContext - associated request context.
response - JAX-RS response to be used to initialize the response context.

ClientResponse

public ClientResponse(Response.StatusType status,
                      ClientRequest requestContext)
Create a new Jersey client response context.

Parameters:
status - response status.
requestContext - associated client request context.
Method Detail

getStatus

public int getStatus()
Description copied from interface: ClientResponseContext
Get the status code associated with the response.

Specified by:
getStatus in interface ClientResponseContext
Returns:
the response status code or -1 if the status was not set.

setStatus

public void setStatus(int code)
Description copied from interface: ClientResponseContext
Set a new response status code.

Specified by:
setStatus in interface ClientResponseContext
Parameters:
code - new status code.

setStatusInfo

public void setStatusInfo(Response.StatusType status)
Description copied from interface: ClientResponseContext
Set the complete status information associated with the response.

Specified by:
setStatusInfo in interface ClientResponseContext
Parameters:
status - the response status information.

getStatusInfo

public Response.StatusType getStatusInfo()
Description copied from interface: ClientResponseContext
Get the complete status information associated with the response.

Specified by:
getStatusInfo in interface ClientResponseContext
Returns:
the response status information or null if the status was not set.

getRequestContext

public ClientRequest getRequestContext()
Get the associated client request context paired with this response context.

Returns:
associated client request context.

getCookies

public java.util.Map<java.lang.String,NewCookie> getCookies()
Description copied from interface: ClientResponseContext
Get any new cookies set on the response message.

Specified by:
getCookies in interface ClientResponseContext
Returns:
a read-only map of cookie name (String) to a new cookie.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.