Class ClientResponseContextImpl
java.lang.Object
org.jboss.resteasy.client.jaxrs.internal.ClientResponseContextImpl
- All Implemented Interfaces:
ClientResponseContext
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the allowed HTTP methods from the Allow HTTP header.Get any new cookies set on the response message.getDate()Get message date.Get the entity input stream.Get the entity tag.Get the mutable response headers multivalued map.getHeaderString(String name) Get a message header as a single string value.Get the language of the entity.Get the last modified date.intGet Content-Length value.Get the link for the relation.getLinkBuilder(String relation) Convenience method that returns aLink.Builderfor the relation.getLinks()Get the links attached to the message as header.Get the location.Get the media type of the entity.intGet the status code associated with the response.Get the complete status information associated with the response.booleanCheck if there is a non-empty entity input stream is available in the response message.booleanCheck if link for relation exists.voidsetEntityStream(InputStream entityStream) Set a new entity input stream.voidsetStatus(int code) Set a new response status code.voidsetStatusInfo(Response.StatusType statusInfo) Set the complete status information (status code and reason phrase) associated with the response.
-
Field Details
-
response
-
-
Constructor Details
-
ClientResponseContextImpl
-
-
Method Details
-
getStatus
public int getStatus()Description copied from interface:ClientResponseContextGet the status code associated with the response.- Specified by:
getStatusin interfaceClientResponseContext- Returns:
- the response status code or -1 if the status was not set.
-
setStatus
public void setStatus(int code) Description copied from interface:ClientResponseContextSet a new response status code.- Specified by:
setStatusin interfaceClientResponseContext- Parameters:
code- new status code.
-
getStatusInfo
Description copied from interface:ClientResponseContextGet the complete status information associated with the response.- Specified by:
getStatusInfoin interfaceClientResponseContext- Returns:
- the response status information or
nullif the status was not set.
-
setStatusInfo
Description copied from interface:ClientResponseContextSet the complete status information (status code and reason phrase) associated with the response.- Specified by:
setStatusInfoin interfaceClientResponseContext- Parameters:
statusInfo- the response status information.
-
getHeaders
Description copied from interface:ClientResponseContextGet the mutable response headers multivalued map.- Specified by:
getHeadersin interfaceClientResponseContext- Returns:
- mutable multivalued map of response headers.
- See Also:
-
getAllowedMethods
Description copied from interface:ClientResponseContextGet the allowed HTTP methods from the Allow HTTP header.- Specified by:
getAllowedMethodsin interfaceClientResponseContext- Returns:
- the allowed HTTP methods, all methods will returned as upper case strings.
-
getDate
Description copied from interface:ClientResponseContextGet message date.- Specified by:
getDatein interfaceClientResponseContext- Returns:
- the message date, otherwise
nullif not present.
-
getLanguage
Description copied from interface:ClientResponseContextGet the language of the entity.- Specified by:
getLanguagein interfaceClientResponseContext- Returns:
- the language of the entity or
nullif not specified
-
getLength
public int getLength()Description copied from interface:ClientResponseContextGet Content-Length value.- Specified by:
getLengthin interfaceClientResponseContext- Returns:
- Content-Length as integer if present and valid number. In other cases returns -1.
-
getMediaType
Description copied from interface:ClientResponseContextGet the media type of the entity.- Specified by:
getMediaTypein interfaceClientResponseContext- Returns:
- the media type or
nullif not specified (e.g. there's no response entity).
-
getCookies
Description copied from interface:ClientResponseContextGet any new cookies set on the response message.- Specified by:
getCookiesin interfaceClientResponseContext- Returns:
- a read-only map of cookie name (String) to a
new cookie.
-
getEntityTag
Description copied from interface:ClientResponseContextGet the entity tag.- Specified by:
getEntityTagin interfaceClientResponseContext- Returns:
- the entity tag, otherwise
nullif not present.
-
getLastModified
Description copied from interface:ClientResponseContextGet the last modified date.- Specified by:
getLastModifiedin interfaceClientResponseContext- Returns:
- the last modified date, otherwise
nullif not present.
-
getLocation
Description copied from interface:ClientResponseContextGet the location.- Specified by:
getLocationin interfaceClientResponseContext- Returns:
- the location URI, otherwise
nullif not present.
-
getLinks
Description copied from interface:ClientResponseContextGet the links attached to the message as header.- Specified by:
getLinksin interfaceClientResponseContext- Returns:
- links, may return empty
Setif no links are present. Never returnsnull.
-
hasLink
Description copied from interface:ClientResponseContextCheck if link for relation exists.- Specified by:
hasLinkin interfaceClientResponseContext- Parameters:
relation- link relation.- Returns:
trueif the for the relation link exists,falseotherwise.
-
getLink
Description copied from interface:ClientResponseContextGet the link for the relation.- Specified by:
getLinkin interfaceClientResponseContext- Parameters:
relation- link relation.- Returns:
- the link for the relation, otherwise
nullif not present.
-
getLinkBuilder
Description copied from interface:ClientResponseContextConvenience method that returns aLink.Builderfor the relation.- Specified by:
getLinkBuilderin interfaceClientResponseContext- Parameters:
relation- link relation.- Returns:
- the link builder for the relation, otherwise
nullif not present.
-
hasEntity
public boolean hasEntity()Description copied from interface:ClientResponseContextCheck if there is a non-empty entity input stream is available in the response message. The method returnstrueif the entity is present, returnsfalseotherwise.- Specified by:
hasEntityin interfaceClientResponseContext- Returns:
trueif there is an entity present in the message,falseotherwise.
-
getEntityStream
Description copied from interface:ClientResponseContextGet the entity input stream. The JAX-RS runtime is responsible for closing the input stream.- Specified by:
getEntityStreamin interfaceClientResponseContext- Returns:
- entity input stream.
-
setEntityStream
Description copied from interface:ClientResponseContextSet a new entity input stream. The JAX-RS runtime is responsible for closing the input stream.- Specified by:
setEntityStreamin interfaceClientResponseContext- Parameters:
entityStream- new entity input stream.
-
getHeaderString
Description copied from interface:ClientResponseContextGet a message header as a single string value.- Specified by:
getHeaderStringin interfaceClientResponseContext- Parameters:
name- the message header.- Returns:
- the message header value. If the message header is not present then
nullis 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. - See Also:
-
getClientResponse
-