|
||||||||||
| 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,
javax.ws.rs.core.Response response)
Create a new Jersey container response context. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the response. |
void |
commitStream()
Commit the entity stream unless already committed. |
void |
enableBuffering(javax.ws.rs.core.Configuration configuration)
Enable a buffering of serialized entity. |
Set<String> |
getAllowedMethods()
|
Map<String,javax.ws.rs.core.NewCookie> |
getCookies()
|
Date |
getDate()
|
Object |
getEntity()
|
Annotation[] |
getEntityAnnotations()
|
Class<?> |
getEntityClass()
|
OutputStream |
getEntityStream()
|
javax.ws.rs.core.EntityTag |
getEntityTag()
|
Type |
getEntityType()
|
javax.ws.rs.core.MultivaluedMap<String,Object> |
getHeaders()
|
String |
getHeaderString(String name)
|
Locale |
getLanguage()
|
Date |
getLastModified()
|
int |
getLength()
|
javax.ws.rs.core.Link |
getLink(String relation)
|
javax.ws.rs.core.Link.Builder |
getLinkBuilder(String relation)
|
Set<javax.ws.rs.core.Link> |
getLinks()
|
URI |
getLocation()
|
javax.ws.rs.core.MediaType |
getMediaType()
|
ContainerRequest |
getRequestContext()
Get the associated container request context paired with this response context. |
int |
getStatus()
|
javax.ws.rs.core.Response.StatusType |
getStatusInfo()
|
javax.ws.rs.core.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,
javax.ws.rs.core.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(javax.ws.rs.core.MediaType mediaType)
Set the message content media type. |
void |
setStatus(int code)
|
void |
setStatusInfo(javax.ws.rs.core.Response.StatusType status)
|
void |
setStreamProvider(OutboundMessageContext.StreamProvider streamProvider)
Set the output stream provider callback. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContainerResponse(ContainerRequest requestContext,
javax.ws.rs.core.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 javax.ws.rs.container.ContainerResponseContextpublic void setStatus(int code)
setStatus in interface javax.ws.rs.container.ContainerResponseContextpublic void setStatusInfo(javax.ws.rs.core.Response.StatusType status)
setStatusInfo in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.Response.StatusType getStatusInfo()
getStatusInfo in interface javax.ws.rs.container.ContainerResponseContextpublic ContainerRequest getRequestContext()
public Map<String,javax.ws.rs.core.NewCookie> getCookies()
getCookies in interface javax.ws.rs.container.ContainerResponseContextpublic OutboundMessageContext getWrappedMessageContext()
public String getHeaderString(String name)
getHeaderString in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.MultivaluedMap<String,Object> getHeaders()
getHeaders in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.MultivaluedMap<String,String> getStringHeaders()
getStringHeaders in interface javax.ws.rs.container.ContainerResponseContextpublic Date getDate()
getDate in interface javax.ws.rs.container.ContainerResponseContextpublic Locale getLanguage()
getLanguage in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.MediaType getMediaType()
getMediaType in interface javax.ws.rs.container.ContainerResponseContextpublic Set<String> getAllowedMethods()
getAllowedMethods in interface javax.ws.rs.container.ContainerResponseContextpublic int getLength()
getLength in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.EntityTag getEntityTag()
getEntityTag in interface javax.ws.rs.container.ContainerResponseContextpublic Date getLastModified()
getLastModified in interface javax.ws.rs.container.ContainerResponseContextpublic URI getLocation()
getLocation in interface javax.ws.rs.container.ContainerResponseContextpublic Set<javax.ws.rs.core.Link> getLinks()
getLinks in interface javax.ws.rs.container.ContainerResponseContextpublic boolean hasLink(String relation)
hasLink in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.Link getLink(String relation)
getLink in interface javax.ws.rs.container.ContainerResponseContextpublic javax.ws.rs.core.Link.Builder getLinkBuilder(String relation)
getLinkBuilder in interface javax.ws.rs.container.ContainerResponseContextpublic boolean hasEntity()
hasEntity in interface javax.ws.rs.container.ContainerResponseContextpublic Object getEntity()
getEntity in interface javax.ws.rs.container.ContainerResponseContextpublic void setEntity(Object entity)
setEntity in interface javax.ws.rs.container.ContainerResponseContextentity - 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,
javax.ws.rs.core.MediaType mediaType)
setEntity in interface javax.ws.rs.container.ContainerResponseContextpublic void setMediaType(javax.ws.rs.core.MediaType mediaType)
mediaType - message content media type.public Class<?> getEntityClass()
getEntityClass in interface javax.ws.rs.container.ContainerResponseContextpublic Type getEntityType()
getEntityType in interface javax.ws.rs.container.ContainerResponseContextpublic void setEntityType(Type type)
type - overriding message entity type.public Annotation[] getEntityAnnotations()
getEntityAnnotations in interface javax.ws.rs.container.ContainerResponseContextpublic void setEntityAnnotations(Annotation[] annotations)
annotations - entity annotations.public OutputStream getEntityStream()
getEntityStream in interface javax.ws.rs.container.ContainerResponseContextpublic void setEntityStream(OutputStream outputStream)
setEntityStream in interface javax.ws.rs.container.ContainerResponseContextpublic void setStreamProvider(OutboundMessageContext.StreamProvider streamProvider)
entity stream.
streamProvider - non-null output stream provider.public void enableBuffering(javax.ws.rs.core.Configuration configuration)
CommonProperties.OUTBOUND_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.
configuration - runtime configuration.
public void commitStream()
throws IOException
entity stream unless already committed.
IOException - in case of the IO error.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 | |||||||||