001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/ogcwebservices/wms/capabilities/WMSOperationsMetadata.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.wms.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
047     * document of a WFS according to the
048     * <code>Web Feature Service Implementation Specification 1.1.0</code>.
049     * <p>
050     * In addition to the <code>GetCapabilities</code> operation that all
051     * <code>OWS 0.3</code> compliant services must implement, it may define some
052     * or all of the following operations: <table border="1">
053     * <table>
054     *  <tr>
055     *      <td></td>
056     *  <tr>
057     * </table>
058     *
059     *
060     * @see org.deegree.ogcwebservices.getcapabilities.OperationsMetadata
061     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
062     * @author last edited by: $Author: mschneider $
063     *
064     * @version 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
065     *
066     * @since 2.0
067     */
068    
069    public class WMSOperationsMetadata extends OperationsMetadata {
070    
071        private static final long serialVersionUID = 3864454877736817781L;
072    
073        /**
074         * The name of the GetMap operation.
075         */
076        public static final String GETMAP = "GetMap";
077    
078        /**
079         * The name of the GetMap operation.
080         */
081        public static final String MAP = "Map";
082    
083        /**
084         * The name of the GetFeatureInfo operation.
085         */
086        public static final String GETFEATUREINFO = "GetFeatureInfo";
087    
088        /**
089         * The name of the GetFeatureInfo operation.
090         */
091        public static final String FEATUREINFO = "FeatureInfo";
092    
093        /**
094         * The name of the DescribeLayer operation.
095         */
096        public static final String DESCRIBELAYER = "DescribeLayer";
097    
098        /**
099         * The name of the GetLegendGraphic operation.
100         */
101        public static final String GETLEGENDGRAPHIC = "GetLegendGraphic";
102    
103        /**
104         * The name of the GetStyles operation.
105         */
106        public static final String GETSTYLES = "GetStyles";
107    
108        /**
109         * The name of the PutStyles operation.
110         */
111        public static final String PUTSTYLES = "PutStyles";
112    
113        private Operation getMap;
114    
115        private Operation getFeatureInfo;
116    
117        private Operation describeLayer;
118    
119        private Operation getLegendGraphic;
120    
121        private Operation getStyles;
122    
123        private Operation putStyles;
124    
125        /**
126         * Constructs a new <code>WMSOperationsMetadata</code> instance from the
127         * given parameters.
128         *
129         * @param getCapabilities
130         * @param getMap
131         * @param getFeatureInfo
132         * @param describeLayer
133         * @param getLegendGraphic
134         * @param getStyles
135         * @param putStyles
136         * @param parameters
137         * @param constraints
138         */
139        public WMSOperationsMetadata(Operation getCapabilities, Operation getMap, Operation getFeatureInfo,
140                                     Operation describeLayer, Operation getLegendGraphic,
141                                     Operation getStyles, Operation putStyles,
142                                     OWSDomainType[] parameters, OWSDomainType[] constraints) {
143            super(getCapabilities, parameters, constraints);
144            this.getMap = getMap;
145            this.getFeatureInfo = getFeatureInfo;
146            this.getLegendGraphic = getLegendGraphic;
147            this.describeLayer = describeLayer;
148            this.getStyles = getStyles;
149            this.putStyles = putStyles;
150        }
151    
152        /**
153         * @return all <code>Operations</code> known to the WFS.
154         *
155         */
156        @Override
157        public Operation[] getOperations() {
158            List<Operation> list = new ArrayList<Operation>(10);
159            list.add( getMap );
160            list.add( getCapabilitiesOperation );
161            if ( describeLayer != null ) {
162                list.add( describeLayer );
163            }
164            if ( getFeatureInfo != null ) {
165                list.add( getFeatureInfo );
166            }
167            if ( getStyles != null ) {
168                list.add( getStyles );
169            }
170            if ( putStyles != null ) {
171                list.add( putStyles );
172            }
173            if ( getLegendGraphic != null ) {
174                list.add( getLegendGraphic );
175            }
176            Operation[] ops = new Operation[list.size()];
177            return list.toArray( ops );
178        }
179    
180        /**
181         * @return Returns the describeLayer.
182         */
183        public Operation getDescribeLayer() {
184            return describeLayer;
185        }
186    
187        /**
188         * @param describeLayer The describeLayer to set.
189         */
190        public void setDescribeLayer( Operation describeLayer ) {
191            this.describeLayer = describeLayer;
192        }
193    
194        /**
195         * @return Returns the getFeatureInfo.
196         */
197        public Operation getGetFeatureInfo() {
198            return getFeatureInfo;
199        }
200    
201        /**
202         * @param getFeatureInfo The getFeatureInfo to set.
203         */
204        public void setGetFeatureInfo( Operation getFeatureInfo ) {
205            this.getFeatureInfo = getFeatureInfo;
206        }
207    
208        /**
209         * @return Returns the getLegendGraphic.
210         */
211        public Operation getGetLegendGraphic() {
212            return getLegendGraphic;
213        }
214    
215        /**
216         * @param getLegendGraphic The getLegendGraphic to set.
217         */
218        public void setGetLegendGraphic( Operation getLegendGraphic ) {
219            this.getLegendGraphic = getLegendGraphic;
220        }
221    
222        /**
223         * @return Returns the getMap.
224         */
225        public Operation getGetMap() {
226            return getMap;
227        }
228    
229        /**
230         * @param getMap The getMap to set.
231         */
232        public void setGetMap( Operation getMap ) {
233            this.getMap = getMap;
234        }
235    
236        /**
237         * @return Returns the getStyles.
238         */
239        public Operation getGetStyles() {
240            return getStyles;
241        }
242    
243        /**
244         * @param getStyles The getStyles to set.
245         */
246        public void setGetStyles( Operation getStyles ) {
247            this.getStyles = getStyles;
248        }
249    
250        /**
251         * @return Returns the putStyles.
252         */
253        public Operation getPutStyles() {
254            return putStyles;
255        }
256    
257        /**
258         * @param putStyles The putStyles to set.
259         */
260        public void setPutStyles( Operation putStyles ) {
261            this.putStyles = putStyles;
262        }
263    
264    }