/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999-2004 Bull S.A.
 * Contact: jonas-team@objectweb.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.webapp.jonasadmin.domain;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form used for EditDomainAction
 * It is used for domain or cluster display
 * @author danesa
 */
public class DomainForm extends ActionForm {
    
    /**
     * domain name or cluster name (if this is a cluster)
     */
    private String name = null;
    
    /**
     *
     */
    private String type = null;
    
    /**
     * if cluster, gives cluster type (LogicalCluster, CmiCluster etc.)
     */
    private String clusterType = null;
    
    /**
     *  domain name (used if this is a cluster)
     */
    private String domainName = null;
    
    /**
     *  parent cluster (or domain) name
     */
    private String parentName = null;
    
    /**
     * parent cluster (or domain) ON
     */
    private String parentON = null;
    
    /**
     * master server name (the local server name)
     */
    private String masterName = null;
    
    /**
     * domain or cluster description
     */
    private String description = null;
    
    /**
     * master server's MBean OBJECT_NAME
     */
    private String masterON = null;
    
    /**
     * true if the local server is master
     */
    private boolean isMaster = false;
    
    /**
     * True if this is a cluster, false if this is domain (root cluster)
     */
    private boolean isCluster = false;

    /**
     * Reset all properties to their default values.
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    }

    /**
     * Validate the properties that have been set from this HTTP request,
     * and return an <code>ActionErrors</code> object that encapsulates any
     * validation errors that have been found.  If no errors are found, return
     * <code>null</code> or an <code>ActionErrors</code> object with no
     * recorded error messages.
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        return new ActionErrors();
    }

    /**
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }

    /**
     * @param name The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return Returns the domainName.
     */
    public String getDomainName() {
        return domainName;
    }

    /**
     * @param domainName The domainName to set.
     */
    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }

    /**
     * @return Returns the isCluster.
     */
    public boolean isCluster() {
        return isCluster;
    }

    /**
     * @param isCluster The isCluster to set.
     */
    public void setCluster(boolean isCluster) {
        this.isCluster = isCluster;
    }

    /**
     * @return Returns the masterName.
     */
    public String getMasterName() {
        return masterName;
    }

    /**
     * @param masterName The masterName to set.
     */
    public void setMasterName(String masterName) {
        this.masterName = masterName;
    }

    /**
     * @return Returns the parentName.
     */
    public String getParentName() {
        return parentName;
    }

    /**
     * @param parentName The parentName to set.
     */
    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    /**
     * @return Returns the masterON.
     */
    public String getMasterON() {
        return masterON;
    }

    /**
     * @param masterON The masterON to set.
     */
    public void setMasterON(String masterON) {
        this.masterON = masterON;
    }

    /**
     * @return Returns the type.
     */
    public String getType() {
        return type;
    }

    /**
     * @param type The type to set.
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * @return Returns the description.
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description The description to set.
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return Returns the isMaster.
     */
    public boolean isMaster() {
        return isMaster;
    }

    /**
     * @param isMaster The isMaster to set.
     */
    public void setMaster(boolean isMaster) {
        this.isMaster = isMaster;
    }

    /**
     * @return Returns the parentON.
     */
    public String getParentON() {
        return parentON;
    }

    /**
     * @param parentON The parentON to set.
     */
    public void setParentON(String parentON) {
        this.parentON = parentON;
    }

	public String getClusterType() {
		return clusterType;
	}

	public void setClusterType(String clusterType) {
		this.clusterType = clusterType;
	}

}