001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wfs/capabilities/WFSCapabilities.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.io.IOException;
039    import java.net.URL;
040    
041    import org.deegree.model.filterencoding.capabilities.FilterCapabilities;
042    import org.deegree.ogcwebservices.getcapabilities.Contents;
043    import org.deegree.ogcwebservices.getcapabilities.InvalidCapabilitiesException;
044    import org.deegree.ogcwebservices.getcapabilities.OGCCapabilities;
045    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
046    import org.deegree.ogcwebservices.getcapabilities.ServiceIdentification;
047    import org.deegree.ogcwebservices.getcapabilities.ServiceProvider;
048    import org.deegree.owscommon.OWSCommonCapabilities;
049    import org.xml.sax.SAXException;
050    
051    /**
052     * Represents the capabilities of an OGC-WFS 1.1.0 compliant service instance.
053     *
054     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
055     * @author last edited by: $Author: mschneider $
056     *
057     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
058     */
059    public class WFSCapabilities extends OWSCommonCapabilities {
060    
061        private static final long serialVersionUID = -8126209663124432256L;
062    
063        private FeatureTypeList featureTypeList;
064    
065        private GMLObject[] servesGMLObjectTypeList;
066    
067        private GMLObject[] supportsGMLObjectTypeList;
068    
069        private FilterCapabilities filterCapabilities;
070    
071        /**
072         * Creates WFSCapabilities from a URL.
073         *
074         * @param url
075         *            location of the capabilities file
076         * @return catalog capabilities
077         * @throws IOException
078         * @throws SAXException
079         * @throws InvalidCapabilitiesException
080         */
081        public static OGCCapabilities createCapabilities( URL url )
082                                throws IOException, SAXException, InvalidCapabilitiesException {
083    
084            WFSCapabilitiesDocument capabilitiesDoc = new WFSCapabilitiesDocument();
085            capabilitiesDoc.load( url );
086            return capabilitiesDoc.parseCapabilities();
087        }
088    
089        /**
090         * Generates a new WFSCapabilities instance from the given parameters.
091         *
092         * @param version
093         * @param updateSequence
094         * @param serviceIdentification
095         * @param serviceProvider
096         * @param operationsMetadata
097         * @param featureTypeList
098         * @param servesGMLObjectTypeList
099         * @param supportsGMLObjectTypeList
100         * @param contents
101         *            TODO field not verified! Check spec.
102         * @param filterCapabilities
103         */
104        public WFSCapabilities( String version, String updateSequence, ServiceIdentification serviceIdentification,
105                                ServiceProvider serviceProvider, OperationsMetadata operationsMetadata,
106                                FeatureTypeList featureTypeList, GMLObject[] servesGMLObjectTypeList,
107                                GMLObject[] supportsGMLObjectTypeList, Contents contents,
108                                FilterCapabilities filterCapabilities ) {
109            super( version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata, contents );
110            this.featureTypeList = featureTypeList;
111            this.servesGMLObjectTypeList = servesGMLObjectTypeList;
112            this.supportsGMLObjectTypeList = supportsGMLObjectTypeList;
113            this.filterCapabilities = filterCapabilities;
114        }
115    
116        /**
117         * Returns the FilterCapabilites section of the capabilities.
118         *
119         * @return the FilterCapabilites section of the capabilities.
120         *
121         */
122        public FilterCapabilities getFilterCapabilities() {
123            return filterCapabilities;
124        }
125    
126        /**
127         * @return Returns the featureTypeList.
128         */
129        public FeatureTypeList getFeatureTypeList() {
130            return this.featureTypeList;
131        }
132    
133        /**
134         * @param featureTypeList
135         *            The featureTypeList to set.
136         */
137        public void setFeatureTypeList( FeatureTypeList featureTypeList ) {
138            this.featureTypeList = featureTypeList;
139        }
140    
141        /**
142         * @return Returns the servesGMLObjectTypeList.
143         */
144        public GMLObject[] getServesGMLObjectTypeList() {
145            return servesGMLObjectTypeList;
146        }
147    
148        /**
149         * @param servesGMLObjectTypeList
150         *            The servesGMLObjectTypeList to set.
151         */
152        public void setServesGMLObjectTypeList( GMLObject[] servesGMLObjectTypeList ) {
153            this.servesGMLObjectTypeList = servesGMLObjectTypeList;
154        }
155    
156        /**
157         * @return Returns the supportsGMLObjectTypeList.
158         */
159        public GMLObject[] getSupportsGMLObjectTypeList() {
160            return supportsGMLObjectTypeList;
161        }
162    
163        /**
164         * @param supportsGMLObjectTypeList
165         *            The supportsGMLObjectTypeList to set.
166         */
167        public void setSupportsGMLObjectTypeList( GMLObject[] supportsGMLObjectTypeList ) {
168            this.supportsGMLObjectTypeList = supportsGMLObjectTypeList;
169        }
170    }