001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/ogcwebservices/wms/capabilities/WMSOperationsMetadata.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004     This file is part of deegree.
005     Copyright (C) 2001-2008 by:
006     EXSE, Department of Geography, University of Bonn
007     http://www.giub.uni-bonn.de/deegree/
008     lat/lon GmbH
009     http://www.lat-lon.de
010    
011     This library is free software; you can redistribute it and/or
012     modify it under the terms of the GNU Lesser General Public
013     License as published by the Free Software Foundation; either
014     version 2.1 of the License, or (at your option) any later version.
015    
016     This library is distributed in the hope that it will be useful,
017     but WITHOUT ANY WARRANTY; without even the implied warranty of
018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019     Lesser General Public License for more details.
020    
021     You should have received a copy of the GNU Lesser General Public
022     License along with this library; if not, write to the Free Software
023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024    
025     Contact:
026    
027     Andreas Poth
028     lat/lon GmbH
029     Aennchenstr. 19
030     53115 Bonn
031     Germany
032     E-Mail: poth@lat-lon.de
033    
034     Prof. Dr. Klaus Greve
035     Department of Geography
036     University of Bonn
037     Meckenheimer Allee 166
038     53115 Bonn
039     Germany
040     E-Mail: greve@giub.uni-bonn.de
041    
042     
043     ---------------------------------------------------------------------------*/
044    package org.deegree.ogcwebservices.wms.capabilities;
045    
046    import java.util.ArrayList;
047    import java.util.List;
048    
049    import org.deegree.ogcwebservices.getcapabilities.Operation;
050    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
051    import org.deegree.owscommon.OWSDomainType;
052    
053    /**
054     * Represents the <code>OperationMetadata</code> part in the capabilities
055     * document of a WFS according to the
056     * <code>Web Feature Service Implementation Specification 1.1.0</code>.
057     * <p>
058     * In addition to the <code>GetCapabilities</code> operation that all
059     * <code>OWS 0.3</code> compliant services must implement, it may define some
060     * or all of the following operations: <table border="1">
061     * <table>
062     *  <tr>
063     *      <td></td>
064     *  <tr>
065     * </table>
066     * 
067     * 
068     * @see org.deegree.ogcwebservices.getcapabilities.OperationsMetadata
069     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
070     * @author last edited by: $Author: apoth $
071     * 
072     * @version 1.0. $Revision: 9345 $, $Date: 2007-12-27 17:22:25 +0100 (Do, 27 Dez 2007) $
073     * 
074     * @since 2.0
075     */
076    
077    public class WMSOperationsMetadata extends OperationsMetadata {
078    
079        private static final long serialVersionUID = 3864454877736817781L;
080    
081        /**
082         * The name of the GetMap operation.
083         */
084        public static final String GETMAP = "GetMap";
085        
086        /**
087         * The name of the GetMap operation.
088         */
089        public static final String MAP = "Map";
090        
091        /**
092         * The name of the GetFeatureInfo operation.
093         */
094        public static final String GETFEATUREINFO = "GetFeatureInfo";
095        
096        /**
097         * The name of the GetFeatureInfo operation.
098         */
099        public static final String FEATUREINFO = "FeatureInfo";
100        
101        /**
102         * The name of the DescribeLayer operation.
103         */
104        public static final String DESCRIBELAYER = "DescribeLayer";
105        
106        /**
107         * The name of the GetLegendGraphic operation.
108         */
109        public static final String GETLEGENDGRAPHIC = "GetLegendGraphic";
110        
111        /**
112         * The name of the GetStyles operation.
113         */
114        public static final String GETSTYLES = "GetStyles";
115        
116        /**
117         * The name of the PutStyles operation.
118         */
119        public static final String PUTSTYLES = "PutStyles";
120          
121        private Operation getMap;
122    
123        private Operation getFeatureInfo;
124        
125        private Operation describeLayer;
126        
127        private Operation getLegendGraphic;
128        
129        private Operation getStyles;
130        
131        private Operation putStyles;
132        
133        /**
134         * Constructs a new <code>WMSOperationsMetadata</code> instance from the
135         * given parameters.
136         *
137         * @param getCapabilities 
138         * @param getMap 
139         * @param getFeatureInfo 
140         * @param describeLayer 
141         * @param getLegendGraphic 
142         * @param getStyles 
143         * @param putStyles 
144         * @param parameters 
145         * @param constraints 
146         */
147        public WMSOperationsMetadata(Operation getCapabilities, Operation getMap, Operation getFeatureInfo,
148                                     Operation describeLayer, Operation getLegendGraphic,
149                                     Operation getStyles, Operation putStyles, 
150                                     OWSDomainType[] parameters, OWSDomainType[] constraints) {
151            super(getCapabilities, parameters, constraints);
152            this.getMap = getMap;
153            this.getFeatureInfo = getFeatureInfo;
154            this.getLegendGraphic = getLegendGraphic;
155            this.describeLayer = describeLayer;
156            this.getStyles = getStyles;
157            this.putStyles = putStyles;
158        }
159    
160        /**
161         * @return all <code>Operations</code> known to the WFS.
162         * 
163         */
164        @Override
165        public Operation[] getOperations() {
166            List<Operation> list = new ArrayList<Operation>(10);
167            list.add( getMap );
168            list.add( getCapabilitiesOperation );
169            if ( describeLayer != null ) {
170                list.add( describeLayer );
171            }
172            if ( getFeatureInfo != null ) {
173                list.add( getFeatureInfo );
174            }
175            if ( getStyles != null ) {
176                list.add( getStyles );
177            }
178            if ( putStyles != null ) {
179                list.add( putStyles );
180            }
181            if ( getLegendGraphic != null ) {
182                list.add( getLegendGraphic );
183            }
184            Operation[] ops = new Operation[list.size()];
185            return list.toArray( ops );
186        }
187    
188        /**
189         * @return Returns the describeLayer.
190         */
191        public Operation getDescribeLayer() {
192            return describeLayer;
193        }
194    
195        /**
196         * @param describeLayer The describeLayer to set.
197         */
198        public void setDescribeLayer( Operation describeLayer ) {
199            this.describeLayer = describeLayer;
200        }
201    
202        /**
203         * @return Returns the getFeatureInfo.
204         */
205        public Operation getGetFeatureInfo() {
206            return getFeatureInfo;
207        }
208    
209        /**
210         * @param getFeatureInfo The getFeatureInfo to set.
211         */
212        public void setGetFeatureInfo( Operation getFeatureInfo ) {
213            this.getFeatureInfo = getFeatureInfo;
214        }
215    
216        /**
217         * @return Returns the getLegendGraphic.
218         */
219        public Operation getGetLegendGraphic() {
220            return getLegendGraphic;
221        }
222    
223        /**
224         * @param getLegendGraphic The getLegendGraphic to set.
225         */
226        public void setGetLegendGraphic( Operation getLegendGraphic ) {
227            this.getLegendGraphic = getLegendGraphic;
228        }
229    
230        /**
231         * @return Returns the getMap.
232         */
233        public Operation getGetMap() {
234            return getMap;
235        }
236    
237        /**
238         * @param getMap The getMap to set.
239         */
240        public void setGetMap( Operation getMap ) {
241            this.getMap = getMap;
242        }
243    
244        /**
245         * @return Returns the getStyles.
246         */
247        public Operation getGetStyles() {
248            return getStyles;
249        }
250    
251        /**
252         * @param getStyles The getStyles to set.
253         */
254        public void setGetStyles( Operation getStyles ) {
255            this.getStyles = getStyles;
256        }
257    
258        /**
259         * @return Returns the putStyles.
260         */
261        public Operation getPutStyles() {
262            return putStyles;
263        }
264    
265        /**
266         * @param putStyles The putStyles to set.
267         */
268        public void setPutStyles( Operation putStyles ) {
269            this.putStyles = putStyles;
270        }
271     
272    }