|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.server.ContainerResponse
public class ContainerResponse
Jersey container response context.
| Constructor Summary | |
|---|---|
ContainerResponse(ContainerRequest requestContext,
Response response)
Create a new Jersey container response context. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the response. |
void |
commitStream()
Commits the entity stream if it wasn't already committed. |
Set<String> |
getAllowedMethods()
|
Map<String,NewCookie> |
getCookies()
|
Date |
getDate()
|
Object |
getEntity()
|
Annotation[] |
getEntityAnnotations()
|
Class<?> |
getEntityClass()
|
OutputStream |
getEntityStream()
|
EntityTag |
getEntityTag()
|
Type |
getEntityType()
|
MultivaluedMap<String,Object> |
getHeaders()
|
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()
|
ContainerRequest |
getRequestContext()
Get the associated container request context paired with this response context. |
int |
getStatus()
|
Response.StatusType |
getStatusInfo()
|
MultivaluedMap<String,String> |
getStringHeaders()
|
OutboundMessageContext |
getWrappedMessageContext()
Get the wrapped response message context. |
boolean |
hasEntity()
|
boolean |
hasLink(String relation)
|
boolean |
isChunked()
Returns true if the response entity is a ChunkedOutput instance. |
boolean |
isCommitted()
Returns true if the entity stream has been committed. |
boolean |
isMappedFromException()
Returns true if the response is result of the exception (for example created during .ExceptionMapper exception mapping). |
void |
setEntity(Object entity)
Set a new message message entity. |
void |
setEntity(Object entity,
Annotation[] annotations)
Set a new message message entity. |
void |
setEntity(Object entity,
Annotation[] annotations,
MediaType mediaType)
|
void |
setEntity(Object entity,
Type type,
Annotation[] annotations)
Set a new message message entity. |
void |
setEntityAnnotations(Annotation[] annotations)
Set the annotations attached to the entity. |
void |
setEntityStream(OutputStream outputStream)
|
void |
setEntityType(Type type)
Set the message entity type information. |
void |
setMappedFromException(boolean mappedFromException)
Sets the flag indicating whether the response was created based on the exception. |
void |
setMediaType(MediaType mediaType)
Set the message content media type. |
void |
setStatus(int code)
|
void |
setStatusInfo(Response.StatusType status)
|
void |
setStreamProvider(OutboundMessageContext.StreamProvider streamProvider)
Set the output stream provider. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContainerResponse(ContainerRequest requestContext,
Response response)
requestContext - associated container request context.response - response instance initializing the response context.| Method Detail |
|---|
public boolean isMappedFromException()
.ExceptionMapper exception mapping).
public void setMappedFromException(boolean mappedFromException)
mappedFromException - True if this exception if result of the exception (for example result of
exception mapping).public int getStatus()
getStatus in interface ContainerResponseContextpublic void setStatus(int code)
setStatus in interface ContainerResponseContextpublic void setStatusInfo(Response.StatusType status)
setStatusInfo in interface ContainerResponseContextpublic Response.StatusType getStatusInfo()
getStatusInfo in interface ContainerResponseContextpublic ContainerRequest getRequestContext()
public Map<String,NewCookie> getCookies()
getCookies in interface ContainerResponseContextpublic OutboundMessageContext getWrappedMessageContext()
public String getHeaderString(String name)
getHeaderString in interface ContainerResponseContextpublic MultivaluedMap<String,Object> getHeaders()
getHeaders in interface ContainerResponseContextpublic MultivaluedMap<String,String> getStringHeaders()
getStringHeaders in interface ContainerResponseContextpublic Date getDate()
getDate in interface ContainerResponseContextpublic Locale getLanguage()
getLanguage in interface ContainerResponseContextpublic MediaType getMediaType()
getMediaType in interface ContainerResponseContextpublic Set<String> getAllowedMethods()
getAllowedMethods in interface ContainerResponseContextpublic int getLength()
getLength in interface ContainerResponseContextpublic EntityTag getEntityTag()
getEntityTag in interface ContainerResponseContextpublic Date getLastModified()
getLastModified in interface ContainerResponseContextpublic URI getLocation()
getLocation in interface ContainerResponseContextpublic Set<Link> getLinks()
getLinks in interface ContainerResponseContextpublic boolean hasLink(String relation)
hasLink in interface ContainerResponseContextpublic Link getLink(String relation)
getLink in interface ContainerResponseContextpublic Link.Builder getLinkBuilder(String relation)
getLinkBuilder in interface ContainerResponseContextpublic boolean hasEntity()
hasEntity in interface ContainerResponseContextpublic Object getEntity()
getEntity in interface ContainerResponseContextpublic void setEntity(Object entity)
entity - entity object.MessageBodyWriter
public void setEntity(Object entity,
Annotation[] annotations)
entity - entity object.annotations - annotations attached to the entity.MessageBodyWriter
public void setEntity(Object entity,
Type type,
Annotation[] annotations)
entity - entity object.type - declared entity class.annotations - annotations attached to the entity.MessageBodyWriter
public void setEntity(Object entity,
Annotation[] annotations,
MediaType mediaType)
setEntity in interface ContainerResponseContextpublic void setMediaType(MediaType mediaType)
mediaType - message content media type.public Class<?> getEntityClass()
getEntityClass in interface ContainerResponseContextpublic Type getEntityType()
getEntityType in interface ContainerResponseContextpublic void setEntityType(Type type)
type - overriding message entity type.public Annotation[] getEntityAnnotations()
getEntityAnnotations in interface ContainerResponseContextpublic void setEntityAnnotations(Annotation[] annotations)
annotations - entity annotations.public OutputStream getEntityStream()
getEntityStream in interface ContainerResponseContextpublic void setEntityStream(OutputStream outputStream)
setEntityStream in interface ContainerResponseContextpublic void setStreamProvider(OutboundMessageContext.StreamProvider streamProvider)
streamProvider - output stream provider.public void commitStream()
entity stream if it wasn't already committed.
public boolean isCommitted()
true if the entity stream has been committed.
true if the entity stream has been committed. Otherwise returns false.public void close()
public boolean isChunked()
true if the response entity is a ChunkedOutput instance.
true if the entity is a ChunkedOutput instance, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||