001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wcs/describecoverage/CoverageOffering.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.wcs.describecoverage;
037    
038    import java.io.Serializable;
039    
040    import org.deegree.model.metadata.iso19115.Keywords;
041    import org.deegree.ogcbase.OGCException;
042    import org.deegree.ogcwebservices.LonLatEnvelope;
043    import org.deegree.ogcwebservices.MetadataLink;
044    import org.deegree.ogcwebservices.SupportedFormats;
045    import org.deegree.ogcwebservices.SupportedSRSs;
046    import org.deegree.ogcwebservices.wcs.CoverageOfferingBrief;
047    import org.deegree.ogcwebservices.wcs.SupportedInterpolations;
048    import org.deegree.ogcwebservices.wcs.WCSException;
049    import org.deegree.ogcwebservices.wcs.configuration.Extension;
050    
051    /**
052     * @version $Revision: 18195 $
053     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
054     * @author last edited by: $Author: mschneider $
055     *
056     * @version 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
057     *
058     * @since 2.0
059     */
060    
061    public class CoverageOffering extends CoverageOfferingBrief implements Cloneable, Serializable {
062    
063        private static final long serialVersionUID = -2280508956895529051L;
064    
065        private DomainSet domainSet = null;
066    
067        private RangeSet rangeSet = null;
068    
069        private SupportedSRSs supportedCRSs = null;
070    
071        private SupportedFormats supportedFormats = null;
072    
073        private SupportedInterpolations supportedInterpolations = new SupportedInterpolations();
074    
075        private Extension extension = null;
076    
077        /**
078         * @param name
079         * @param label
080         * @param description
081         * @param metadataLink
082         * @param lonLatEnvelope
083         * @param keywords
084         * @param domainSet
085         * @param rangeSet
086         * @param supportedCRSs
087         * @param supportedFormats
088         * @param supportedInterpolations
089         * @throws OGCException
090         * @throws WCSException
091         */
092        public CoverageOffering( String name, String label, String description, MetadataLink metadataLink,
093                                 LonLatEnvelope lonLatEnvelope, Keywords[] keywords, DomainSet domainSet,
094                                 RangeSet rangeSet, SupportedSRSs supportedCRSs, SupportedFormats supportedFormats,
095                                 SupportedInterpolations supportedInterpolations, Extension extension )
096                                throws OGCException, WCSException {
097            super( name, label, description, metadataLink, lonLatEnvelope, keywords );
098            setDomainSet( domainSet );
099            setRangeSet( rangeSet );
100            setSupportedCRSs( supportedCRSs );
101            setSupportedFormats( supportedFormats );
102            setSupportedInterpolations( supportedInterpolations );
103            setExtension( extension );
104        }
105    
106        /**
107         * @return Returns the domainSet.
108         *
109         */
110        public DomainSet getDomainSet() {
111            return domainSet;
112        }
113    
114        /**
115         * @param domainSet
116         *            The domainSet to set.
117         */
118        public void setDomainSet( DomainSet domainSet )
119                                throws WCSException {
120            if ( domainSet == null ) {
121                throw new WCSException( "domainSet must be <> null for CoverageOffering" );
122            }
123            this.domainSet = domainSet;
124        }
125    
126        /**
127         * @return Returns the rangeSet.
128         */
129        public RangeSet getRangeSet() {
130            return rangeSet;
131        }
132    
133        /**
134         * @param rangeSet
135         *            The rangeSet to set.
136         */
137        public void setRangeSet( RangeSet rangeSet )
138                                throws WCSException {
139            if ( rangeSet == null ) {
140                throw new WCSException( "rangeSet must be <> null for CoverageOffering" );
141            }
142            this.rangeSet = rangeSet;
143        }
144    
145        /**
146         * @return Returns the supportedCRSs.
147         */
148        public SupportedSRSs getSupportedCRSs() {
149            return supportedCRSs;
150        }
151    
152        /**
153         * @param supportedCRSs
154         *            The supportedCRSs to set.
155         */
156        public void setSupportedCRSs( SupportedSRSs supportedCRSs )
157                                throws WCSException {
158            if ( supportedCRSs == null ) {
159                throw new WCSException( "supportedCRSs must be <> null for CoverageOffering" );
160            }
161            this.supportedCRSs = supportedCRSs;
162        }
163    
164        /**
165         * @return Returns the supportedFormats.
166         */
167        public SupportedFormats getSupportedFormats() {
168            return supportedFormats;
169        }
170    
171        /**
172         * @param supportedFormats
173         *            The supportedFormats to set.
174         */
175        public void setSupportedFormats( SupportedFormats supportedFormats )
176                                throws WCSException {
177            if ( supportedFormats == null ) {
178                throw new WCSException( "supportedFormatss must be <> null for CoverageOffering" );
179            }
180            this.supportedFormats = supportedFormats;
181        }
182    
183        /**
184         * @return Returns the supportedInterpolations.
185         */
186        public SupportedInterpolations getSupportedInterpolations() {
187            return supportedInterpolations;
188        }
189    
190        /**
191         * If <tt>null</tt> will be passed supportedInterpolations will be set to its default.
192         *
193         * @param supportedInterpolations
194         *            The supportedInterpolations to set.
195         */
196        public void setSupportedInterpolations( SupportedInterpolations supportedInterpolations ) {
197            if ( supportedCRSs != null ) {
198                this.supportedInterpolations = supportedInterpolations;
199            }
200        }
201    
202        /**
203         * @return Returns the extension.
204         */
205        public Extension getExtension() {
206            return extension;
207        }
208    
209        /**
210         * @param extension
211         *            The extension to set.
212         */
213        public void setExtension( Extension extension ) {
214            this.extension = extension;
215        }
216    
217        /**
218         * @see java.lang.Object#clone()
219         */
220        public Object clone() {
221            try {
222                DomainSet domainSet_ = (DomainSet) domainSet.clone();
223                RangeSet rangeSet_ = null;
224                if ( rangeSet != null ) {
225                    rangeSet_ = (RangeSet) rangeSet.clone();
226                }
227    
228                LonLatEnvelope llenv = (LonLatEnvelope) getLonLatEnvelope().clone();
229    
230                return new CoverageOffering( getName(), getLabel(), getDescription(), getMetadataLink(), llenv,
231                                             getKeywords(), domainSet_, rangeSet_, supportedCRSs, supportedFormats,
232                                             supportedInterpolations, extension );
233            } catch ( Exception e ) {
234                e.printStackTrace();
235            }
236            return null;
237        }
238    
239    }