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.GetLegendGraphicKvpReader;
12: import org.vfny.geoserver.wms.responses.GetLegendGraphicResponse;
13: import java.util.Map;
14:
15: /**
16: * WMS service wich returns request and response handlers to manage a
17: * GetLegendGraphic request
18: *
19: * @author Gabriel Roldan, Axios Engineering
20: * @version $Id: GetLegendGraphic.java 6326 2007-03-15 18:36:40Z jdeolive $
21: */
22: public class GetLegendGraphic extends WMService {
23: /**
24: *
25: */
26: private static final long serialVersionUID = 4957246942172056598L;
27:
28: public GetLegendGraphic(WMS wms) {
29: super ("GetLegendGraphic", wms);
30: }
31:
32: /**
33: * Returns a response handler to manage a GetLegendGraphic request
34: *
35: * @return a response handler to manage a GetLegendGraphic request
36: */
37: protected Response getResponseHandler() {
38: return new GetLegendGraphicResponse(getApplicationContext());
39: }
40:
41: /**
42: * Returns GetLegendGraphic request parser
43: *
44: * @param params the kvp set of the request
45: *
46: * @return a GetLegendGraphic request parser
47: */
48: protected KvpRequestReader getKvpReader(Map params) {
49: return new GetLegendGraphicKvpReader(params, this );
50: }
51:
52: /**
53: * Throws an UnsupportedOperationException since GetLegendGraphic does
54: * not defines an xml encoding for HTTP POST method.
55: *
56: * @return never, allways fails since it is an unsupported method for this
57: * request
58: *
59: * @throws UnsupportedOperationException
60: */
61: protected XmlRequestReader getXmlRequestReader() {
62: throw new UnsupportedOperationException(
63: "request does not defines a POST encoding");
64: }
65: }
|