001    //$HeadURL: $
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    
037    package org.deegree.ogcwebservices.wcts.configuration;
038    
039    /**
040     * <code>WCTSDeegreeParams</code> encapsulates all deegree specific configuration.
041     * 
042     * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
043     * 
044     * @author last edited by: $Author:$
045     * 
046     * @version $Revision:$, $Date:$
047     * 
048     */
049    public class WCTSDeegreeParams {
050    
051        private final String configuredCRSProvider;
052    
053        private final boolean useDeegreeTransformType;
054    
055        private final static String DEFAULT_TRANSFORM_ID = "urn:deegree:wcts:transformation:";
056    
057        private final String transformationPrefix;
058    
059        private final boolean createDefaultTransformationsDescription;
060    
061        private final int updateSequence;
062    
063        /**
064         * Instantiate the deegree params with given configured crs provider, full qualified name.
065         * 
066         * @param updateSequence
067         * 
068         * @param configuredCRSProvider
069         * @param transformationPrefix
070         * @param useDeegreeTransformType
071         *            true if transform response elements should use the deegree inline/multipart elements. If false results
072         *            will be put beneath the wcts:OperationResponse element.
073         * @param createDefaultTransformationsDescription
074         */
075        public WCTSDeegreeParams( int updateSequence, String configuredCRSProvider, String transformationPrefix,
076                                  boolean useDeegreeTransformType, boolean createDefaultTransformationsDescription ) {
077            this.updateSequence = updateSequence;
078            this.configuredCRSProvider = configuredCRSProvider;
079            this.createDefaultTransformationsDescription = createDefaultTransformationsDescription;
080            if ( transformationPrefix == null || "".equals( transformationPrefix ) ) {
081                this.transformationPrefix = DEFAULT_TRANSFORM_ID;
082            } else {
083                this.transformationPrefix = transformationPrefix;
084            }
085            this.useDeegreeTransformType = useDeegreeTransformType;
086        }
087    
088        /**
089         * Instantiate the deegree params with given configured crs provider, full qualified name.
090         * 
091         * @param configuredCRSProvider
092         * @param useDeegreeTransformType
093         *            true if transform response elements should use the deegree inline/multipart elements. If false results
094         *            will be put beneath the wcts:OperationResponse element.
095         */
096        public WCTSDeegreeParams( String configuredCRSProvider, boolean useDeegreeTransformType ) {
097            this( -1, configuredCRSProvider, DEFAULT_TRANSFORM_ID, useDeegreeTransformType, false );
098        }
099    
100        /**
101         * @param useDeegreeTransformType
102         *            true if transform response elements should use the deegree inline/multipart elements. If false results
103         *            will be put beneath the wcts:OperationResponse element.
104         */
105        public WCTSDeegreeParams( boolean useDeegreeTransformType ) {
106            this( -1, null, DEFAULT_TRANSFORM_ID, useDeegreeTransformType, false );
107        }
108    
109        /**
110         * Using standard provider, the default transformation prefix and the deegree transform response.
111         */
112        public WCTSDeegreeParams() {
113            this( -1, null, DEFAULT_TRANSFORM_ID, true, false );
114        }
115    
116        /**
117         * @return the configuredCRSProvider might be <code>null</code> if no provider was configured.
118         */
119        public final String getConfiguredCRSProvider() {
120            return configuredCRSProvider;
121        }
122    
123        /**
124         * @return true if the transform response should be inside deegree:inline/deegree:multipart elements or if false
125         *         they will be put directly beneath the operationresponse element.
126         */
127        public final boolean useDeegreeTransformType() {
128            return useDeegreeTransformType;
129        }
130    
131        /**
132         * @return the transformationPrefix will never be <code>null</code> the default is
133         *         "urn:deegree:wcts:transformation:".
134         */
135        public final String getTransformationPrefix() {
136            return transformationPrefix;
137        }
138    
139        /**
140         * @return true if the descriptions for the default transformations should be created.
141         */
142        public final boolean createDefaultTransformationsDescription() {
143            return createDefaultTransformationsDescription;
144        }
145    
146        /**
147         * @return the updateSequence
148         */
149        public final int getUpdateSequence() {
150            return updateSequence;
151        }
152    }