Package jakarta.ws.rs.client
Interface ClientResponseContext
public interface ClientResponseContext
Client 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.
- Since:
- 2.0
- Author:
- Marek Potociar
- 
Method SummaryModifier and Type Method 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.DategetDate()Get message date.InputStreamgetEntityStream()Get the entity input stream.EntityTaggetEntityTag()Get the entity tag.MultivaluedMap<String,String>getHeaders()Get the mutable response headers multivalued map.StringgetHeaderString(String name)Get a message header as a single string value.LocalegetLanguage()Get the language of the entity.DategetLastModified()Get the last modified date.intgetLength()Get Content-Length value.LinkgetLink(String relation)Get the link for the relation.Link.BuildergetLinkBuilder(String relation)Convenience method that returns aLink.Builderfor the relation.Set<Link>getLinks()Get the links attached to the message as header.URIgetLocation()Get the location.MediaTypegetMediaType()Get the media type of the entity.intgetStatus()Get the status code associated with the response.Response.StatusTypegetStatusInfo()Get the complete status information associated with the response.booleanhasEntity()Check if there is a non-empty entity input stream is available in the response message.booleanhasLink(String relation)Check if link for relation exists.voidsetEntityStream(InputStream input)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.
- 
Method Details- 
getStatusint getStatus()Get the status code associated with the response.- Returns:
- the response status code or -1 if the status was not set.
 
- 
setStatusvoid setStatus(int code)Set a new response status code.- Parameters:
- code- new status code.
 
- 
getStatusInfoResponse.StatusType getStatusInfo()Get the complete status information associated with the response.- Returns:
- the response status information or nullif the status was not set.
 
- 
setStatusInfoSet the complete status information (status code and reason phrase) associated with the response.- Parameters:
- statusInfo- the response status information.
 
- 
getHeadersMultivaluedMap<String,String> getHeaders()Get the mutable response headers multivalued map.- Returns:
- mutable multivalued map of response headers.
- See Also:
- getHeaderString(String)
 
- 
getHeaderStringGet a message header as a single string value.- 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:
- getHeaders()
 
- 
getAllowedMethodsGet the allowed HTTP methods from the Allow HTTP header.- Returns:
- the allowed HTTP methods, all methods will returned as upper case strings.
 
- 
getDateDate getDate()Get message date.- Returns:
- the message date, otherwise nullif not present.
 
- 
getLanguageLocale getLanguage()Get the language of the entity.- Returns:
- the language of the entity or nullif not specified
 
- 
getLengthint getLength()Get Content-Length value.- Returns:
- Content-Length as integer if present and valid number. In other cases returns -1.
 
- 
getMediaTypeMediaType getMediaType()Get the media type of the entity.- Returns:
- the media type or nullif not specified (e.g. there's no response entity).
 
- 
getCookiesGet any new cookies set on the response message.- Returns:
- a read-only map of cookie name (String) to a new cookie.
 
- 
getEntityTagEntityTag getEntityTag()Get the entity tag.- Returns:
- the entity tag, otherwise nullif not present.
 
- 
getLastModifiedDate getLastModified()Get the last modified date.- Returns:
- the last modified date, otherwise nullif not present.
 
- 
getLocationURI getLocation()Get the location.- Returns:
- the location URI, otherwise nullif not present.
 
- 
getLinksGet the links attached to the message as header.- Returns:
- links, may return empty Setif no links are present. Never returnsnull.
 
- 
hasLinkCheck if link for relation exists.- Parameters:
- relation- link relation.
- Returns:
- trueif the for the relation link exists,- falseotherwise.
 
- 
getLinkGet the link for the relation.- Parameters:
- relation- link relation.
- Returns:
- the link for the relation, otherwise nullif not present.
 
- 
getLinkBuilderConvenience method that returns aLink.Builderfor the relation.- Parameters:
- relation- link relation.
- Returns:
- the link builder for the relation, otherwise nullif not present.
 
- 
hasEntityboolean hasEntity()Check if there is a non-empty entity input stream is available in the response message. The method returnstrueif the entity is present, returnsfalseotherwise.- Returns:
- trueif there is an entity present in the message,- falseotherwise.
 
- 
getEntityStreamInputStream getEntityStream()Get the entity input stream. The JAX-RS runtime is responsible for closing the input stream.- Returns:
- entity input stream.
 
- 
setEntityStreamSet a new entity input stream. The JAX-RS runtime is responsible for closing the input stream.- Parameters:
- input- new entity input stream.
 
 
-