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.global.MapLayerInfo;
08: import org.vfny.geoserver.wms.servlets.WMService;
09: import java.util.ArrayList;
10: import java.util.Iterator;
11: import java.util.List;
12:
13: /**
14: * Holds the pre-validated parameters of a <code>DescribeLayer</code> request.
15: *
16: * <p>
17: * This pre-validation must to be done by the request reader, so the content
18: * of this object is assumed to be valid.
19: * </p>
20: *
21: * @author Gabriel Roldan, Axios Engineering
22: * @version $Id: DescribeLayerRequest.java 6326 2007-03-15 18:36:40Z jdeolive $
23: */
24: public class DescribeLayerRequest extends WMSRequest {
25: /**
26: * Creates a new DescribeLayerRequest
27: * @param service the service that handles the request
28: */
29: public DescribeLayerRequest(WMService service) {
30: super ("DescribeLayer", service);
31: }
32:
33: /**
34: * Holds the FeatureTypes parsed from the
35: * request's <code>LAYERS</code> parameter.
36: */
37: private List layers = new ArrayList(2);
38:
39: public void addLayer(MapLayerInfo layer) {
40: if (layer == null) {
41: throw new NullPointerException();
42: }
43:
44: layers.add(layer);
45: }
46:
47: public List getLayers() {
48: return new ArrayList(layers);
49: }
50:
51: public String toString() {
52: StringBuffer sb = new StringBuffer(
53: "DescribeLayerRequesr[layers=");
54:
55: for (Iterator it = layers.iterator(); it.hasNext();) {
56: sb.append(((MapLayerInfo) it.next()).getName());
57:
58: if (it.hasNext()) {
59: sb.append(',');
60: }
61: }
62:
63: sb.append(']');
64:
65: return sb.toString();
66: }
67: }
|