001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/ogcwebservices/wcs/getcoverage/DomainSubset.java $
002    package org.deegree.ogcwebservices.wcs.getcoverage;
003    
004    import org.deegree.datatypes.Code;
005    import org.deegree.datatypes.time.TimeSequence;
006    import org.deegree.ogcbase.ExceptionCode;
007    import org.deegree.ogcwebservices.wcs.WCSException;
008    
009    /**
010     * @version $Revision: 6259 $
011     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
012     * @author last edited by: $Author: bezema $
013     * 
014     * $Revision: 6259 $, $Date: 2007-03-20 10:15:15 +0100 (Di, 20 Mär 2007) $
015     */
016    
017    public class DomainSubset {
018    
019        private Code requestSRS = null;
020        private SpatialSubset spatialSubset = null;
021        private TimeSequence temporalSubset = null;
022    
023       
024        /**
025         * @param requestSRS 
026         * @param spatialSubset
027         * @throws WCSException 
028         */
029        public DomainSubset(Code requestSRS, SpatialSubset spatialSubset) throws WCSException {
030            this( requestSRS, spatialSubset, null );
031        }
032        
033        /**
034         * @param requestSRS 
035         * @param temporalSubset
036         * @throws WCSException 
037         */
038        public DomainSubset(Code requestSRS, TimeSequence temporalSubset) throws WCSException {
039            this( requestSRS, null, temporalSubset );
040        }
041        
042        /**
043         * @param requestSRS 
044         * @param spatialSubset
045         * @param temporalSubset
046         * @throws WCSException if one of the parameters is null
047         */
048        public DomainSubset(Code requestSRS, SpatialSubset spatialSubset, TimeSequence temporalSubset) 
049                            throws WCSException {
050            if ( spatialSubset == null && temporalSubset == null ) {
051                ExceptionCode code = ExceptionCode.MISSINGPARAMETERVALUE;
052                throw new WCSException( "GetCoverage", "at least spatialSubset " +
053                        "or temporalSubset must be <> null in DomainSubset", code );
054            }
055            if ( requestSRS == null ) {
056                ExceptionCode code = ExceptionCode.MISSINGPARAMETERVALUE;
057                throw new WCSException( "GetCoverage", "'crs/requestSRS' is missing", code );
058            }
059            this.requestSRS = requestSRS;
060            this.spatialSubset = spatialSubset;
061            this.temporalSubset = temporalSubset;
062        }
063    
064        /**
065         * @return Returns the spatialSubset.
066         * 
067         */
068        public SpatialSubset getSpatialSubset() {
069            return spatialSubset;
070        }
071    
072        /**
073         * @return Returns the temporalSubset.
074         */
075        public TimeSequence getTemporalSubset() {
076            return temporalSubset;
077        }
078    
079        /**
080         * @return Returns the requestSRS.
081         */
082        public Code getRequestSRS() {
083            return requestSRS;
084        }
085        
086        @Override
087        public String toString(){
088            StringBuffer sb = new StringBuffer(300);
089            sb.append("requestSRS=");
090            sb.append( requestSRS );
091            sb.append(", spatialSubset="  );
092            sb.append( spatialSubset );
093            return sb.toString();
094        }
095    
096    }
097    /* ********************************************************************
098    Changes to this class. What the people have been up to:
099    $Log$
100    Revision 1.5  2006/11/29 15:58:57  bezema
101    added toString and fixed javadoc and warnings
102    
103    Revision 1.4  2006/07/12 14:46:18  poth
104    comment footer added
105    
106    ********************************************************************** */