001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/ogcwebservices/csw/capabilities/CatalogueCapabilities.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.csw.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 for an OGC-CSW 2.0.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     */
060    
061    public class CatalogueCapabilities extends OWSCommonCapabilities {
062    
063        /**
064         *
065         */
066        private static final long serialVersionUID = 1351565525170636799L;
067    
068        private FilterCapabilities filterCapabilities;
069    
070        private EBRIMCapabilities ebrimCaps;
071    
072        /**
073         * Creates catalog capabilities from a URL.
074         *
075         * @param url
076         *            location of the capabilities file
077         * @return catalog capabilities
078         * @throws IOException
079         * @throws SAXException
080         * @throws InvalidCapabilitiesException
081         */
082        public static OGCCapabilities createCapabilities( URL url )
083                                throws IOException, SAXException, InvalidCapabilitiesException {
084            OGCCapabilities capabilities = null;
085            CatalogueCapabilitiesDocument capabilitiesDoc = new CatalogueCapabilitiesDocument();
086            capabilitiesDoc.load( url );
087            capabilities = capabilitiesDoc.parseCapabilities();
088            return capabilities;
089        }
090    
091        /**
092         * Generates a new CatalogCapabilities instance from the given parameters.
093         *
094         * @param version
095         * @param updateSequence
096         * @param serviceIdentification
097         * @param serviceProvider
098         * @param operationsMetadata
099         * @param contents
100         * @param filterCapabilities
101         */
102        public CatalogueCapabilities( String version, String updateSequence,
103                                      ServiceIdentification serviceIdentification,
104                                      ServiceProvider serviceProvider,
105                                      OperationsMetadata operationsMetadata, Contents contents,
106                                      FilterCapabilities filterCapabilities ) {
107            super( version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata,
108                   contents );
109            this.filterCapabilities = filterCapabilities;
110        }
111    
112        /**
113         * Generates a new CatalogCapabilities instance from the given parameters.
114         *
115         * @param version
116         * @param updateSequence
117         * @param serviceIdentification
118         * @param serviceProvider
119         * @param operationsMetadata
120         * @param contents
121         * @param filterCapabilities
122         * @param ebrimCaps
123         *            the specified ebrim extensions
124         */
125        public CatalogueCapabilities( String version, String updateSequence,
126                                      ServiceIdentification serviceIdentification,
127                                      ServiceProvider serviceProvider,
128                                      OperationsMetadata operationsMetadata, Contents contents,
129                                      FilterCapabilities filterCapabilities, EBRIMCapabilities ebrimCaps ) {
130            super( version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata,
131                   contents );
132            this.filterCapabilities = filterCapabilities;
133            this.ebrimCaps = ebrimCaps;
134        }
135    
136        /**
137         * Returns the FilterCapabilites section of the capabilities.
138         *
139         * @return the FilterCapabilites section of the capabilities
140         */
141        public FilterCapabilities getFilterCapabilities() {
142            return filterCapabilities;
143        }
144    
145        /**
146         * @return the ebrimCaps specified by the ogc ebrim-extension.
147         */
148        public EBRIMCapabilities getEbrimCaps() {
149            return ebrimCaps;
150        }
151    
152    }