001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.data.wms;
017:
018: import java.net.URL;
019:
020: import org.geotools.data.ows.GetCapabilitiesRequest;
021:
022: /**
023: * Provides support for the Web Map Server 1.1.1 Specificaiton.
024: * <p>
025: * WMS1_1_1 provides both name and version information that may be checked against a GetCapabilities document during
026: * version negotiation.
027: * </p>
028: *
029: * @author Jody Garnett, Refractions Research
030: * @author rgould
031: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wms/src/main/java/org/geotools/data/wms/WMS1_1_1.java $
032: */
033: public class WMS1_1_1 extends WMS1_1_0 {
034: public WMS1_1_1() {
035: }
036:
037: /**
038: * Expected version attribute for root element.
039: *
040: * @return DOCUMENT ME!
041: */
042: public String getVersion() {
043: return "1.1.1";
044: }
045:
046: /**
047: * Factory method to create WMS 1.1.1 GetCapabilities Request
048: *
049: * @param server DOCUMENT ME!
050: * @return DOCUMENT ME!
051: */
052: public GetCapabilitiesRequest createGetCapabilitiesRequest(
053: URL server) {
054: return new GetCapsRequest(server);
055: }
056:
057: static public class GetCapsRequest extends WMS1_1_0.GetCapsRequest {
058: public GetCapsRequest(URL urlGetCapabilities) {
059: super (urlGetCapabilities);
060: }
061:
062: protected void initVersion() {
063: setProperty("VERSION", "1.1.1");
064: }
065: }
066:
067: static public class GetMapRequest extends WMS1_1_0.GetMapRequest {
068:
069: public GetMapRequest(URL onlineResource) {
070: super (onlineResource);
071: }
072:
073: protected void initVersion() {
074: setVersion("1.1.1");
075: }
076: }
077:
078: static public class GetFeatureInfoRequest extends
079: WMS1_1_0.GetFeatureInfoRequest {
080:
081: public GetFeatureInfoRequest(URL onlineResource,
082: org.geotools.data.wms.request.GetMapRequest request) {
083: super (onlineResource, request);
084: }
085:
086: protected void initVersion() {
087: setProperty("VERSION", "1.1.1");
088: }
089: }
090:
091: public org.geotools.data.wms.request.GetMapRequest createGetMapRequest(
092: URL get) {
093: return new GetMapRequest(get);
094: }
095:
096: public org.geotools.data.wms.request.GetFeatureInfoRequest createGetFeatureInfoRequest(
097: URL onlineResource,
098: org.geotools.data.wms.request.GetMapRequest getMapRequest) {
099: return new GetFeatureInfoRequest(onlineResource, getMapRequest);
100: }
101: }
|