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.servlets;
06:
07: import org.vfny.geoserver.ExceptionHandler;
08: import org.vfny.geoserver.global.WCS;
09: import org.vfny.geoserver.servlets.AbstractService;
10: import org.vfny.geoserver.wcs.WcsExceptionHandler;
11: import javax.servlet.http.HttpServletRequest;
12:
13: /**
14: * Base servlet for all Web Coverage Server requests.
15: *
16: * <p>
17: * Subclasses should supply the handler, request and response mapping for the
18: * service they implement.
19: * </p>
20: *
21: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification)
22: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification)
23: * @version $Id: WCService.java 6326 2007-03-15 18:36:40Z jdeolive $
24: */
25: abstract public class WCService extends AbstractService {
26: /**
27: * Constructor for WCS service.
28: *
29: * @param request The service request being made (GetCaps,GetCoverage,...)
30: * @param wcs The WCS service reference.
31: */
32: public WCService(String request, WCS wcs) {
33: super ("WCS", request, wcs);
34: }
35:
36: /**
37: * @return The wcs service ref.
38: */
39: public WCS getWCS() {
40: return (WCS) getServiceRef();
41: }
42:
43: /**
44: * Sets the wcs service ref.
45: * @param wcs
46: */
47: public void setWCS(WCS wcs) {
48: setServiceRef(wcs);
49: }
50:
51: /**
52: * a Web Coverage ServiceConfig exception handler
53: *
54: * @return an instance of WcsExceptionHandler
55: */
56: protected ExceptionHandler getExceptionHandler() {
57: return WcsExceptionHandler.getInstance();
58: }
59:
60: protected boolean isServiceEnabled(HttpServletRequest req) {
61: return getWCS().isEnabled();
62: }
63: }
|