public class WrapperResponse extends Response
Constructor and Description |
---|
WrapperResponse(Response wrappedResponse)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Ask the connector to abort the related network connection, for example
immediately closing the socket.
|
void |
commit()
Asks the server connector to immediately commit the given response,
making it ready to be sent back to the client.
|
int |
getAge()
Returns the estimated amount of time since a response was generated or
revalidated by the origin server.
|
java.util.Set<Method> |
getAllowedMethods()
Returns the set of methods allowed on the requested resource.
|
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> |
getAttributes()
Returns a modifiable attributes map that can be used by developers to
save information relative to the message.
|
AuthenticationInfo |
getAuthenticationInfo()
Returns information sent by an origin server related to an successful
authentication attempt.
|
java.util.List<ChallengeRequest> |
getChallengeRequests()
Returns the list of authentication requests sent by an origin server to a
client.
|
Series<CookieSetting> |
getCookieSettings()
Returns the cookie settings provided by the server.
|
java.util.Set<Dimension> |
getDimensions()
Returns the set of selecting dimensions on which the response entity may
vary.
|
Representation |
getEntity()
Returns the entity representation.
|
Reference |
getLocationRef()
Returns the reference that the client should follow for redirections or
resource creations.
|
java.util.List<ChallengeRequest> |
getProxyChallengeRequests()
Returns the list of authentication requests sent by a proxy to a client.
|
Request |
getRequest()
Returns the associated request
|
java.util.Date |
getRetryAfter()
Indicates how long the service is expected to be unavailable to the
requesting client.
|
ServerInfo |
getServerInfo()
Returns the server-specific information.
|
Status |
getStatus()
Returns the status.
|
protected Response |
getWrappedResponse()
Returns the wrapped response.
|
boolean |
isAutoCommitting()
Indicates if the response should be automatically committed.
|
boolean |
isCommitted()
Indicates if the response has already been committed.
|
boolean |
isConfidential()
Indicates if the call came over a confidential channel such as an
SSL-secured connection.
|
boolean |
isEntityAvailable()
Indicates if a content is available and can be sent.
|
void |
redirectPermanent(Reference targetRef)
Permanently redirects the client to a target URI.
|
void |
redirectPermanent(java.lang.String targetUri)
Permanently redirects the client to a target URI.
|
void |
redirectSeeOther(Reference targetRef)
Redirects the client to a different URI that SHOULD be retrieved using a
GET method on that resource.
|
void |
redirectSeeOther(java.lang.String targetUri)
Redirects the client to a different URI that SHOULD be retrieved using a
GET method on that resource.
|
void |
redirectTemporary(Reference targetRef)
Temporarily redirects the client to a target URI.
|
void |
redirectTemporary(java.lang.String targetUri)
Temporarily redirects the client to a target URI.
|
void |
setAge(int age)
Sets the estimated amount of time since a response was generated or
revalidated by the origin server.
|
void |
setAllowedMethods(java.util.Set<Method> allowedMethods)
Sets the set of methods allowed on the requested resource.
|
void |
setAuthenticationInfo(AuthenticationInfo authenticationInfo)
Sets the authentication information sent by an origin server to a client
after a successful authentication attempt.
|
void |
setAutoCommitting(boolean autoCommitting)
Indicates if the response should be automatically committed.
|
void |
setChallengeRequests(java.util.List<ChallengeRequest> requests)
Sets the list of authentication requests sent by an origin server to a
client.
|
void |
setCommitted(boolean committed)
Indicates if the response has already been committed.
|
void |
setCookieSettings(Series<CookieSetting> cookieSettings)
Sets the modifiable series of cookie settings provided by the server.
|
void |
setDimensions(java.util.Set<Dimension> dimensions)
Sets the set of dimensions on which the response entity may vary.
|
void |
setEntity(Representation entity)
Sets the entity representation.
|
void |
setEntity(java.lang.String value,
MediaType mediaType)
Sets a textual entity.
|
void |
setLocationRef(Reference locationRef)
Sets the reference that the client should follow for redirections or
resource creations.
|
void |
setLocationRef(java.lang.String locationUri)
Sets the reference that the client should follow for redirections or
resource creations.
|
void |
setProxyChallengeRequests(java.util.List<ChallengeRequest> requests)
Sets the list of authentication requests sent by a proxy to a client.
|
void |
setRequest(Request request)
Sets the associated request.
|
void |
setRequest(WrapperRequest request)
Sets the associated request.
|
void |
setRetryAfter(java.util.Date retryAfter)
Indicates how long the service is expected to be unavailable to the
requesting client.
|
void |
setServerInfo(ServerInfo serverInfo)
Sets the server-specific information.
|
void |
setStatus(Status status)
Sets the status.
|
void |
setStatus(Status status,
java.lang.String message)
Sets the status.
|
void |
setStatus(Status status,
java.lang.Throwable throwable)
Sets the status.
|
void |
setStatus(Status status,
java.lang.Throwable throwable,
java.lang.String message)
Sets the status.
|
java.lang.String |
toString()
Displays a synthesis of the response like an HTTP status line.
|
flushBuffers, getAccessControlAllowCredentials, getAccessControlAllowHeaders, getAccessControlAllowMethods, getAccessControlAllowOrigin, getAccessControlExposeHeaders, getAccessControlMaxAge, isFinal, isProvisional, setAccessControlAllowCredentials, setAccessControlAllowHeaders, setAccessControlAllowMethods, setAccessControlAllowOrigin, setAccessControlExposeHeaders, setAccessControlMaxAge
getCacheDirectives, getDate, getHeaders, getOnError, getOnSent, getRecipientsInfo, getWarnings, release, setAttributes, setCacheDirectives, setDate, setOnError, setOnSent, setRecipientsInfo, setWarnings
public WrapperResponse(Response wrappedResponse)
wrappedResponse
- The wrapped response.public void abort()
Response
public void commit()
Response
Request.commit(Response)
on the parent
request which holds the link with the underlying network connection.public int getAge()
Response
public java.util.Set<Method> getAllowedMethods()
getAllowedMethods
in class Response
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getAttributes()
Attribute name | Class name | Description |
---|---|---|
org.restlet.client.http.headers | org.restlet.client.data.Form | Server HTTP connectors must provide all request headers and client HTTP connectors must provide all response headers, exactly as they were received. In addition, developers can also use this attribute to specify non-standard headers that should be added to the request or to the response. |
getAttributes
in class Message
public AuthenticationInfo getAuthenticationInfo()
Response
getAuthenticationInfo
in class Response
public java.util.List<ChallengeRequest> getChallengeRequests()
getChallengeRequests
in class Response
public Series<CookieSetting> getCookieSettings()
getCookieSettings
in class Response
public java.util.Set<Dimension> getDimensions()
getDimensions
in class Response
public Representation getEntity()
public Reference getLocationRef()
getLocationRef
in class Response
public java.util.List<ChallengeRequest> getProxyChallengeRequests()
getProxyChallengeRequests
in class Response
public Request getRequest()
getRequest
in class Response
public java.util.Date getRetryAfter()
Response
getRetryAfter
in class Response
public ServerInfo getServerInfo()
getServerInfo
in class Response
public Status getStatus()
protected Response getWrappedResponse()
public boolean isAutoCommitting()
Response
Response.commit()
later on, using another thread.isAutoCommitting
in class Response
public boolean isCommitted()
Response
isCommitted
in class Response
public boolean isConfidential()
isConfidential
in class Response
public boolean isEntityAvailable()
isEntityAvailable
in class Message
public void redirectPermanent(Reference targetRef)
redirectPermanent
in class Response
targetRef
- The target URI reference.public void redirectPermanent(java.lang.String targetUri)
redirectPermanent
in class Response
targetUri
- The target URI.public void redirectSeeOther(Reference targetRef)
redirectSeeOther
in class Response
targetRef
- The target reference.public void redirectSeeOther(java.lang.String targetUri)
redirectSeeOther
in class Response
targetUri
- The target URI.public void redirectTemporary(Reference targetRef)
redirectTemporary
in class Response
targetRef
- The target reference.public void redirectTemporary(java.lang.String targetUri)
redirectTemporary
in class Response
targetUri
- The target URI.public void setAge(int age)
Response
public void setAllowedMethods(java.util.Set<Method> allowedMethods)
Response
CopyOnWriteArraySet
for
example.setAllowedMethods
in class Response
allowedMethods
- The set of methods allowed on the requested resource.public void setAuthenticationInfo(AuthenticationInfo authenticationInfo)
Response
setAuthenticationInfo
in class Response
authenticationInfo
- The data returned by the server in response to successful
authentication.public void setAutoCommitting(boolean autoCommitting)
Response
setAutoCommitting
in class Response
autoCommitting
- True if the response should be automatically committedpublic void setChallengeRequests(java.util.List<ChallengeRequest> requests)
setChallengeRequests
in class Response
requests
- The list of authentication requests sent by an origin server
to a client.public void setCommitted(boolean committed)
Response
setCommitted
in class Response
committed
- True if the response has already been committed.public void setCookieSettings(Series<CookieSetting> cookieSettings)
Response
setCookieSettings
in class Response
cookieSettings
- A series of cookie settings provided by the server.public void setDimensions(java.util.Set<Dimension> dimensions)
Response
setDimensions
in class Response
dimensions
- The set of dimensions on which the response entity may vary.public void setEntity(Representation entity)
public void setEntity(java.lang.String value, MediaType mediaType)
public void setLocationRef(Reference locationRef)
setLocationRef
in class Response
locationRef
- The reference to set.public void setLocationRef(java.lang.String locationUri)
setLocationRef
in class Response
locationUri
- The URI to set.Response.setLocationRef(Reference)
public void setProxyChallengeRequests(java.util.List<ChallengeRequest> requests)
setProxyChallengeRequests
in class Response
requests
- The list of authentication requests sent by a proxy to a
client.public void setRequest(Request request)
setRequest
in class Response
request
- The associated requestpublic void setRequest(WrapperRequest request)
request
- The associated requestpublic void setRetryAfter(java.util.Date retryAfter)
Response
setRetryAfter
in class Response
retryAfter
- Date after with a retry attempt could occur.public void setServerInfo(ServerInfo serverInfo)
Response
setServerInfo
in class Response
serverInfo
- The server-specific information.public void setStatus(Status status)
public void setStatus(Status status, java.lang.String message)
public void setStatus(Status status, java.lang.Throwable throwable)
Response
public void setStatus(Status status, java.lang.Throwable throwable, java.lang.String message)
Response
Copyright © 2005-2024 Restlet.