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.servlets;
06:
07: import org.vfny.geoserver.Response;
08: import org.vfny.geoserver.global.WMS;
09: import org.vfny.geoserver.util.requests.readers.KvpRequestReader;
10: import org.vfny.geoserver.util.requests.readers.XmlRequestReader;
11: import org.vfny.geoserver.wms.requests.CapabilitiesKvpReader;
12: import org.vfny.geoserver.wms.requests.CapabilitiesXmlReader;
13: import org.vfny.geoserver.wms.responses.GetMapResponse;
14: import org.vfny.geoserver.wms.responses.WMSCapabilitiesResponse;
15: import java.util.Map;
16: import java.util.Set;
17:
18: /**
19: * DOCUMENT ME!
20: *
21: * @author Gabriel Rold?n
22: * @version $Id: Capabilities.java 6527 2007-04-19 14:52:21Z aaime $
23: */
24: public class Capabilities extends WMService {
25: public Capabilities(WMS wms) {
26: super ("GetCapabilities", wms);
27: }
28:
29: /**
30: * Protected constructor which allows subclass to "alias" request id.
31: */
32: protected Capabilities(String request, WMS wms) {
33: super (request, wms);
34: }
35:
36: /**
37: * DOCUMENT ME!
38: *
39: * @param params DOCUMENT ME!
40: *
41: * @return DOCUMENT ME!
42: */
43: protected KvpRequestReader getKvpReader(Map params) {
44: return new CapabilitiesKvpReader(params, this );
45: }
46:
47: /**
48: * DOCUMENT ME!
49: *
50: * @return DOCUMENT ME!
51: */
52: protected XmlRequestReader getXmlRequestReader() {
53: return new CapabilitiesXmlReader(this );
54: }
55:
56: /**
57: * DOCUMENT ME!
58: *
59: * @return DOCUMENT ME!
60: */
61: protected Response getResponseHandler() {
62: Set wmsGetMapFormats = GetMapResponse
63: .loadImageFormats(getApplicationContext());
64:
65: return new WMSCapabilitiesResponse(wmsGetMapFormats,
66: getApplicationContext());
67: }
68: }
|