Java Doc for Redirector.java in  » Web-Services » restlet-1.0.8 » org » restlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » restlet 1.0.8 » org.restlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.restlet.Uniform
      org.restlet.Restlet
         org.restlet.Redirector

Redirector
public class Redirector extends Restlet (Code)
Rewrites URIs then redirects the call or the client to a new destination.
See Also:   org.restlet.util.Template
See Also:    Tutorial: URI rewriting * and redirection
author:
   Jerome Louvel (contact@noelios.com)


Field Summary
final public static  intMODE_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  intMODE_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  intMODE_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  intMODE_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  intMODE_DISPATCHER
     In this mode, the call is sent to the context's dispatcher.
protected  intmode
     The redirection mode.
protected  StringtargetTemplate
     The target URI pattern.

Constructor Summary
public  Redirector(Context context, String targetTemplate)
     Constructor for the dispatcher mode.
public  Redirector(Context context, String targetPattern, int mode)
     Constructor.

Method Summary
protected  ReferencegetTargetRef(Request request, Response response)
     Returns the target reference to redirect to.
Parameters:
  request - The request to handle.
Parameters:
  response - The response to update.
public  voidhandle(Request request, Response response)
     Handles a call to a resource or a set of resources.
protected  voidredirectDispatcher(Reference targetRef, Request request, Response response)
     Redirects a given call to a target reference.
protected  Representationrewrite(Representation initialEntity)
     Optionnaly rewrites the response entity returned in the MODE_CONNECTOR mode.

Field Detail
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.




Constructor Detail
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.




Method Detail
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.



Methods inherited from org.restlet.Restlet
public Context getContext()(Code)(Java Doc)
public Logger getLogger()(Code)(Java Doc)
public void handle(Request request, Response response)(Code)(Java Doc)
protected synchronized void init(Request request, Response response)(Code)(Java Doc)
public synchronized boolean isStarted()(Code)(Java Doc)
public synchronized boolean isStopped()(Code)(Java Doc)
public void setContext(Context context)(Code)(Java Doc)
public synchronized void start() throws Exception(Code)(Java Doc)
public synchronized void stop() throws Exception(Code)(Java Doc)

Methods inherited from org.restlet.Uniform
final public Response delete(String resourceUri)(Code)(Java Doc)
final public Response delete(Reference resourceRef)(Code)(Java Doc)
final public Response get(String resourceUri)(Code)(Java Doc)
final public Response get(Reference resourceRef)(Code)(Java Doc)
final public Response handle(Request request)(Code)(Java Doc)
abstract public void handle(Request request, Response response)(Code)(Java Doc)
final public Response head(String resourceUri)(Code)(Java Doc)
final public Response head(Reference resourceRef)(Code)(Java Doc)
final public Response options(String resourceUri)(Code)(Java Doc)
final public Response options(Reference resourceRef)(Code)(Java Doc)
final public Response post(String resourceUri, Representation entity)(Code)(Java Doc)
final public Response post(Reference resourceRef, Representation entity)(Code)(Java Doc)
final public Response put(String resourceUri, Representation entity)(Code)(Java Doc)
final public Response put(Reference resourceRef, Representation entity)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.