01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.wms.requests;
06:
07: import org.vfny.geoserver.global.WMS;
08: import org.vfny.geoserver.util.requests.readers.KvpRequestReader;
09: import org.vfny.geoserver.wms.servlets.WMService;
10: import java.util.Map;
11:
12: /**
13: * Base class for all WMS KvpRequestReaders, wich just adds the
14: * getRequestVersion() method wich returns the spec version a client has
15: * requested or the default implementation version of this server if no
16: * version has been requested, either by the "VERSION" parameter or by the
17: * "WMTVER" parameter, wich is deprecated but it is recomended to recognize it
18: *
19: * @author Gabriel Rold?n
20: * @version $Id: WmsKvpRequestReader.java 6326 2007-03-15 18:36:40Z jdeolive $
21: */
22: public abstract class WmsKvpRequestReader extends KvpRequestReader {
23: /**
24: * DOCUMENT ME!
25: *
26: * @param params DOCUMENT ME!
27: */
28:
29: //protected static final GeoServer config = GeoServer.getInstance();
30: /**
31: * Creates a new kvp reader for a WMS request.
32: *
33: * @param kvpPairs The raw key value pairs.
34: * @param service The servlet handling the request.
35: */
36: public WmsKvpRequestReader(Map kvpPairs, WMService service) {
37: super (kvpPairs, service);
38: }
39:
40: /**
41: * DOCUMENT ME!
42: *
43: * @return DOCUMENT ME!
44: */
45: protected String getRequestVersion() {
46: String version = getValue("VERSION");
47:
48: if (version == null) {
49: version = getValue("WMTVER");
50: }
51:
52: if (version == null) {
53: version = WMS.getVersion();
54: }
55:
56: return version;
57: }
58: }
|