    001    // $HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/ogcwebservices/wcs/configuration/WCSConfiguration.java $
    002
    003    /*----------------------------------------------------------------------------
    004     This file is part of deegree, http://deegree.org/
    005     Copyright (C) 2001-2009 by:
    006       Department of Geography, University of Bonn
    007     and
    008       lat/lon GmbH
    009
    010     This library is free software; you can redistribute it and/or modify it under
    011     the terms of the GNU Lesser General Public License as published by the Free
    012     Software Foundation; either version 2.1 of the License, or (at your option)
    013     any later version.
    014     This library is distributed in the hope that it will be useful, but WITHOUT
    015     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    016     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
    017     details.
    018     You should have received a copy of the GNU Lesser General Public License
    019     along with this library; if not, write to the Free Software Foundation, Inc.,
    020     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    021
    022     Contact information:
    023
    024     lat/lon GmbH
    025     Aennchenstr. 19, 53177 Bonn
    026     Germany
    027     http://lat-lon.de/
    028
    029     Department of Geography, University of Bonn
    030     Prof. Dr. Klaus Greve
    031     Postfach 1147, 53001 Bonn
    032     Germany
    033     http://www.geographie.uni-bonn.de/deegree/
    034
    035     e-mail: info@deegree.org
    036    ----------------------------------------------------------------------------*/
    037    package org.deegree.ogcwebservices.wcs.configuration;
    038
    039    import java.io.IOException;
    040    import java.net.URL;
    041
    042    import org.deegree.ogcbase.CommonNamespaces;
    043    import org.deegree.ogcwebservices.getcapabilities.Capability;
    044    import org.deegree.ogcwebservices.getcapabilities.InvalidCapabilitiesException;
    045    import org.deegree.ogcwebservices.getcapabilities.Service;
    046    import org.deegree.ogcwebservices.wcs.getcapabilities.ContentMetadata;
    047    import org.deegree.ogcwebservices.wcs.getcapabilities.WCSCapabilities;
    048    import org.xml.sax.SAXException;
    049
    050    /**
    051     * @version $Revision: 18195 $
    052     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
    053     * @author last edited by: $Author: mschneider $
    054     *
    055     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
    056     */
    057
    058    public class WCSConfiguration extends WCSCapabilities {
    059
    060        private WCSDeegreeParams deegreeParams = null;
    061
    062        /**
    063         * creates a WCSConfiguration from an URL enabling access to a deegree WCS configuration
    064         * document
    065         *
    066         * @param url
    067         * @return a WCSConfiguration
    068         * @throws IOException
    069         * @throws SAXException
    070         */
    071        public static WCSConfiguration create( URL url )
    072                                throws IOException, SAXException, InvalidCapabilitiesException,
    073                                InvalidConfigurationException {
    074            WCSConfigurationDocument confDoc = new WCSConfigurationDocument();
    075            confDoc.load( url );
    076            return new WCSConfiguration( confDoc );
    077        }
    078
    079        /**
    080         * creates a WCSConfiguration from a deegree WCSConfigurationDocument
    081         *
    082         * @param confDoc
    083         * @throws InvalidCapabilitiesException
    084         * @throws InvalidConfigurationException
    085         */
    086        private WCSConfiguration( WCSConfigurationDocument confDoc ) throws InvalidCapabilitiesException,
    087                                InvalidConfigurationException {
    088            super( confDoc.parseVersion(), null, confDoc.parseServiceSection(),
    089                   confDoc.getCapabilitySection( CommonNamespaces.WCSNS ), confDoc.parseContentMetadataSection() );
    090            this.deegreeParams = confDoc.getDeegreeParamsSection();
    091        }
    092
    093        /**
    094         * creates a WCSConfiguration from its sections
    095         *
    096         * @param version
    097         * @param updateSequence
    098         * @param service
    099         * @param capabilitiy
    100         * @param contentMetadata
    101         */
    102        public WCSConfiguration( String version, String updateSequence, WCSDeegreeParams deegreeParams, Service service,
    103                                 Capability capabilitiy, ContentMetadata contentMetadata ) {
    104            super( version, updateSequence, service, capabilitiy, contentMetadata );
    105            this.deegreeParams = deegreeParams;
    106        }
    107
    108        /**
    109         * @return Returns the deegreeParam.
    110         *
    111         */
    112        public WCSDeegreeParams getDeegreeParams() {
    113            return deegreeParams;
    114        }
    115
    116        /**
    117         * @param deegreeParams
    118         *            The deegreeParam to set.
    119         */
    120        public void setDeegreeParam( WCSDeegreeParams deegreeParams ) {
    121            this.deegreeParams = deegreeParams;
    122        }
    123
    124    }