Source Code Cross Referenced for WMService.java in  » GIS » openjump » com » vividsolutions » wms » 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 » openjump » com.vividsolutions.wms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:
002:        /*
003:         * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
004:         * for visualizing and manipulating spatial features with geometry and attributes.
005:         *
006:         * Copyright (C) 2003 Vivid Solutions
007:         * 
008:         * This program is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public License
010:         * as published by the Free Software Foundation; either version 2
011:         * of the License, or (at your option) any later version.
012:         * 
013:         * This program is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016:         * GNU General Public License for more details.
017:         * 
018:         * You should have received a copy of the GNU General Public License
019:         * along with this program; if not, write to the Free Software
020:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
021:         * 
022:         * For more information, contact:
023:         *
024:         * Vivid Solutions
025:         * Suite #1A
026:         * 2328 Government Street
027:         * Victoria BC  V8T 5G5
028:         * Canada
029:         *
030:         * (250)385-6040
031:         * www.vividsolutions.com
032:         */
033:
034:        package com.vividsolutions.wms;
035:
036:        import java.io.IOException;
037:        import java.io.InputStream;
038:        import java.net.URL;
039:
040:        /**
041:         * Represents a remote WMS Service.
042:         *
043:         * @author Chris Hodgson chodgson@refractions.net
044:         */
045:        public class WMService {
046:
047:            public static final String WMS_1_0_0 = "1.0.0";
048:
049:            public static final String WMS_1_1_0 = "1.1.0";
050:
051:            public static final String WMS_1_1_1 = "1.1.1";
052:
053:            private String serverUrl;
054:            private String wmsVersion = WMS_1_0_0;
055:            private Capabilities cap;
056:
057:            /**
058:             * Constructs a WMService object from a server URL.
059:             * @param serverUrl the URL of the WMS server
060:             */
061:            public WMService(String serverUrl, String wmsVersion) {
062:                this .serverUrl = serverUrl;
063:                this .wmsVersion = wmsVersion;
064:                this .cap = null;
065:            }
066:
067:            /**
068:             * Constructs a WMService object from a server URL.
069:             * @param serverUrl the URL of the WMS server
070:             */
071:            public WMService(String serverUrl) {
072:                this .serverUrl = serverUrl;
073:                this .cap = null;
074:            }
075:
076:            /**
077:             * Connect to the service and get the capabilities.
078:             * This must be called before anything else is done with this service.
079:             */
080:            public void initialize() throws IOException {
081:                //    [UT]
082:                String req = "request=capabilities&WMTVER=1.0";
083:                if (WMS_1_1_0.equals(wmsVersion)) {
084:                    req = "SERVICE=WMS&VERSION=1.1.0&REQUEST=GetCapabilities";
085:                } else if (WMS_1_1_1.equals(wmsVersion)) {
086:                    req = "SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities";
087:                }
088:
089:                String requestUrlString = this .serverUrl + req;
090:                URL requestUrl = new URL(requestUrlString);
091:                InputStream inStream = requestUrl.openStream();
092:                Parser p = new Parser();
093:                cap = p.parseCapabilities(this , inStream);
094:            }
095:
096:            /**
097:             * Gets the url of the map service.
098:             * @return the url of the WMService
099:             */
100:            public String getServerUrl() {
101:                return serverUrl;
102:            }
103:
104:            /**
105:             * Gets the title of the map service.
106:             * The service must have previously been initialized, otherwise null is returned.
107:             * @return the title of the WMService
108:             */
109:            public String getTitle() {
110:                return cap.getTitle();
111:            }
112:
113:            /**
114:             * Gets the Capabilities for this service.
115:             * The service must have previously been initialized, otherwise null is returned.
116:             * @return a copy of the MapDescriptor for this service
117:             */
118:            public Capabilities getCapabilities() {
119:                return cap;
120:            }
121:
122:            /**
123:             * Creates a new MapRequest object which can be used to retrieve a Map
124:             * from this service.
125:             * @return a MapRequest object which can be used to retrieve a map image
126:             *         from this service
127:             */
128:            public MapRequest createMapRequest() {
129:                //    [UT] 04.02.2005 changed
130:                MapRequest mr = new MapRequest(this );
131:                mr.setVersion(this .wmsVersion);
132:                return mr;
133:            }
134:
135:            public String getVersion() {
136:                return wmsVersion;
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.