org.glassfish.jersey.message.internal
Class OutboundJaxrsResponse

java.lang.Object
  extended by javax.ws.rs.core.Response
      extended by org.glassfish.jersey.message.internal.OutboundJaxrsResponse

public class OutboundJaxrsResponse
extends Response

An outbound JAX-RS response message. The implementation delegates method calls to an underlying outbound message context.

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

Nested Class Summary
static class OutboundJaxrsResponse.Builder
          Outbound JAX-RS Response.ResponseBuilder implementation.
 
Nested classes/interfaces inherited from class javax.ws.rs.core.Response
Response.ResponseBuilder, Response.Status, Response.StatusType
 
Constructor Summary
OutboundJaxrsResponse(Response.StatusType status, OutboundMessageContext context)
          Create new outbound JAX-RS response message instance.
 
Method Summary
 boolean bufferEntity()
           
 void close()
           
 Set<String> getAllowedMethods()
           
 OutboundMessageContext getContext()
          Get the underlying outbound message context.
 Map<String,NewCookie> getCookies()
           
 Date getDate()
           
 Object getEntity()
           
 EntityTag getEntityTag()
           
 String getHeaderString(String name)
           
 Locale getLanguage()
           
 Date getLastModified()
           
 int getLength()
           
 Link getLink(String relation)
           
 Link.Builder getLinkBuilder(String relation)
           
 Set<Link> getLinks()
           
 URI getLocation()
           
 MediaType getMediaType()
           
 MultivaluedMap<String,Object> getMetadata()
           
 int getStatus()
           
 Response.StatusType getStatusInfo()
           
 MultivaluedMap<String,String> getStringHeaders()
           
 boolean hasEntity()
           
 boolean hasLink(String relation)
           
<T> T
readEntity(Class<T> type)
           
<T> T
readEntity(Class<T> type, Annotation[] annotations)
           
<T> T
readEntity(GenericType<T> entityType)
           
<T> T
readEntity(GenericType<T> entityType, Annotation[] annotations)
           
static OutboundJaxrsResponse unwrap(Response response)
          Unwrap an OutboundJaxrsResponse instance from a given response.
 
Methods inherited from class javax.ws.rs.core.Response
accepted, accepted, created, fromResponse, getHeaders, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, temporaryRedirect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutboundJaxrsResponse

public OutboundJaxrsResponse(Response.StatusType status,
                             OutboundMessageContext context)
Create new outbound JAX-RS response message instance.

Parameters:
status - response status.
context - underlying outbound message context.
Method Detail

unwrap

public static OutboundJaxrsResponse unwrap(Response response)
Unwrap an OutboundJaxrsResponse instance from a given response.

Parameters:
response - response instance to unwrap.
Returns:
down-casted OutboundJaxrsResponse instance.
Throws:
IllegalArgumentException - in case the instance cannot be down-casted.

getContext

public OutboundMessageContext getContext()
Get the underlying outbound message context.

Returns:
underlying outbound message context.

getStatus

public int getStatus()
Specified by:
getStatus in class Response

getStatusInfo

public Response.StatusType getStatusInfo()
Specified by:
getStatusInfo in class Response

getEntity

public Object getEntity()
Specified by:
getEntity in class Response

readEntity

public <T> T readEntity(Class<T> type)
             throws MessageProcessingException
Specified by:
readEntity in class Response
Throws:
MessageProcessingException

readEntity

public <T> T readEntity(GenericType<T> entityType)
             throws MessageProcessingException
Specified by:
readEntity in class Response
Throws:
MessageProcessingException

readEntity

public <T> T readEntity(Class<T> type,
                        Annotation[] annotations)
             throws MessageProcessingException
Specified by:
readEntity in class Response
Throws:
MessageProcessingException

readEntity

public <T> T readEntity(GenericType<T> entityType,
                        Annotation[] annotations)
             throws MessageProcessingException
Specified by:
readEntity in class Response
Throws:
MessageProcessingException

hasEntity

public boolean hasEntity()
Specified by:
hasEntity in class Response

bufferEntity

public boolean bufferEntity()
                     throws MessageProcessingException
Specified by:
bufferEntity in class Response
Throws:
MessageProcessingException

close

public void close()
           throws MessageProcessingException
Specified by:
close in class Response
Throws:
MessageProcessingException

getStringHeaders

public MultivaluedMap<String,String> getStringHeaders()
Specified by:
getStringHeaders in class Response

getHeaderString

public String getHeaderString(String name)
Specified by:
getHeaderString in class Response

getMediaType

public MediaType getMediaType()
Specified by:
getMediaType in class Response

getLanguage

public Locale getLanguage()
Specified by:
getLanguage in class Response

getLength

public int getLength()
Specified by:
getLength in class Response

getCookies

public Map<String,NewCookie> getCookies()
Specified by:
getCookies in class Response

getEntityTag

public EntityTag getEntityTag()
Specified by:
getEntityTag in class Response

getDate

public Date getDate()
Specified by:
getDate in class Response

getLastModified

public Date getLastModified()
Specified by:
getLastModified in class Response

getAllowedMethods

public Set<String> getAllowedMethods()
Specified by:
getAllowedMethods in class Response

getLocation

public URI getLocation()
Specified by:
getLocation in class Response

getLinks

public Set<Link> getLinks()
Specified by:
getLinks in class Response

hasLink

public boolean hasLink(String relation)
Specified by:
hasLink in class Response

getLink

public Link getLink(String relation)
Specified by:
getLink in class Response

getLinkBuilder

public Link.Builder getLinkBuilder(String relation)
Specified by:
getLinkBuilder in class Response

getMetadata

public MultivaluedMap<String,Object> getMetadata()
Specified by:
getMetadata in class Response


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