001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wfs/configuration/WFSDeegreeParams.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.wfs.configuration;
037    
038    import java.io.File;
039    
040    import org.deegree.enterprise.DeegreeParams;
041    import org.deegree.io.datastore.LockManager;
042    import org.deegree.model.metadata.iso19115.OnlineResource;
043    import org.deegree.ogcwebservices.wfs.WFService;
044    
045    /**
046     * Represents the specific <code>deegreeParams</code> section of the configuration document for a {@link WFService}
047     * instance. This class encapsulates the deegree WFS specific parameters and inherits the parameters from the
048     * {@link DeegreeParams} class.
049     * <p>
050     * It adds the following elements to the common <code>deegreeParams<code>:
051     * <table border="1">
052     * <tr>
053     * <th>Name</th>
054     * <th>Mandatory</th>
055     * <th>Function</th>
056     * </tr>
057     * <tr>
058     * <td>DataDirectoryList/td>
059     * <td align="center">+</td>
060     * <td>List of directories to be scanned for featuretypes/datastores to be served by the WFS.
061     * </td>
062     * <td>LockManagerDirectory/td>
063     * <td align="center">-</td>
064     * <td>Directory where information about locked features is stored.</td>
065     * </td>
066     * </tr>
067     * </table>
068     *
069     * @see org.deegree.enterprise.DeegreeParams
070     *
071     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
072     * @author last edited by: $Author: mschneider $
073     *
074     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
075     */
076    public class WFSDeegreeParams extends DeegreeParams {
077    
078        private static final long serialVersionUID = 2425998383206611958L;
079    
080        private String[] dataDirectories;
081    
082        private File lockManagerDirectory;
083    
084        private boolean checkUTMZones;
085    
086        private static boolean switchAxes;
087    
088        private boolean printGeomGmlIds;
089    
090        /**
091         * Creates a new <code>WFSDeegreeParams</code> instance.
092         *
093         * @param defaultOnlineResource
094         * @param cacheSize
095         * @param requestTimeLimit
096         * @param characterSet
097         * @param dataDirectories
098         * @param lockManagerDirectory
099         *            may be null
100         */
101        WFSDeegreeParams( OnlineResource defaultOnlineResource, int cacheSize, int requestTimeLimit, String characterSet,
102                          String[] dataDirectories, File lockManagerDirectory ) {
103            super( defaultOnlineResource, cacheSize, requestTimeLimit, characterSet );
104            this.dataDirectories = dataDirectories;
105            this.lockManagerDirectory = lockManagerDirectory;
106        }
107    
108        WFSDeegreeParams( OnlineResource defaultOnlineResource, int cacheSize, int requestTimeLimit, String characterSet,
109                          String[] dataDirectories, File lockManagerDirectory, boolean checkUTMZones ) {
110            this( defaultOnlineResource, cacheSize, requestTimeLimit, characterSet, dataDirectories, lockManagerDirectory );
111            this.checkUTMZones = checkUTMZones;
112        }
113    
114        WFSDeegreeParams( OnlineResource defaultOnlineResource, int cacheSize, int requestTimeLimit, String characterSet,
115                          String[] dataDirectories, File lockManagerDirectory, boolean checkUTMZones, boolean switchAxes ) {
116            this( defaultOnlineResource, cacheSize, requestTimeLimit, characterSet, dataDirectories, lockManagerDirectory,
117                  checkUTMZones );
118            WFSDeegreeParams.switchAxes = switchAxes;
119        }
120    
121        WFSDeegreeParams( OnlineResource defaultOnlineResource, int cacheSize, int requestTimeLimit, String characterSet,
122                          String[] dataDirectories, File lockManagerDirectory, boolean checkUTMZones, boolean switchAxes,
123                          boolean printGeomGmlIds ) {
124            this( defaultOnlineResource, cacheSize, requestTimeLimit, characterSet, dataDirectories, lockManagerDirectory,
125                  checkUTMZones, switchAxes );
126            this.printGeomGmlIds = printGeomGmlIds;
127        }
128    
129        /**
130         * Returns the resolved (absolute) data directory paths.
131         *
132         * @return the resolved (absolute) data directory paths
133         */
134        public String[] getDataDirectories() {
135            return this.dataDirectories;
136        }
137    
138        /**
139         * Returns the directory where the {@link LockManager} will store its files.
140         *
141         * @return the directory where the {@link LockManager} will store its files, may be null
142         */
143        public File getLockManagerDirectory() {
144            return this.lockManagerDirectory;
145        }
146    
147        /**
148         * @return whether to check for correct UTM zones in bounding boxes
149         */
150        public boolean checkUTMZones() {
151            return checkUTMZones;
152        }
153    
154        /**
155         * Please note that this is a global setting!
156         *
157         * @return whether to switch x/y to y/x for EPSG 4326
158         */
159        public static boolean getSwitchAxes() {
160            return switchAxes;
161        }
162    
163        /**
164         * Please note that this is a global setting!
165         *
166         * @return whether to print out GML ids for geometries.
167         */
168        public boolean printGeometryGmlIds() {
169            return printGeomGmlIds;
170        }
171    
172    }