|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ContainerResponseContext
Container response filter context. A mutable class that provides response-specific information for the filter, such as message headers, message entity or request-scoped properties. The exposed setters allow modification of the exposed response-specific information.
| Method Summary | |
|---|---|
Set<String> |
getAllowedMethods()
Get the allowed HTTP methods from the Allow HTTP header. |
Map<String,NewCookie> |
getCookies()
Get any new cookies set on the response message. |
Date |
getDate()
Get message date. |
Object |
getEntity()
Get the message entity Java instance. |
Annotation[] |
getEntityAnnotations()
Get the annotations attached to the entity. |
Class<?> |
getEntityClass()
Get the raw entity type information. |
OutputStream |
getEntityStream()
Get the entity output stream. |
EntityTag |
getEntityTag()
Get the entity tag. |
Type |
getEntityType()
Get the generic entity type information. |
MultivaluedMap<String,Object> |
getHeaders()
Get the mutable response headers multivalued map. |
String |
getHeaderString(String name)
Get a message header as a single string value. |
Locale |
getLanguage()
Get the language of the entity. |
Date |
getLastModified()
Get the last modified date. |
int |
getLength()
Get Content-Length value. |
Link |
getLink(String relation)
Get the link for the relation. |
Link.Builder |
getLinkBuilder(String relation)
Convenience method that returns a Link.Builder
for the relation. |
Set<Link> |
getLinks()
Get the links attached to the message as header. |
URI |
getLocation()
Get the location. |
MediaType |
getMediaType()
Get the media type of the entity. |
int |
getStatus()
Get the status code associated with the response. |
Response.StatusType |
getStatusInfo()
Get the complete status information associated with the response. |
MultivaluedMap<String,String> |
getStringHeaders()
Get a string view of header values associated with the message. |
boolean |
hasEntity()
Check if there is an entity available in the response. |
boolean |
hasLink(String relation)
Check if link for relation exists. |
void |
setEntity(Object entity,
Annotation[] annotations,
MediaType mediaType)
Set a new response message entity. |
void |
setEntityStream(OutputStream outputStream)
Set a new entity output stream. |
void |
setStatus(int code)
Set a new response status code. |
void |
setStatusInfo(Response.StatusType statusInfo)
Set the complete status information associated with the response. |
| Method Detail |
|---|
int getStatus()
void setStatus(int code)
code - new status code.Response.StatusType getStatusInfo()
null if the status was
not set.void setStatusInfo(Response.StatusType statusInfo)
statusInfo - the response status information.MultivaluedMap<String,Object> getHeaders()
getStringHeaders(),
getHeaderString(String)MultivaluedMap<String,String> getStringHeaders()
headers map are reflected
in this view.
The method converts the non-string header values to strings using a
RuntimeDelegate.HeaderDelegate if one is available via
RuntimeDelegate.createHeaderDelegate(java.lang.Class) for the
class of the value or using the values toString method if a header delegate is
not available.
getHeaders(),
getHeaderString(String)String getHeaderString(String name)
RuntimeDelegate.HeaderDelegate if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString method if a header
delegate is not available.
name - the message header.
null is returned. If the message header is present but has no
value then the empty string is returned. If the message header is present
more than once then the values of joined together and separated by a ','
character.getHeaders(),
getStringHeaders()Set<String> getAllowedMethods()
Date getDate()
null if not present.Locale getLanguage()
null if not specifiedint getLength()
MediaType getMediaType()
null if not specified (e.g. there's no
response entity).Map<String,NewCookie> getCookies()
new cookie.EntityTag getEntityTag()
null if not present.Date getLastModified()
null if not present.URI getLocation()
null if not present.Set<Link> getLinks()
Set if no links are present. Never
returns null.boolean hasLink(String relation)
relation - link relation.
true if the for the relation link exists, false
otherwise.Link getLink(String relation)
relation - link relation.
null if not present.Link.Builder getLinkBuilder(String relation)
Link.Builder
for the relation.
relation - link relation.
null if not
present.boolean hasEntity()
true if the entity is present, returns
false otherwise.
true if there is an entity present in the message,
false otherwise.Object getEntity()
null if the message does not contain an entity.
null if message does not contain an
entity body.Class<?> getEntityClass()
Type getEntityType()
void setEntity(Object entity,
Annotation[] annotations,
MediaType mediaType)
GenericEntity if preservation of its generic
type is required.
entity - entity object.annotations - annotations attached to the entity.mediaType - entity media type.MessageBodyWriterAnnotation[] getEntityAnnotations()
OutputStream getEntityStream()
void setEntityStream(OutputStream outputStream)
outputStream - new entity output stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||