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.wcs.requests.readers;
06:
07: import org.vfny.geoserver.Request;
08: import org.vfny.geoserver.ServiceException;
09: import org.vfny.geoserver.util.requests.CapabilitiesRequest;
10: import org.vfny.geoserver.util.requests.readers.KvpRequestReader;
11: import org.vfny.geoserver.wcs.requests.WCSCapabilitiesRequest;
12: import org.vfny.geoserver.wcs.servlets.WCService;
13: import java.util.Map;
14: import javax.servlet.http.HttpServletRequest;
15:
16: /**
17: * This utility reads in a GetCapabilities KVP request and turns it into an
18: * appropriate internal CapabilitiesRequest object, upon request.
19: *
20: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification)
21: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification)
22: * @version $Id: CapabilitiesKvpReader.java 8406 2008-02-14 19:49:39Z saul.farber $
23: */
24: public class CapabilitiesKvpReader extends KvpRequestReader {
25: /**
26: * Constructor with raw request string. Calls parent.
27: *
28: * @param kvPairs The raw string of a capabilities kvp request.
29: */
30: public CapabilitiesKvpReader(Map kvPairs, WCService service) {
31: super (kvPairs, service);
32: }
33:
34: /**
35: * Get Capabilities request.
36: *
37: * @param request the servlet request to get the GeoServer object from
38: *
39: * @return Capabilities request.
40: *
41: * @throws ServiceException DOCUMENT ME!
42: */
43: public Request getRequest(HttpServletRequest request)
44: throws ServiceException {
45: CapabilitiesRequest currentRequest = new WCSCapabilitiesRequest(
46: service);
47: currentRequest.setHttpServletRequest(request);
48: currentRequest.setVersion(getValue("VERSION"));
49: currentRequest.setUpdateSequence(getValue("UPDATESEQUENCE"));
50:
51: //service is set in the constructor
52: //currentRequest.setService(getValue("SERVICE"));
53: return currentRequest;
54: }
55: }
|