public class ClientResponseContextImpl extends Object implements ClientResponseContext
| Modifier and Type | Field and Description |
|---|---|
protected ClientResponse |
response |
| Constructor and Description |
|---|
ClientResponseContextImpl(ClientResponse response) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
InputStream |
getEntityStream()
Get the entity input stream.
|
EntityTag |
getEntityTag()
Get the entity tag.
|
MultivaluedMap<String,String> |
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.
|
boolean |
hasEntity()
Check if there is a non-empty entity input stream is available in the response
message.
|
boolean |
hasLink(String relation)
Check if link for relation exists.
|
void |
setEntityStream(InputStream entityStream)
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.
|
protected final ClientResponse response
public ClientResponseContextImpl(ClientResponse response)
public int getStatus()
ClientResponseContextgetStatus in interface ClientResponseContextpublic void setStatus(int code)
ClientResponseContextsetStatus in interface ClientResponseContextcode - new status code.public Response.StatusType getStatusInfo()
ClientResponseContextgetStatusInfo in interface ClientResponseContextnull if the status was
not set.public void setStatusInfo(Response.StatusType statusInfo)
ClientResponseContextsetStatusInfo in interface ClientResponseContextstatusInfo - the response status information.public MultivaluedMap<String,String> getHeaders()
ClientResponseContextgetHeaders in interface ClientResponseContextClientResponseContext.getHeaderString(String)public Set<String> getAllowedMethods()
ClientResponseContextgetAllowedMethods in interface ClientResponseContextpublic Date getDate()
ClientResponseContextgetDate in interface ClientResponseContextnull if not present.public Locale getLanguage()
ClientResponseContextgetLanguage in interface ClientResponseContextnull if not specifiedpublic int getLength()
ClientResponseContextgetLength in interface ClientResponseContextpublic MediaType getMediaType()
ClientResponseContextgetMediaType in interface ClientResponseContextnull if not specified (e.g. there's no
response entity).public Map<String,NewCookie> getCookies()
ClientResponseContextgetCookies in interface ClientResponseContextnew cookie.public EntityTag getEntityTag()
ClientResponseContextgetEntityTag in interface ClientResponseContextnull if not present.public Date getLastModified()
ClientResponseContextgetLastModified in interface ClientResponseContextnull if not present.public URI getLocation()
ClientResponseContextgetLocation in interface ClientResponseContextnull if not present.public Set<Link> getLinks()
ClientResponseContextgetLinks in interface ClientResponseContextSet if no links are present. Never
returns null.public boolean hasLink(String relation)
ClientResponseContexthasLink in interface ClientResponseContextrelation - link relation.true if the for the relation link exists, false
otherwise.public Link getLink(String relation)
ClientResponseContextgetLink in interface ClientResponseContextrelation - link relation.null if not present.public Link.Builder getLinkBuilder(String relation)
ClientResponseContextLink.Builder
for the relation.getLinkBuilder in interface ClientResponseContextrelation - link relation.null if not
present.public boolean hasEntity()
ClientResponseContexttrue if the entity is present, returns
false otherwise.hasEntity in interface ClientResponseContexttrue if there is an entity present in the message,
false otherwise.public InputStream getEntityStream()
ClientResponseContextgetEntityStream in interface ClientResponseContextpublic void setEntityStream(InputStream entityStream)
ClientResponseContextsetEntityStream in interface ClientResponseContextentityStream - new entity input stream.public String getHeaderString(String name)
ClientResponseContextgetHeaderString in interface ClientResponseContextname - 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.ClientResponseContext.getHeaders()Copyright © 2018 JBoss by Red Hat. All rights reserved.