public interface ClientResponseContext
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getAllowedMethods()
Get the allowed HTTP methods from the Allow HTTP header.
|
java.util.Map<java.lang.String,NewCookie> |
getCookies()
Get any new cookies set on the response message.
|
java.util.Date |
getDate()
Get message date.
|
java.io.InputStream |
getEntityStream()
Get the entity input stream.
|
EntityTag |
getEntityTag()
Get the entity tag.
|
MultivaluedMap<java.lang.String,java.lang.String> |
getHeaders()
Get the mutable response headers multivalued map.
|
java.lang.String |
getHeaderString(java.lang.String name)
Get a message header as a single string value.
|
java.util.Locale |
getLanguage()
Get the language of the entity.
|
java.util.Date |
getLastModified()
Get the last modified date.
|
int |
getLength()
Get Content-Length value.
|
Link |
getLink(java.lang.String relation)
Get the link for the relation.
|
Link.Builder |
getLinkBuilder(java.lang.String relation)
Convenience method that returns a
Link.Builder
for the relation. |
java.util.Set<Link> |
getLinks()
Get the links attached to the message as header.
|
java.net.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.
|
boolean |
hasEntity()
Check if there is a non-empty entity input stream is available in the response
message.
|
boolean |
hasLink(java.lang.String relation)
Check if link for relation exists.
|
void |
setEntityStream(java.io.InputStream input)
Set a new entity input stream.
|
void |
setStatus(int code)
Set a new response status code.
|
void |
setStatusInfo(Response.StatusType statusInfo)
Set the complete status information (status code and reason phrase) associated
with the response.
|
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<java.lang.String,java.lang.String> getHeaders()
getHeaderString(String)
java.lang.String getHeaderString(java.lang.String name)
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()
java.util.Set<java.lang.String> getAllowedMethods()
java.util.Date getDate()
null
if not present.java.util.Locale getLanguage()
null
if not specifiedint getLength()
MediaType getMediaType()
null
if not specified (e.g. there's no
response entity).java.util.Map<java.lang.String,NewCookie> getCookies()
new cookie
.EntityTag getEntityTag()
null
if not present.java.util.Date getLastModified()
null
if not present.java.net.URI getLocation()
null
if not present.java.util.Set<Link> getLinks()
Set
if no links are present. Never
returns null
.boolean hasLink(java.lang.String relation)
relation
- link relation.true
if the for the relation link exists, false
otherwise.Link getLink(java.lang.String relation)
relation
- link relation.null
if not present.Link.Builder getLinkBuilder(java.lang.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.java.io.InputStream getEntityStream()
void setEntityStream(java.io.InputStream input)
input
- new entity input stream.