⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 geoserverconfigurationform.java

📁 电子地图服务器,搭建自己的地图服务
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 * Created on Jan 27, 2004
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vfny.geoserver.form.global;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.vfny.geoserver.config.ContactConfig;
import org.vfny.geoserver.config.GlobalConfig;
import org.vfny.geoserver.global.GeoServer;
import org.vfny.geoserver.global.dto.GeoServerDTO;
import org.vfny.geoserver.global.dto.GeoServerDTO.Defaults;
import java.util.logging.Level;
import javax.servlet.http.HttpServletRequest;


/**
 * GeoServerConfigurationForm purpose.
 * <p>
 * Description of GeoServerConfigurationForm ...
 * </p>
 *
 * <p>
 * Capabilities:
 * </p>
 * <ul>
 * <li>
 * Feature: description
 * </li>
 * </ul>
 * <p>
 * Example Use:
 * </p>
 * <pre><code>
 * GeoServerConfigurationForm x = new GeoServerConfigurationForm(...);
 * </code></pre>
 *
 * @author User, Refractions Research, Inc.
 * @author $Author: cholmesny $ (last modification)
 * @version $Id: GeoServerConfigurationForm.java 7226 2007-07-10 19:28:46Z saul.farber $
 */
public class GeoServerConfigurationForm extends ActionForm {
    private int maxFeatures;
    private boolean verbose;
    private int numDecimals;
    private String charset;
    private String proxyBaseUrl;
    private String schemaBaseURL;
    private String log4jConfigFile;
    private String adminUserName;
    private String adminPassword;
    private boolean verboseExceptions;

    /** The name of the contact person */
    private String contactPerson;

    /** The name of the organization with which the contact is affiliated. */
    private String contactOrganization;

    /** The position of the contact within their organization. */
    private String contactPosition;

    /** The type of address specified, such as postal. */
    private String addressType;

    /** The actual street address. */
    private String address;

    /** The city of the address. */
    private String addressCity;

    /** The state/prov. of the address. */
    private String addressState;

    /** The postal code for the address. */
    private String addressPostalCode;

    /** The country of the address. */
    private String addressCountry;

    /** The contact phone number. */
    private String contactVoice;

    /** The contact Fax number. */
    private String contactFacsimile;

    /** The contact email address. */
    private String contactEmail;
    private boolean verboseChecked;
    private boolean verboseExceptionsChecked;

    /** log to disk ? **/
    private boolean suppressStdOutLogging;
    private boolean suppressStdOutLoggingChecked;
    private String logLocation;
    private double jaiMemoryCapacity;
    private double jaiMemoryThreshold;
    private int jaiTileThreads;
    private int jaiTilePriority;
    private boolean jaiRecycling;
    private boolean jaiRecyclingChecked;
    private boolean imageIOCache;
    private boolean imageIOCacheChecked;
    private boolean jaiJPEGNative;
    private boolean jaiJPEGNativeChecked;
    private boolean jaiPNGNative;
    private boolean jaiPNGNativeChecked;

    /** tile cache location, full url or relative path */
    private String tileCache;

    public void reset(ActionMapping arg0, HttpServletRequest request) {
        super.reset(arg0, request);

        GlobalConfig globalConfig = (GlobalConfig) getServlet().getServletContext()
                                                       .getAttribute(GlobalConfig.CONFIG_KEY);

        maxFeatures = globalConfig.getMaxFeatures();
        verbose = globalConfig.isVerbose();
        verboseExceptions = globalConfig.isVerboseExceptions();
        verboseChecked = false;
        verboseExceptionsChecked = false;
        numDecimals = globalConfig.getNumDecimals();
        charset = globalConfig.getCharSet().name();
        proxyBaseUrl = globalConfig.getProxyBaseUrl();
        schemaBaseURL = globalConfig.getSchemaBaseUrl();
        adminUserName = globalConfig.getAdminUserName();
        adminPassword = globalConfig.getAdminPassword();

        log4jConfigFile = globalConfig.getLog4jConfigFile();

        suppressStdOutLogging = globalConfig.getSuppressStdOutLogging();
        suppressStdOutLoggingChecked = false;
        logLocation = globalConfig.getLogLocation();

        jaiMemoryCapacity = globalConfig.getJaiMemoryCapacity();
        jaiMemoryThreshold = globalConfig.getJaiMemoryThreshold();
        jaiTileThreads = globalConfig.getJaiTileThreads();
        jaiTilePriority = globalConfig.getJaiTilePriority();
        jaiRecycling = globalConfig.isJaiRecycling();
        jaiRecyclingChecked = false;
        imageIOCache = globalConfig.isImageIOCache();
        imageIOCacheChecked = false;
        jaiJPEGNative = globalConfig.isJaiJPEGNative();
        jaiJPEGNativeChecked = false;
        jaiPNGNative = globalConfig.isJaiPNGNative();
        jaiPNGNativeChecked = false;

        tileCache = globalConfig.getTileCache();

        ContactConfig contactConfig = globalConfig.getContact();
        contactPerson = contactConfig.getContactPerson();
        contactOrganization = contactConfig.getContactOrganization();
        contactPosition = contactConfig.getContactPosition();

        addressType = contactConfig.getAddressType();
        address = contactConfig.getAddress();
        addressCity = contactConfig.getAddressCity();
        addressCountry = contactConfig.getAddressCountry();
        addressPostalCode = contactConfig.getAddressPostalCode();
        addressState = contactConfig.getAddressState();

        contactVoice = contactConfig.getContactVoice();
        contactFacsimile = contactConfig.getContactFacsimile();
        contactEmail = contactConfig.getContactEmail();
    }

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();

