001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.data.ows;
017:
018: import java.util.Iterator;
019: import java.util.List;
020:
021: import org.geotools.filter.FilterCapabilities;
022:
023: /**
024: * <p>
025: * DOCUMENT ME!
026: * </p>
027: *
028: * @author dzwiers
029: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wfs/src/main/java/org/geotools/data/ows/WFSCapabilities.java $
030: */
031: public class WFSCapabilities extends Capabilities {
032: private List featureTypes; // FeatureSetDescriptions
033: private OperationType describeFeatureType;
034: private OperationType getCapabilities;
035: private OperationType getFeature;
036: private OperationType getFeatureWithLock;
037: private OperationType transaction;
038: private OperationType lockFeature;
039: private String vendorSpecificCapabilities;
040: private FilterCapabilities filterCapabilities;
041:
042: /**
043: * Makes a few assumptions about ":" in the name (prefix:typename).
044: *
045: * Although this case is uncommon, it may result in the occational error.
046: * The specification is unclear as to the inclusion or exclusion of the
047: * prefix (although most xml documents would support prefix exclusion).
048: *
049: * @param capabilities
050: * @param typename
051: */
052: public static FeatureSetDescription getFeatureSetDescription(
053: WFSCapabilities capabilities, String typename) {
054: List l = capabilities.getFeatureTypes();
055: Iterator i = l.iterator();
056: String crsName = null;
057:
058: while (i.hasNext() && crsName == null) {
059: FeatureSetDescription fsd = (FeatureSetDescription) i
060: .next();
061: String name = fsd.getName();
062: if (typename.equals(name)) {
063: return fsd;
064: }
065: if (name != null) {
066: int index = name.indexOf(':');
067: if (index != -1
068: && typename.equals(name.substring(index + 1))) {
069: return fsd;
070: }
071: }
072: }
073: return null;
074: }
075:
076: /**
077: * DOCUMENT ME!
078: *
079: * @return Returns the featureTypes.
080: */
081: public List getFeatureTypes() {
082: return featureTypes;
083: }
084:
085: /**
086: * DOCUMENT ME!
087: *
088: * @param featureTypes The featureTypes to set.
089: */
090: public void setFeatureTypes(List featureTypes) {
091: this .featureTypes = featureTypes;
092: }
093:
094: /**
095: * DOCUMENT ME!
096: *
097: * @return Returns the filterCapabilities.
098: */
099: public FilterCapabilities getFilterCapabilities() {
100: return filterCapabilities;
101: }
102:
103: /**
104: * DOCUMENT ME!
105: *
106: * @param filterCapabilities The filterCapabilities to set.
107: */
108: public void setFilterCapabilities(
109: FilterCapabilities filterCapabilities) {
110: this .filterCapabilities = filterCapabilities;
111: }
112:
113: /**
114: * DOCUMENT ME!
115: *
116: * @return Returns the vendorSpecificCapabilities.
117: */
118: public String getVendorSpecificCapabilities() {
119: return vendorSpecificCapabilities;
120: }
121:
122: /**
123: * DOCUMENT ME!
124: *
125: * @param vendorSpecificCapabilities The vendorSpecificCapabilities to set.
126: */
127: public void setVendorSpecificCapabilities(
128: String vendorSpecificCapabilities) {
129: this .vendorSpecificCapabilities = vendorSpecificCapabilities;
130: }
131:
132: /**
133: * DOCUMENT ME!
134: *
135: * @return Returns the describeFeatureType.
136: */
137: public OperationType getDescribeFeatureType() {
138: return describeFeatureType;
139: }
140:
141: /**
142: * DOCUMENT ME!
143: *
144: * @param describeFeatureType The describeFeatureType to set.
145: */
146: public void setDescribeFeatureType(OperationType describeFeatureType) {
147: this .describeFeatureType = describeFeatureType;
148: }
149:
150: /**
151: * DOCUMENT ME!
152: *
153: * @return Returns the getCapabilities.
154: */
155: public OperationType getGetCapabilities() {
156: return getCapabilities;
157: }
158:
159: /**
160: * DOCUMENT ME!
161: *
162: * @param getCapabilities The getCapabilities to set.
163: */
164: public void setGetCapabilities(OperationType getCapabilities) {
165: this .getCapabilities = getCapabilities;
166: }
167:
168: /**
169: * DOCUMENT ME!
170: *
171: * @return Returns the getFeature.
172: */
173: public OperationType getGetFeature() {
174: return getFeature;
175: }
176:
177: /**
178: * DOCUMENT ME!
179: *
180: * @param getFeature The getFeature to set.
181: */
182: public void setGetFeature(OperationType getFeature) {
183: this .getFeature = getFeature;
184: }
185:
186: /**
187: * DOCUMENT ME!
188: *
189: * @return Returns the getFeatureWithLock.
190: */
191: public OperationType getGetFeatureWithLock() {
192: return getFeatureWithLock;
193: }
194:
195: /**
196: * DOCUMENT ME!
197: *
198: * @param getFeatureWithLock The getFeatureWithLock to set.
199: */
200: public void setGetFeatureWithLock(OperationType getFeatureWithLock) {
201: this .getFeatureWithLock = getFeatureWithLock;
202: }
203:
204: /**
205: * DOCUMENT ME!
206: *
207: * @return Returns the transaction.
208: */
209: public OperationType getTransaction() {
210: return transaction;
211: }
212:
213: /**
214: * DOCUMENT ME!
215: *
216: * @param transaction The transaction to set.
217: */
218: public void setTransaction(OperationType transaction) {
219: this .transaction = transaction;
220: }
221:
222: /**
223: * DOCUMENT ME!
224: *
225: * @return Returns the lockFeature.
226: */
227: public OperationType getLockFeature() {
228: return lockFeature;
229: }
230:
231: /**
232: * DOCUMENT ME!
233: *
234: * @param lockFeature The lockFeature to set.
235: */
236: public void setLockFeature(OperationType lockFeature) {
237: this.lockFeature = lockFeature;
238: }
239: }
|