/* Generated by Together */

package cobalt.deployment.descriptor.dist;

import java.util.Vector;
import java.util.Set;
import java.util.HashSet;

import cobalt.deployment.descriptor.MethodDescriptor;
import cobalt.deployment.util.CommonUtil;
import cobalt.deployment.common.DataContainer;
import cobalt.deployment.common.MustNotNullException;

public class Jeus30EjbCluster extends DataContainer {
    public Jeus30EjbCluster() {
        super();
	    ejbHomeIdempotentMtds = new HashSet();
	    ejbRemoteIdempotentMtds = new HashSet();
		clusterExportNameList = new Vector();

        setHomeClustered(false);
        setEjbHomeFailover(false);
        setEjbRemoteFailover(false);
    }

    public boolean isClustering(){
        return clustering;
    }

    public void setClustering(boolean clustering){
        this.clustering = clustering;
    }

    public String getClusterName(){
        return getString("cluster-name");
    }

    public void setClusterName(String clusterName)
        throws MustNotNullException
    {
        setString("cluster-name", clusterName);
    }

	public boolean containsClusterExportName(String clusterExportName)
	{
		return clusterExportNameList.contains(clusterExportName);
	}
	public void addClusterExportName(String clusterExportName)
	{
		if ( !containsClusterExportName(clusterExportName) )
	  clusterExportNameList.add(clusterExportName);
	}

	public void removeClusterExportName(int index)
	{
		clusterExportNameList.remove(index);
	}

    public Vector getClusterExportNameList(){
        return clusterExportNameList;
    }

    public void setClusterExportNameList(Vector clusterExportNameList){
		this.clusterExportNameList = clusterExportNameList;
    }

    public boolean isHomeClustered(){
        return getBoolean("home-clustered", false);
    }

    public String isHomeClusteredValue(){
        return getString("home-clustered");
    }

    public void setHomeClustered(boolean homeClustered){
        setBoolean("home-clustered", homeClustered);
    }

    public boolean isEjbHomeFailover(){
        return getBoolean("ejb-home-component-failover", false);
    }

    public String isEjbHomeFailoverValue(){
        return getString("ejb-home-component-failover");
    }

    public void setEjbHomeFailover(boolean ejbHomeFailover){
        setBoolean("ejb-home-component-failover", ejbHomeFailover);
    }

    public Set getEjbHomeIdempotentMtds(){
        return ejbHomeIdempotentMtds;
    }

    public void setEjbHomeIdempotentMtds(Set ejbHomeIdempotentMtds){
        this.ejbHomeIdempotentMtds = ejbHomeIdempotentMtds;
    }

    public void addEjbHomeIdempotentMtd(MethodDescriptor mtd) {
        ejbHomeIdempotentMtds.add(mtd);
    }

	public void removeEjbHomeIdempotentMtd(MethodDescriptor method) {
		ejbHomeIdempotentMtds.remove(method);
    }

    public boolean isEjbRemoteFailover(){
        return getBoolean("ejb-remote-component-failover", false);
    }

    public String isEjbRemoteFailoverValue(){
        return getString("ejb-remote-component-failover");
    }

    public void setEjbRemoteFailover(boolean ejbRemoteFailover){
        setBoolean("ejb-remote-component-failover", ejbRemoteFailover);
    }

    public Set getEjbRemoteIdempotentMtds(){
        return ejbRemoteIdempotentMtds;
    }

    public void setEjbRemoteIdempotentMtds(Set ejbRemoteIdempotentMtds){
        this.ejbRemoteIdempotentMtds = ejbRemoteIdempotentMtds;
    }

    public void addEjbRemoteIdempotentMtd(MethodDescriptor mtd) {
        ejbRemoteIdempotentMtds.add(mtd);
    }

	public void removeEjbRemoteIdempotentMtd(MethodDescriptor method) {
		ejbRemoteIdempotentMtds.remove(method);
    }

    private boolean clustering = false;
    private Set ejbHomeIdempotentMtds;
    private Set ejbRemoteIdempotentMtds;
    private Vector clusterExportNameList;
}