        final long maxMemoryAvailable = Runtime.getRuntime().maxMemory() - (4 * 1024 * 1024);

        if ((jaiMemoryCapacity < 0) || (jaiMemoryCapacity > Defaults.JaiMemoryCapacity)) {
            errors.add("jaiMemCapacity",
                new ActionError("error.geoserver.JAIMemCapacity",
                    new Long(Defaults.JaiMemoryCapacity)));
        }

        if ((jaiMemoryThreshold < 0.0) || (jaiMemoryThreshold > 1.0)) {
            errors.add("jaiMemThreshold", new ActionError("error.geoserver.JAIMemThreshold"));
        }

        if ((jaiTileThreads < 0) || (jaiTileThreads > 100)) {
            errors.add("jaiTileThreads", new ActionError("error.geoserver.JAITileThreads"));
        }

        if ((jaiTilePriority < 1) || (jaiTilePriority > 10)) {
            errors.add("jaiTilePriority", new ActionError("error.geoserver.JAITilePriority"));
        }

        return errors;
    }

    /**
     * Access maxFeatures property.
     *
     * @return Returns the maxFeatures.
     */
    public int getMaxFeatures() {
        return maxFeatures;
    }

    /**
     * Set maxFeatures to maxFeatures.
     *
     * @param maxFeatures The maxFeatures to set.
     */
    public void setMaxFeatures(int maxFeatures) {
        this.maxFeatures = maxFeatures;
    }

    /**
     * Access verbose property.
     *
     * @return Returns the verbose.
     */
    public boolean isVerbose() {
        return verbose;
    }

    /**
     * Set verbose to verbose.
     *
     * @param verbose The verbose to set.
     */
    public void setVerbose(boolean verbose) {
        verboseChecked = true;
        this.verbose = verbose;
    }

    /**
             * Access verboseChecked property.
             *
             * @return Returns the verboseChecked.
             */
    public boolean isVerboseChecked() {
        return verboseChecked;
    }

    /**
     * Set verboseChecked to verboseChecked.
     *
     * @param verboseChecked The verboseChecked to set.
     */
    public void setVerboseChecked(boolean verboseChecked) {
        this.verboseChecked = verboseChecked;
    }

    /**
             * Access verboseChecked property.
             *
             * @return Returns the verboseChecked.
             */
    public boolean isVerboseExceptionsChecked() {
        return verboseExceptionsChecked;
    }

    /**
     * Set verboseChecked to verboseChecked.
     *
     * @param verboseChecked The verboseChecked to set.
     */
    public void setVerboseExceptionsChecked(boolean verboseExceptionsChecked) {
        this.verboseExceptionsChecked = verboseExceptionsChecked;
    }

    /**
     * Access verboseExceptions property.
     *
     * @return Returns the verboseExceptions.
     */
    public boolean isVerboseExceptions() {
        return verboseExceptions;
    }

    /**
     * Set verboseExceptions to verboseExceptions.
     *
     * @param verboseExceptions The verboseExceptions to set.
     */
    public void setVerboseExceptions(boolean verboseExceptions) {
        verboseExceptionsChecked = true;
        this.verboseExceptions = verboseExceptions;
    }

    /**
     * Access numDecimals property.
     *
     * @return Returns the numDecimals.
     */
    public int getNumDecimals() {
        return numDecimals;
    }

    /**
     * Set numDecimals to numDecimals.
     *
     * @param numDecimals The numDecimals to set.
     */
    public void setNumDecimals(int numDecimals) {
        this.numDecimals = numDecimals;
    }

    /**
     * Access charset property.
     *
     * @return Returns the charset.
     */
    public String getCharset() {
        return charset;
    }

    /**
     * Set charset to charset.
     *
     * @param charset The charset to set.
     */
    public void setCharset(String charset) {
        this.charset = charset;
    }

    /**
     * Access baseURL property.
     *
     * @return Returns the baseURL.
     */
    public String getProxyBaseUrl() {
        return "".equals(proxyBaseUrl) ? null : proxyBaseUrl;
    }

    /**
     * Set baseURL to baseURL.
     *
     * @param baseURL The baseURL to set.
     */
    public void setProxyBaseUrl(String baseURL) {
        this.proxyBaseUrl = baseURL;
    }

    /**
     * Access schemaBaseURL property.
     *
     * @return Returns the schemaBaseURL.
     */
    public String getSchemaBaseURL() {
        return schemaBaseURL;
    }

    /**
     * Set schemaBaseURL to schemaBaseURL.
     *
     * @param schemaBaseURL The schemaBaseURL to set.
     */
    public void setSchemaBaseURL(String schemaBaseURL) {
        this.schemaBaseURL = schemaBaseURL;
    }

    /**
     * Access loggingLevel property.
     *
     * @return Returns the loggingLevel.
     */
    public String getLog4jConfigFile() {
        return log4jConfigFile;
    }

    /**
     * Set loggingLevel to loggingLevel.
     *
     * @param loggingLevel The loggingLevel to set.
     */
    public void setLog4jConfigFile(String s) {
        this.log4jConfigFile = s;
    }

    /**
     * Access address property.
     *
     * @return Returns the address.
     */
    public String getAddress() {
        return address;
    }

    /**
     * Set address to address.
     *
     * @param address The address to set.
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * Access addressCity property.
     *
     * @return Returns the addressCity.
     */
    public String getAddressCity() {
        return addressCity;
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -