Source Code Cross Referenced for DescribeLayerKvpRequestReader.java in  » GIS » GeoServer » org » vfny » geoserver » wms » requests » 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.wms.requests 
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.wms.requests;
006:
007:        import org.vfny.geoserver.Request;
008:        import org.vfny.geoserver.ServiceException;
009:        import org.vfny.geoserver.global.CoverageInfo;
010:        import org.vfny.geoserver.global.Data;
011:        import org.vfny.geoserver.global.FeatureTypeInfo;
012:        import org.vfny.geoserver.global.MapLayerInfo;
013:        import org.vfny.geoserver.wms.WmsException;
014:        import org.vfny.geoserver.wms.servlets.WMService;
015:        import java.util.List;
016:        import java.util.Map;
017:        import java.util.NoSuchElementException;
018:        import java.util.logging.Level;
019:        import java.util.logging.Logger;
020:        import javax.servlet.http.HttpServletRequest;
021:
022:        /**
023:         * Parses a DescribeLayer request, wich consists only of a list of
024:         * layer names, given by the <code>"LAYER"</code> parameter.
025:         *
026:         *
027:         * @author Gabriel Roldan, Axios Engineering
028:         * @version $Id: DescribeLayerKvpRequestReader.java 7746 2007-11-13 15:38:35Z aaime $
029:         */
030:        public class DescribeLayerKvpRequestReader extends WmsKvpRequestReader {
031:            /** package's logger  */
032:            private static final Logger LOGGER = org.geotools.util.logging.Logging
033:                    .getLogger(DescribeLayerKvpRequestReader.class.getPackage()
034:                            .getName());
035:
036:            /**
037:             * Constructs a new DescribeLayer request parser.
038:             * @param params
039:             * @param service The service that handles the request
040:             */
041:            public DescribeLayerKvpRequestReader(Map params, WMService service) {
042:                super (params, service);
043:            }
044:
045:            /**
046:             * Does the request parsing and constructs a <code>DescribeLayerRequest</code>,
047:             * wich holds the requiered layers as <code>FeatureTypeInfo</code> references.
048:             *
049:             * @param request the original request.
050:             *
051:             * @return the parsed and validated <code>DescribeLayerRequest</code>
052:             *
053:             * @throws ServiceException see "throws WmsException"...
054:             * @throws WmsException if no layers has been requested, or
055:             * one of the requested layers does not exists on this
056:             * server instance.
057:             */
058:            public Request getRequest(HttpServletRequest request)
059:                    throws ServiceException {
060:                DescribeLayerRequest req = new DescribeLayerRequest(
061:                        (WMService) service);
062:                req.setHttpServletRequest(request);
063:
064:                String layersParam = getValue("LAYERS");
065:
066:                if (LOGGER.isLoggable(Level.FINE)) {
067:                    LOGGER.fine(layersParam);
068:                }
069:
070:                List layers = readFlat(layersParam, INNER_DELIMETER);
071:
072:                if (LOGGER.isLoggable(Level.FINE)) {
073:                    LOGGER.fine(layers.toString());
074:                }
075:
076:                int layerCount = layers.size();
077:
078:                if (layerCount == 0) {
079:                    throw new WmsException("No LAYERS has been requested",
080:                            getClass().getName());
081:                }
082:
083:                Data catalog = req.getWMS().getData();
084:
085:                if (LOGGER.isLoggable(Level.FINE)) {
086:                    LOGGER.fine(catalog.toString());
087:                }
088:
089:                String layerName = null;
090:                MapLayerInfo layer = null;
091:
092:                for (int i = 0; i < layerCount; i++) {
093:                    layerName = (String) layers.get(i);
094:
095:                    if (LOGGER.isLoggable(Level.FINE)) {
096:                        LOGGER.fine(new StringBuffer("Looking for layer ")
097:                                .append(layerName).toString());
098:                    }
099:
100:                    try {
101:                        if (LOGGER.isLoggable(Level.FINE)) {
102:                            LOGGER.fine("looking featuretypeinfos");
103:                        }
104:
105:                        FeatureTypeInfo ftype = catalog
106:                                .getFeatureTypeInfo(layerName);
107:                        layer = new MapLayerInfo();
108:                        layer.setFeature(ftype);
109:                        req.addLayer(layer);
110:                    } catch (NoSuchElementException fex) {
111:                        try {
112:                            if (LOGGER.isLoggable(Level.FINE)) {
113:                                LOGGER.fine("looking coverageinfos");
114:                            }
115:
116:                            CoverageInfo cinfo = catalog
117:                                    .getCoverageInfo(layerName);
118:                            layer = new MapLayerInfo();
119:                            layer.setCoverage(cinfo);
120:                            req.addLayer(layer);
121:
122:                            if (LOGGER.isLoggable(Level.FINE)) {
123:                                LOGGER.fine(new StringBuffer(layerName).append(
124:                                        " found").toString());
125:                            }
126:                        } catch (NoSuchElementException cex) {
127:                            throw new WmsException(cex, layerName
128:                                    + ": no such layer on this server",
129:                                    "LayerNotDefined");
130:                        }
131:
132:                        if (LOGGER.isLoggable(Level.FINE)) {
133:                            LOGGER.fine(new StringBuffer(layerName).append(
134:                                    " found").toString());
135:                        }
136:                    }
137:                }
138:
139:                if (LOGGER.isLoggable(Level.FINE)) {
140:                    LOGGER.fine(new StringBuffer("parsed request ").append(req)
141:                            .toString());
142:                }
143:
144:                return req;
145:            }
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.