001    // $HeadURL:
002    // /cvsroot/deegree/src/org/deegree/ogcwebservices/csw/configuration/CatalogConfiguration.java,v
003    // 1.6 2004/07/12 12:23:21 tf Exp $
004    /*----------------------------------------------------------------------------
005     This file is part of deegree, http://deegree.org/
006     Copyright (C) 2001-2009 by:
007       Department of Geography, University of Bonn
008     and
009       lat/lon GmbH
010    
011     This library is free software; you can redistribute it and/or modify it under
012     the terms of the GNU Lesser General Public License as published by the Free
013     Software Foundation; either version 2.1 of the License, or (at your option)
014     any later version.
015     This library is distributed in the hope that it will be useful, but WITHOUT
016     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
017     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
018     details.
019     You should have received a copy of the GNU Lesser General Public License
020     along with this library; if not, write to the Free Software Foundation, Inc.,
021     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
022    
023     Contact information:
024    
025     lat/lon GmbH
026     Aennchenstr. 19, 53177 Bonn
027     Germany
028     http://lat-lon.de/
029    
030     Department of Geography, University of Bonn
031     Prof. Dr. Klaus Greve
032     Postfach 1147, 53001 Bonn
033     Germany
034     http://www.geographie.uni-bonn.de/deegree/
035    
036     e-mail: info@deegree.org
037    ----------------------------------------------------------------------------*/
038    
039    package org.deegree.ogcwebservices.csw.configuration;
040    
041    import java.io.IOException;
042    import java.net.URL;
043    
044    import org.deegree.framework.xml.InvalidConfigurationException;
045    import org.deegree.model.filterencoding.capabilities.FilterCapabilities;
046    import org.deegree.ogcwebservices.csw.capabilities.CatalogueCapabilities;
047    import org.deegree.ogcwebservices.csw.capabilities.EBRIMCapabilities;
048    import org.deegree.ogcwebservices.getcapabilities.Contents;
049    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
050    import org.deegree.ogcwebservices.getcapabilities.ServiceIdentification;
051    import org.deegree.ogcwebservices.getcapabilities.ServiceProvider;
052    import org.xml.sax.SAXException;
053    
054    /**
055     * Represents the configuration for a deegree CSW 2.0 instance.
056     *
057     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
058     * @author last edited by: $Author: mschneider $
059     *
060     * @version 2.0, $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
061     *
062     * @since 2.0
063     */
064    public class CatalogueConfiguration extends CatalogueCapabilities {
065    
066        private static final long serialVersionUID = 8811280848785864001L;
067    
068        private CatalogueDeegreeParams catalogDeegreeParams;
069    
070        private URL systemId;
071    
072        /**
073         * Creates a catalog configuration from an URL
074         *
075         * @param url
076         * @return the new instance
077         * @throws IOException
078         * @throws SAXException
079         * @throws InvalidConfigurationException
080         */
081        public static CatalogueConfiguration createConfiguration( URL url )
082                                throws IOException, SAXException, InvalidConfigurationException {
083            CatalogueConfigurationDocument confDoc = new CatalogueConfigurationDocument();
084            confDoc.load( url );
085            CatalogueConfiguration configuration = confDoc.getConfiguration();
086            return configuration;
087        }
088    
089        /**
090         * Generates a new CatalogConfiguration instance from the given parameters.
091         *
092         * @param version
093         * @param updateSequence
094         *            Optional value of service metadata document version, value is increased whenever
095         *            any change is made in complete service metadata document. The value must be
096         *            character string type, not empty.
097         * @param serviceIdentification
098         * @param serviceProvider
099         * @param operationsMetadata
100         * @param contents
101         * @param filterCapabilities
102         * @param catalogDeegreeParams
103         * @param systemId
104         */
105        CatalogueConfiguration( String version, String updateSequence, ServiceIdentification serviceIdentification,
106                                ServiceProvider serviceProvider, OperationsMetadata operationsMetadata, Contents contents,
107                                FilterCapabilities filterCapabilities, CatalogueDeegreeParams catalogDeegreeParams,
108                                URL systemId ) {
109            super( version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata, contents,
110                   filterCapabilities );
111            this.catalogDeegreeParams = catalogDeegreeParams;
112    
113            this.systemId = systemId;
114    
115        }
116    
117        /**
118         * Generates a new CatalogConfiguration instance from the given parameters.
119         *
120         * @param version
121         * @param updateSequence
122         *            Optional value of service metadata document version, value is increased whenever
123         *            any change is made in complete service metadata document. The value must be
124         *            character string type, not empty.
125         * @param serviceIdentification
126         * @param serviceProvider
127         * @param operationsMetadata
128         * @param contents
129         * @param filterCapabilities
130         * @param catalogDeegreeParams
131         * @param systemId
132         * @param ebrimCaps
133         *            the specified ebrim extensions
134         */
135        CatalogueConfiguration( String version, String updateSequence, ServiceIdentification serviceIdentification,
136                                ServiceProvider serviceProvider, OperationsMetadata operationsMetadata, Contents contents,
137                                FilterCapabilities filterCapabilities, CatalogueDeegreeParams catalogDeegreeParams,
138                                URL systemId, EBRIMCapabilities ebrimCaps ) {
139            super( version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata, contents,
140                   filterCapabilities, ebrimCaps );
141            this.catalogDeegreeParams = catalogDeegreeParams;
142    
143            this.systemId = systemId;
144    
145        }
146    
147        /**
148         * Returns the <code>deegreeParams</code> -section of the configuration.
149         *
150         * @return the <code>deegreeParams</code> -section of the configuration.
151         */
152        public CatalogueDeegreeParams getDeegreeParams() {
153            return catalogDeegreeParams;
154        }
155    
156        /**
157         * Sets the <code>deegreeParams</code> -section of the configuration.
158         *
159         * @param deegreeParams
160         */
161        public void setDeegreeParams( CatalogueDeegreeParams deegreeParams ) {
162            this.catalogDeegreeParams = deegreeParams;
163        }
164    
165        /**
166         * @return a most important systemId, needed for almost everything
167         */
168        public URL getSystemId() {
169            return systemId;
170        }
171    
172    }