| java.lang.Object org.restlet.Uniform org.restlet.Restlet org.restlet.Redirector
Field Summary | |
final public static int | MODE_CLIENT_FOUND In this mode, the client is simply redirected to the URI generated from
the target URI pattern. See
org.restlet.data.Status.REDIRECTION_FOUND. | final public static int | MODE_CLIENT_PERMANENT In this mode, the client is permanently redirected to the URI generated
from the target URI pattern. See
org.restlet.data.Status.REDIRECTION_PERMANENT. | final public static int | MODE_CLIENT_SEE_OTHER In this mode, the client is simply redirected to the URI generated from
the target URI pattern. See
org.restlet.data.Status.REDIRECTION_SEE_OTHER. | final public static int | MODE_CLIENT_TEMPORARY In this mode, the client is temporarily redirected to the URI generated
from the target URI pattern. See
org.restlet.data.Status.REDIRECTION_TEMPORARY. | final public static int | MODE_DISPATCHER In this mode, the call is sent to the context's dispatcher. | protected int | mode The redirection mode. | protected String | targetTemplate The target URI pattern. |
MODE_CLIENT_FOUND | final public static int MODE_CLIENT_FOUND(Code) | | In this mode, the client is simply redirected to the URI generated from
the target URI pattern. See
org.restlet.data.Status.REDIRECTION_FOUND.
|
MODE_CLIENT_PERMANENT | final public static int MODE_CLIENT_PERMANENT(Code) | | In this mode, the client is permanently redirected to the URI generated
from the target URI pattern. See
org.restlet.data.Status.REDIRECTION_PERMANENT.
|
MODE_CLIENT_SEE_OTHER | final public static int MODE_CLIENT_SEE_OTHER(Code) | | In this mode, the client is simply redirected to the URI generated from
the target URI pattern. See
org.restlet.data.Status.REDIRECTION_SEE_OTHER.
|
MODE_CLIENT_TEMPORARY | final public static int MODE_CLIENT_TEMPORARY(Code) | | In this mode, the client is temporarily redirected to the URI generated
from the target URI pattern. See
org.restlet.data.Status.REDIRECTION_TEMPORARY.
|
MODE_DISPATCHER | final public static int MODE_DISPATCHER(Code) | | In this mode, the call is sent to the context's dispatcher. Once the
selected client connector has completed the request handling, the
response is normally returned to the client. In this case, you can view
the Redirector as acting as a transparent proxy Restlet.
Remember to add the required connectors to the parent Component and to
declare them in the list of required connectors on the
Application.connectorService property.
Note that in this mode, the headers of HTTP requests, stored in the
request's attributes, are removed before dispatching. Also, when a HTTP
response comes back the headers are also removed.
|
mode | protected int mode(Code) | | The redirection mode.
|
targetTemplate | protected String targetTemplate(Code) | | The target URI pattern.
|
Redirector | public Redirector(Context context, String targetTemplate)(Code) | | Constructor for the dispatcher mode.
Parameters: context - The context. Parameters: targetTemplate - The template to build the target URI. See Also: org.restlet.util.Template |
Redirector | public Redirector(Context context, String targetPattern, int mode)(Code) | | Constructor.
Parameters: context - The context. Parameters: targetPattern - The pattern to build the target URI (using StringTemplatesyntax and the CallModel for variables). Parameters: mode - The redirection mode. |
getTargetRef | protected Reference getTargetRef(Request request, Response response)(Code) | | Returns the target reference to redirect to.
Parameters: request - The request to handle. Parameters: response - The response to update. The target reference to redirect to. |
handle | public void handle(Request request, Response response)(Code) | | Handles a call to a resource or a set of resources.
Parameters: request - The request to handle. Parameters: response - The response to update. |
redirectDispatcher | protected void redirectDispatcher(Reference targetRef, Request request, Response response)(Code) | | Redirects a given call to a target reference. In the default
implementation, the request HTTP headers, stored in the request's
attributes, are removed before dispatching. After dispatching, the
response HTTP headers are also removed to prevent conflicts with the main
call.
Parameters: targetRef - The target reference with URI variables resolved. Parameters: request - The request to handle. Parameters: response - The response to update. |
rewrite | protected Representation rewrite(Representation initialEntity)(Code) | | Optionnaly rewrites the response entity returned in the MODE_CONNECTOR
mode. By default, it just returns the initial entity without any
modification.
Parameters: initialEntity - The initial entity returned. The rewritten entity. |
|
|