Source Code Cross Referenced for Dispatcher.java in  » GIS » GeoServer » org » vfny » geoserver » servlets » 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 » GIS » GeoServer » org.vfny.geoserver.servlets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.servlets;
006:
007:        import org.vfny.geoserver.util.requests.readers.DispatcherKvpReader;
008:        import org.vfny.geoserver.util.requests.readers.KvpRequestReader;
009:        import java.io.IOException;
010:        import java.util.Map;
011:        import java.util.logging.Logger;
012:        import javax.servlet.ServletConfig;
013:        import javax.servlet.ServletException;
014:        import javax.servlet.http.HttpServlet;
015:        import javax.servlet.http.HttpServletRequest;
016:        import javax.servlet.http.HttpServletResponse;
017:
018:        /**
019:         * Routes requests made at the top-level URI to appropriate interface servlet.
020:         * Note that the logic of this method could be generously described as
021:         * 'loose.' It is not checking for request validity in any way (this is done
022:         * by the reqeust- specific servlets).  Rather, it is attempting to make a
023:         * reasonable guess as to what servlet to call, given that the client is
024:         * routing to the top level URI as opposed to the request-specific URI, as
025:         * specified in the GetCapabilities response. Thus, this is a convenience
026:         * method, which allows for some slight client laziness and helps explain to
027:         * lost souls/spiders what lives at the URL. Due to the string parsing, it is
028:         * much faster (and recommended) to use the URIs specified in the
029:         * GetCapabablities response.
030:         *
031:         * @author Rob Hranac, Vision for New York
032:         * @author Chris Holmes, TOPP
033:         * @version $Id: Dispatcher.java 7746 2007-11-13 15:38:35Z aaime $
034:         *
035:         * @task TODO: rework to work too for WMS servlets, and to get the servlets
036:         *       from ServletContext instead of having them hardcoded
037:         * @task TODO: move the post dispatcher work from WfsDispatcher up here.
038:         */
039:
040:        //JD: kill this class
041:        public class Dispatcher extends HttpServlet {
042:            /** Class logger */
043:            private static Logger LOGGER = org.geotools.util.logging.Logging
044:                    .getLogger("org.vfny.geoserver.servlets");
045:
046:            /** Map metadata request type */
047:            public static String META_REQUEST = "GetMeta";
048:
049:            /** Map get capabilities request type */
050:            public static final int GET_CAPABILITIES_REQUEST = 1;
051:
052:            /** Map describe feature type request type */
053:            public static final int DESCRIBE_FEATURE_TYPE_REQUEST = 2;
054:
055:            /** Map get feature  request type */
056:            public static final int GET_FEATURE_REQUEST = 3;
057:
058:            /** Map get feature request type */
059:            public static final int TRANSACTION_REQUEST = 4;
060:
061:            /** Map get feature with lock request type */
062:            public static final int GET_FEATURE_LOCK_REQUEST = 5;
063:
064:            /** WMS get feature info request type */
065:            public static final int GET_FEATURE_INFO_REQUEST = 6;
066:
067:            /** int representation of a lock request type */
068:            public static final int LOCK_REQUEST = 6;
069:
070:            /** Map get capabilities request type */
071:            public static final int GET_MAP_REQUEST = 7;
072:
073:            /** WMS DescribeLayer request type */
074:            public static final int DESCRIBE_LAYER_REQUEST = 8;
075:
076:            /** WMS GetLegendGraphic request type */
077:            public static final int GET_LEGEND_GRAPHIC_REQUEST = 9;
078:            public static final short WMS_SERVICE = 101;
079:            public static final short WFS_SERVICE = 102;
080:
081:            /** Map get feature  request type */
082:            public static final int UNKNOWN = -1;
083:
084:            /** Map get feature  request type */
085:            public static final int ERROR = -2;
086:            protected ServletConfig servletConfig;
087:
088:            //HACK! This is just to fix instances where the first request is a 
089:            //dispatcher, and the strategy hasn't been inited yet.  This can be
090:            //fixed in two ways, one by having Dispatcher extend Abstract ServiceConfig,
091:            //which it should do, and two by having the configuration of the strategy
092:            //done in user configuration instead of in the web.xml file.  Both should
093:            //be done.
094:            public void init(ServletConfig config) throws ServletException {
095:                super .init(config);
096:                this .servletConfig = config;
097:            }
098:
099:            /**
100:             * Handles all Get requests.  This method implements the main matching
101:             * logic for the class.
102:             *
103:             * @param request The servlet request object.
104:             * @param response The servlet response object.
105:             *
106:             * @throws ServletException For any servlet problems.
107:             * @throws IOException For any io problems.
108:             */
109:            public void doGet(HttpServletRequest request,
110:                    HttpServletResponse response) throws ServletException,
111:                    IOException {
112:                int targetRequest = 0;
113:
114:                // Examine the incoming request and create appropriate server objects
115:                //  to deal with each request
116:                //              try {
117:                if (request.getQueryString() != null) {
118:                    Map kvPairs = KvpRequestReader.parseKvpSet(request
119:                            .getQueryString());
120:                    targetRequest = DispatcherKvpReader.getRequestType(kvPairs);
121:                } else {
122:                    targetRequest = UNKNOWN;
123:
124:                    //throw exception
125:                }
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.