001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/ogcwebservices/wfs/capabilities/WFSOperationsMetadata.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    package org.deegree.ogcwebservices.wfs.capabilities;
037    
038    import java.util.ArrayList;
039    import java.util.List;
040    
041    import org.deegree.ogcwebservices.getcapabilities.Operation;
042    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
043    import org.deegree.owscommon.OWSDomainType;
044    
045    /**
046     * Represents the <code>OperationMetadata</code> part in the capabilities document of a WFS
047     * according to the <code>Web Feature Service Implementation Specification 1.1.0</code>.
048     * <p>
049     * In addition to the <code>GetCapabilities</code> operation that all <code>OWS 0.3</code>
050     * compliant services must implement, it may define some or all of the following operations: <table
051     * border="1">
052     * <tr>
053     * <th>Name</th>
054     * <th>Mandatory?</th>
055     * <th>Function</th>
056     * </tr>
057     * <tr>
058     * <td><code>DescribeFeatureType</code></td>
059     * <td align="center">X</td>
060     * <td>The function of the <code>DescribeFeatureType</code> operation is to generate a schema
061     * description of feature types serviced by a WFS implementation.</td>
062     * </tr>
063     * <tr>
064     * <td><code>GetFeature</code></td>
065     * <td align="center">X</td>
066     * <td>The <code>GetFeature</code> operation allows retrieval of features from a web feature
067     * service.</td>
068     * </tr>
069     * <tr>
070     * <td><code>GetFeatureWithLock</code></td>
071     * <td align="center">-</td>
072     * <td>The lock action of the <code>GetFeatureWithLock</code> request is to attempt to lock all
073     * identified feature instances. If all identified feature instances cannot be locked, then an
074     * exception report should be generated.</td>
075     * </tr>
076     * <tr>
077     * <td><code>GetGMLObject</code></td>
078     * <td align="center">-</td>
079     * <td>The <code>GetGMLObject</code> operation allows retrieval of features and elements by ID
080     * from a web feature service.</td>
081     * </tr>
082     * <tr>
083     * <td><code>LockFeature</code></td>
084     * <td align="center">-</td>
085     * <td>The purpose of the <code>LockFeature</code> operation is to expose a long term feature
086     * locking mechanism to ensure consistency. The lock is considered long term because network latency
087     * would make feature locks last relatively longer than native commercial database locks.</td>
088     * </tr>
089     * <tr>
090     * <td><code>Transaction</code></td>
091     * <td align="center">-</td>
092     * <td>The <code>Transaction</code> operation is used to describe data transformation operations
093     * that are to be applied to web accessible feature instances. When the transaction has been
094     * completed, a web feature service will generate an XML response document indicating the completion
095     * status of the transaction.</td>
096     * </tr>
097     * </table>
098     *
099     * @see org.deegree.ogcwebservices.getcapabilities.OperationsMetadata
100     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
101     * @author last edited by: $Author: mschneider $
102     *
103     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
104     */
105    public class WFSOperationsMetadata extends OperationsMetadata {
106    
107        private static final long serialVersionUID = -3953425919713834071L;
108    
109        /**
110         *
111         */
112        public static final String DESCRIBE_FEATURETYPE_NAME = "DescribeFeatureType";
113    
114        /**
115         *
116         */
117        public static final String GET_FEATURE_NAME = "GetFeature";
118    
119        /**
120         *
121         */
122        public static final String GET_FEATURE_WITH_LOCK_NAME = "GetFeatureWithLock";
123    
124        /**
125         *
126         */
127        public static final String GET_GML_OBJECT_NAME = "GetGmlObject";
128    
129        /**
130         *
131         */
132        public static final String LOCK_FEATURE_NAME = "LockFeature";
133    
134        /**
135         *
136         */
137        public static final String TRANSACTION_NAME = "Transaction";
138    
139        private Operation describeFeatureType;
140    
141        private Operation getFeature;
142    
143        private Operation getFeatureWithLock;
144    
145        private Operation getGMLObject;
146    
147        private Operation lockFeature;
148    
149        private Operation transaction;
150    
151        /**
152         * Constructs a new <code>WFSOperationsMetadata</code> instance from the given parameters.
153         *
154         * @param getCapabilities
155         * @param describeFeatureType
156         * @param getFeature
157         * @param getFeatureWithLock
158         *            optional operation (may be null)
159         * @param getGMLObject
160         *            optional operation (may be null)
161         * @param lockFeature
162         *            optional operation (may be null)
163         * @param transaction
164         *            optional operation (may be null)
165         * @param parameters
166         * @param constraints
167         */
168        public WFSOperationsMetadata( Operation getCapabilities, Operation describeFeatureType,
169                                      Operation getFeature, Operation getFeatureWithLock,
170                                      Operation getGMLObject, Operation lockFeature,
171                                      Operation transaction, OWSDomainType[] parameters,
172                                      OWSDomainType[] constraints ) {
173            super( getCapabilities, parameters, constraints );
174            this.describeFeatureType = describeFeatureType;
175            this.getFeature = getFeature;
176            this.getFeatureWithLock = getFeatureWithLock;
177            this.getGMLObject = getGMLObject;
178            this.lockFeature = lockFeature;
179            this.transaction = transaction;
180        }
181    
182        /**
183         * Returns all <code>Operations</code> known to the WFS.
184         *
185         * @return all <code>Operations</code> known to the WFS.
186         */
187        @Override
188        public Operation[] getOperations() {
189            List<Operation> list = new ArrayList<Operation>( 10 );
190            list.add( getFeature );
191            list.add( describeFeatureType );
192            list.add( getCapabilitiesOperation );
193            if ( getFeatureWithLock != null ) {
194                list.add( getFeatureWithLock );
195            }
196            if ( getGMLObject != null ) {
197                list.add( getGMLObject );
198            }
199            if ( lockFeature != null ) {
200                list.add( lockFeature );
201            }
202            if ( transaction != null ) {
203                list.add( transaction );
204            }
205    
206            Operation[] ops = new Operation[list.size()];
207            return list.toArray( ops );
208        }
209    
210        /**
211         * @return Returns the describeFeatureType <code>Operation</code>.
212         */
213        public Operation getDescribeFeatureType() {
214            return describeFeatureType;
215        }
216    
217        /**
218         * @param describeFeatureType
219         *            The describeFeatureType <code>Operation</code> to set.
220         */
221        public void setDescribeFeatureType( Operation describeFeatureType ) {
222            this.describeFeatureType = describeFeatureType;
223        }
224    
225        /**
226         * @return Returns the getFeature <code>Operation</code>.
227         */
228        public Operation getGetFeature() {
229            return getFeature;
230        }
231    
232        /**
233         * @param getFeature
234         *            The getFeature <code>Operation</code> to set.
235         */
236        public void setGetFeature( Operation getFeature ) {
237            this.getFeature = getFeature;
238        }
239    
240        /**
241         * @return Returns the getFeatureWithLock <code>Operation</code>.
242         */
243        public Operation getGetFeatureWithLock() {
244            return getFeatureWithLock;
245        }
246    
247        /**
248         * @param getFeatureWithLock
249         *            The getFeatureWithLock <code>Operation</code> to set.
250         */
251        public void setGetFeatureWithLock( Operation getFeatureWithLock ) {
252            this.getFeatureWithLock = getFeatureWithLock;
253        }
254    
255        /**
256         * @return Returns the getGMLObject <code>Operation</code>.
257         */
258        public Operation getGetGMLObject() {
259            return getGMLObject;
260        }
261    
262        /**
263         * @param getGMLObject
264         *            The getGMLObject <code>Operation</code> to set.
265         */
266        public void setGetGMLObject( Operation getGMLObject ) {
267            this.getGMLObject = getGMLObject;
268        }
269    
270        /**
271         * @return Returns the lockFeature <code>Operation</code>.
272         */
273        public Operation getLockFeature() {
274            return lockFeature;
275        }
276    
277        /**
278         * @param lockFeature
279         *            The lockFeature <code>Operation</code> to set.
280         */
281        public void setLockFeature( Operation lockFeature ) {
282            this.lockFeature = lockFeature;
283        }
284    
285        /**
286         * @return Returns the transaction <code>Operation</code>.
287         */
288        public Operation getTransaction() {
289            return transaction;
290        }
291    
292        /**
293         * @param transaction
294         *            The transaction <code>Operation</code> to set.
295         */
296        public void setTransaction( Operation transaction ) {
297            this.transaction = transaction;
298        }
299    }