Source Code Cross Referenced for Uniform.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 Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2007 Noelios Consulting.
003:         * 
004:         * The contents of this file are subject to the terms of the Common Development
005:         * and Distribution License (the "License"). You may not use this file except in
006:         * compliance with the License.
007:         * 
008:         * You can obtain a copy of the license at
009:         * http://www.opensource.org/licenses/cddl1.txt See the License for the specific
010:         * language governing permissions and limitations under the License.
011:         * 
012:         * When distributing Covered Code, include this CDDL HEADER in each file and
013:         * include the License file at http://www.opensource.org/licenses/cddl1.txt If
014:         * applicable, add the following below this CDDL HEADER, with the fields
015:         * enclosed by brackets "[]" replaced with your own identifying information:
016:         * Portions Copyright [yyyy] [name of copyright owner]
017:         */
018:
019:        package org.restlet;
020:
021:        import org.restlet.data.Method;
022:        import org.restlet.data.Reference;
023:        import org.restlet.data.Request;
024:        import org.restlet.data.Response;
025:        import org.restlet.resource.Representation;
026:
027:        /**
028:         * Base class exposing the uniform REST interface. 
029:         * 
030:         * "The central feature that distinguishes the REST architectural style from
031:         * other network-based styles is its emphasis on a uniform interface between
032:         * components. By applying the software engineering principle of generality to
033:         * the component interface, the overall system architecture is simplified and
034:         * the visibility of interactions is improved. Implementations are decoupled
035:         * from the services they provide, which encourages independent evolvability."
036:         * Roy T. Fielding<br/> <br/>
037:         * 
038:         * @see <a
039:         *      href="http://roy.gbiv.com/pubs/dissertation/rest_arch_style.htm#sec_5_1_5">Source
040:         *      dissertation</a>
041:         * @author Jerome Louvel (contact@noelios.com)
042:         */
043:        public abstract class Uniform {
044:            /**
045:             * Deletes the identified resource.
046:             * 
047:             * @param resourceUri
048:             *            The URI of the resource to delete.
049:             * @return The response.
050:             */
051:            public final Response delete(String resourceUri) {
052:                return handle(new Request(Method.DELETE, resourceUri));
053:            }
054:
055:            /**
056:             * Deletes the identified resource.
057:             * 
058:             * @param resourceRef
059:             *            The reference of the resource to delete.
060:             * @return The response.
061:             */
062:            public final Response delete(Reference resourceRef) {
063:                return handle(new Request(Method.DELETE, resourceRef));
064:            }
065:
066:            /**
067:             * Gets the identified resource.
068:             * 
069:             * @param resourceUri
070:             *            The URI of the resource to get.
071:             * @return The response.
072:             */
073:            public final Response get(String resourceUri) {
074:                return handle(new Request(Method.GET, resourceUri));
075:            }
076:
077:            /**
078:             * Gets the identified resource.
079:             * 
080:             * @param resourceRef
081:             *            The reference of the resource to get.
082:             * @return The response.
083:             */
084:            public final Response get(Reference resourceRef) {
085:                return handle(new Request(Method.GET, resourceRef));
086:            }
087:
088:            /**
089:             * Handles a call.
090:             * 
091:             * @param request
092:             *            The request to handle.
093:             * @return The returned response.
094:             */
095:            public final Response handle(Request request) {
096:                Response response = new Response(request);
097:                handle(request, response);
098:                return response;
099:            }
100:
101:            /**
102:             * Handles a call.
103:             * 
104:             * @param request
105:             *            The request to handle.
106:             * @param response
107:             *            The response to update.
108:             */
109:            public abstract void handle(Request request, Response response);
110:
111:            /**
112:             * Gets the identified resource without its representation's content.
113:             * 
114:             * @param resourceUri
115:             *            The URI of the resource to get.
116:             * @return The response.
117:             */
118:            public final Response head(String resourceUri) {
119:                return handle(new Request(Method.HEAD, resourceUri));
120:            }
121:
122:            /**
123:             * Gets the identified resource without its representation's content.
124:             * 
125:             * @param resourceRef
126:             *            The reference of the resource to get.
127:             * @return The response.
128:             */
129:            public final Response head(Reference resourceRef) {
130:                return handle(new Request(Method.HEAD, resourceRef));
131:            }
132:
133:            /**
134:             * Gets the options for the identified resource.
135:             * 
136:             * @param resourceUri
137:             *            The URI of the resource to get.
138:             * @return The response.
139:             */
140:            public final Response options(String resourceUri) {
141:                return handle(new Request(Method.OPTIONS, resourceUri));
142:            }
143:
144:            /**
145:             * Gets the options for the identified resource.
146:             * 
147:             * @param resourceRef
148:             *            The reference of the resource to get.
149:             * @return The response.
150:             */
151:            public final Response options(Reference resourceRef) {
152:                return handle(new Request(Method.OPTIONS, resourceRef));
153:            }
154:
155:            /**
156:             * Posts a representation to the identified resource.
157:             * 
158:             * @param resourceUri
159:             *            The URI of the resource to post to.
160:             * @param entity
161:             *            The entity to post.
162:             * @return The response.
163:             */
164:            public final Response post(String resourceUri, Representation entity) {
165:                return handle(new Request(Method.POST, resourceUri, entity));
166:            }
167:
168:            /**
169:             * Posts a representation to the identified resource.
170:             * 
171:             * @param resourceRef
172:             *            The reference of the resource to post to.
173:             * @param entity
174:             *            The entity to post.
175:             * @return The response.
176:             */
177:            public final Response post(Reference resourceRef,
178:                    Representation entity) {
179:                return handle(new Request(Method.POST, resourceRef, entity));
180:            }
181:
182:            /**
183:             * Puts a representation in the identified resource.
184:             * 
185:             * @param resourceUri
186:             *            The URI of the resource to modify.
187:             * @param entity
188:             *            The entity to put.
189:             * @return The response.
190:             */
191:            public final Response put(String resourceUri, Representation entity) {
192:                return handle(new Request(Method.PUT, resourceUri, entity));
193:            }
194:
195:            /**
196:             * Puts a representation in the identified resource.
197:             * 
198:             * @param resourceRef
199:             *            The reference of the resource to modify.
200:             * @param entity
201:             *            The entity to put.
202:             * @return The response.
203:             */
204:            public final Response put(Reference resourceRef,
205:                    Representation entity) {
206:                return handle(new Request(Method.PUT, resourceRef, entity));
207:            }
208:
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.