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.Request;
08: import org.vfny.geoserver.global.GeoServer;
09: import org.vfny.geoserver.global.WMS;
10: import org.vfny.geoserver.wms.servlets.WMService;
11:
12: /**
13: * DOCUMENT ME!
14: *
15: * @author Gabriel Rold?n
16: * @version $Id: WMSRequest.java 6326 2007-03-15 18:36:40Z jdeolive $
17: */
18: public class WMSRequest extends Request {
19: public static final String WMS_SERVICE_TYPE = "WMS";
20:
21: /**
22: * Creates the new request, supplying the request name and the sevlet
23: * handling the request.
24: *
25: * @param requestType name of hte request, (Example, GetCapabiliites)
26: * @param service The servlet handling the WMS request.
27: */
28: public WMSRequest(String requestType, WMService service) {
29: super (WMS_SERVICE_TYPE, requestType, service);
30: }
31:
32: /**
33: * Sets the wms service object.
34: */
35: public void setWMService(WMService wms) {
36: setServiceRef(wms);
37: }
38:
39: /**
40: * Returns the wms service object..
41: */
42: public WMService getWMService() {
43: return (WMService) getServiceRef();
44: }
45:
46: /**
47: * Convenience method for obtaining the global wms service instance.
48: */
49: public WMS getWMS() {
50: return getWMService().getWMS();
51: }
52:
53: /**
54: * Convenience method for obtaining the global geoserver instance.
55: */
56: public GeoServer getGeoServer() {
57: GeoServer gs = getWMS().getGeoServer();
58:
59: return gs;
60: }
61: }
|