001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002: * This code is licensed under the GPL 2.0 license, availible at the root
003: * application directory.
004: */
005: package org.vfny.geoserver.wms.requests;
006:
007: import org.vfny.geoserver.global.MapLayerInfo;
008: import org.vfny.geoserver.wms.servlets.WMService;
009:
010: /**
011: * Represents a WMS 1.1.1 GetFeatureInfo request.
012: * <p>
013: * The "GetMap" part of the request is represented by a
014: * <code>GetMapRequest</code> object by itself. It is
015: * intended to provide enough map context information about
016: * the map over the GetFeatureInfo request is performed.
017: * </p>
018: *
019: * @author Gabriel Roldan, Axios Engineering
020: * @version $Id: GetFeatureInfoRequest.java 8418 2008-02-18 14:47:17Z aaime $
021: */
022: public class GetFeatureInfoRequest extends WMSRequest {
023: private static final String DEFAULT_EXCEPTION_FORMAT = "application/vnd.ogc.se_xml";
024: private static final int DEFAULT_MAX_FEATURES = 1;
025:
026: /**
027: * Holds the GetMap part of the GetFeatureInfo request, wich is meant
028: * to provide enough context information about the map over the
029: * GetFeatureInfo request is being made.
030: */
031: private GetMapRequest getMapRequest;
032:
033: /**
034: * List of FeatureTypeInfo's parsed from the <code>QUERY_LAYERS</code>
035: * mandatory parameter.
036: */
037: private MapLayerInfo[] queryLayers;
038:
039: /**
040: * Holder for the <code>INFO_FORMAT</code> optional parameter
041: */
042: private String infoFormat;
043:
044: /**
045: * Holder for the <code>FEATURE_COUNT</code> optional parameter.
046: * Deafults to 1.
047: */
048: private int featureCount = DEFAULT_MAX_FEATURES;
049:
050: /**
051: * Holds the value of the required <code>X</code> parameter
052: */
053: private int XPixel;
054:
055: /**
056: * Holds the value of the requiered <code>Y</code> parameter
057: */
058: private int YPixel;
059:
060: /**
061: * Holder for the optional <code>EXCEPTIONS</code> parameter,
062: * defaults to <code>"application/vnd.ogc.se_xml"</code>
063: */
064: private String exeptionFormat = DEFAULT_EXCEPTION_FORMAT;
065:
066: /**
067: * Creates a new GetMapRequest object.
068: * @param service The service that will handle the request
069: */
070: public GetFeatureInfoRequest(WMService service) {
071: super ("GetFeatureInfo", service);
072: }
073:
074: /**
075: * @return Returns the exeptionFormat.
076: */
077: public String getExeptionFormat() {
078: return exeptionFormat;
079: }
080:
081: /**
082: * @param exeptionFormat The exeptionFormat to set.
083: */
084: public void setExeptionFormat(String exeptionFormat) {
085: this .exeptionFormat = exeptionFormat;
086: }
087:
088: /**
089: * @return Returns the featureCount.
090: */
091: public int getFeatureCount() {
092: return featureCount;
093: }
094:
095: /**
096: * @param featureCount The featureCount to set.
097: */
098: public void setFeatureCount(int featureCount) {
099: this .featureCount = featureCount;
100: }
101:
102: /**
103: * @return Returns the getMapRequest.
104: */
105: public GetMapRequest getGetMapRequest() {
106: return getMapRequest;
107: }
108:
109: /**
110: * @param getMapRequest The getMapRequest to set.
111: */
112: public void setGetMapRequest(GetMapRequest getMapRequest) {
113: this .getMapRequest = getMapRequest;
114: }
115:
116: /**
117: * @return Returns the infoFormat.
118: */
119: public String getInfoFormat() {
120: return infoFormat;
121: }
122:
123: /**
124: * @param infoFormat The infoFormat to set.
125: */
126: public void setInfoFormat(String infoFormat) {
127: this .infoFormat = infoFormat;
128: }
129:
130: /**
131: * @return Returns the queryLayers.
132: */
133: public MapLayerInfo[] getQueryLayers() {
134: return queryLayers;
135: }
136:
137: /**
138: * @param queryLayers The queryLayers to set.
139: */
140: public void setQueryLayers(MapLayerInfo[] queryLayers) {
141: this .queryLayers = queryLayers;
142: }
143:
144: /**
145: * @return Returns the xPixel.
146: */
147: public int getXPixel() {
148: return XPixel;
149: }
150:
151: /**
152: * @param pixel The xPixel to set.
153: */
154: public void setXPixel(int pixel) {
155: XPixel = pixel;
156: }
157:
158: /**
159: * @return Returns the yPixel.
160: */
161: public int getYPixel() {
162: return YPixel;
163: }
164:
165: /**
166: * @param pixel The yPixel to set.
167: */
168: public void setYPixel(int pixel) {
169: YPixel = pixel;
170: }
171: }
|