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