org.restlet.data
Class Response

java.lang.Object
  extended by org.restlet.data.Message
      extended by org.restlet.data.Response
Direct Known Subclasses:
WrapperResponse

public class Response
extends Message

Generic response sent by server connectors. It is then received by client connectors. Responses are uniform across all types of connectors, protocols and components.

Author:
Jerome Louvel (contact@noelios.com)
See Also:
Request, Uniform

Constructor Summary
Response(Request request)
          Constructor.
 
Method Summary
 Set<Method> getAllowedMethods()
          Returns the set of methods allowed on the requested resource.
 ChallengeRequest getChallengeRequest()
          Returns the authentication request sent by an origin server to a client.
 Series<CookieSetting> getCookieSettings()
          Returns the cookie settings provided by the server.
 Set<Dimension> getDimensions()
          Returns the set of selecting dimensions on which the response entity may vary.
 Reference getRedirectRef()
          Returns the reference that the client should follow for redirections or resource creations.
 Request getRequest()
          Returns the associated request
 ServerInfo getServerInfo()
          Returns the server-specific information.
 Status getStatus()
          Returns the status.
 void redirectPermanent(Reference targetRef)
          Permanently redirects the client to a target URI.
 void redirectPermanent(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(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(String targetUri)
          Temporarily redirects the client to a target URI.
 void setChallengeRequest(ChallengeRequest request)
          Sets the authentication request sent by an origin server to a client.
 void setRedirectRef(Reference redirectRef)
          Sets the reference that the client should follow for redirections or resource creations.
 void setRedirectRef(String redirectUri)
          Sets the reference that the client should follow for redirections or resource creations.
 void setRequest(Request request)
          Sets the associated request.
 void setStatus(Status status)
          Sets the status.
 void setStatus(Status status, String message)
          Sets the status.
 
Methods inherited from class org.restlet.data.Message
getAttributes, getEntity, getEntityAsDom, getEntityAsForm, getEntityAsObject, getEntityAsSax, isEntityAvailable, setEntity, setEntity, setEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response(Request request)
Constructor.

Parameters:
request - The request associated to this response.
Method Detail

getAllowedMethods

public Set<Method> getAllowedMethods()
Returns the set of methods allowed on the requested resource. This property only has to be updated when a status CLIENT_ERROR_METHOD_NOT_ALLOWED is set.

Returns:
The list of allowed methods.

getChallengeRequest

public ChallengeRequest getChallengeRequest()
Returns the authentication request sent by an origin server to a client.

Returns:
The authentication request sent by an origin server to a client.

getCookieSettings

public Series<CookieSetting> getCookieSettings()
Returns the cookie settings provided by the server.

Returns:
The cookie settings provided by the server.

getDimensions

public Set<Dimension> getDimensions()
Returns the set of selecting dimensions on which the response entity may vary. If some server-side content negotiation is done, this set should be properly updated, other it can be left empty.

Returns:
The set of dimensions on which the response entity may vary.

getRedirectRef

public Reference getRedirectRef()
Returns the reference that the client should follow for redirections or resource creations.

Returns:
The redirection reference.

getRequest

public Request getRequest()
Returns the associated request

Returns:
The associated request

getServerInfo

public ServerInfo getServerInfo()
Returns the server-specific information.

Returns:
The server-specific information.

getStatus

public Status getStatus()
Returns the status.

Returns:
The status.

redirectPermanent

public void redirectPermanent(String targetUri)
Permanently redirects the client to a target URI. The client is expected to reuse the same method for the new request.

Parameters:
targetUri - The target URI.

redirectPermanent

public void redirectPermanent(Reference targetRef)
Permanently redirects the client to a target URI. The client is expected to reuse the same method for the new request.

Parameters:
targetRef - The target URI reference.

redirectSeeOther

public void redirectSeeOther(String targetUri)
Redirects the client to a different URI that SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource.

Parameters:
targetUri - The target URI.

redirectSeeOther

public void redirectSeeOther(Reference targetRef)
Redirects the client to a different URI that SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource.

Parameters:
targetRef - The target reference.

redirectTemporary

public void redirectTemporary(String targetUri)
Temporarily redirects the client to a target URI. The client is expected to reuse the same method for the new request.

Parameters:
targetUri - The target URI.

redirectTemporary

public void redirectTemporary(Reference targetRef)
Temporarily redirects the client to a target URI. The client is expected to reuse the same method for the new request.

Parameters:
targetRef - The target reference.

setChallengeRequest

public void setChallengeRequest(ChallengeRequest request)
Sets the authentication request sent by an origin server to a client.

Parameters:
request - The authentication request sent by an origin server to a client.

setRedirectRef

public void setRedirectRef(Reference redirectRef)
Sets the reference that the client should follow for redirections or resource creations.

Parameters:
redirectRef - The redirection reference.

setRedirectRef

public void setRedirectRef(String redirectUri)
Sets the reference that the client should follow for redirections or resource creations.

Parameters:
redirectUri - The redirection URI.

setRequest

public void setRequest(Request request)
Sets the associated request.

Parameters:
request - The associated request

setStatus

public void setStatus(Status status)
Sets the status.

Parameters:
status - The status to set.

setStatus

public void setStatus(Status status,
                      String message)
Sets the status.

Parameters:
status - The status to set.
message - The status message.


Copyright © 2005-2007 Noelios Consulting.