FileDocCategorySizeDatePackage
Cluster.javaAPI DocGlassfish v2 API22747Tue Jan 23 15:45:34 GMT 2007com.sun.enterprise.config.serverbeans

Cluster

public class Cluster extends com.sun.enterprise.config.ConfigBean implements Serializable
This generated bean class Cluster matches the DTD element cluster

Fields Summary
static Vector
comparators
private static final org.netbeans.modules.schema2beans.Version
runtimeVersion
public static final String
SERVER_REF
public static final String
RESOURCE_REF
public static final String
APPLICATION_REF
public static final String
SYSTEM_PROPERTY
public static final String
ELEMENT_PROPERTY
Constructors Summary
public Cluster()


	  
		this(Common.USE_DEFAULT_VALUES);
	
public Cluster(int options)

		super(comparators, runtimeVersion);
		// Properties (see root bean comments for the bean graph)
		initPropertyTables(5);
		this.createProperty("server-ref", SERVER_REF, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			ServerRef.class);
		this.createAttribute(SERVER_REF, "ref", "Ref", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createAttribute(SERVER_REF, "disable-timeout-in-minutes", "DisableTimeoutInMinutes", 
						AttrProp.CDATA,
						null, "30");
		this.createAttribute(SERVER_REF, "lb-enabled", "LbEnabled", 
						AttrProp.CDATA,
						null, "false");
		this.createAttribute(SERVER_REF, "enabled", "Enabled", 
						AttrProp.CDATA,
						null, "true");
		this.createProperty("resource-ref", RESOURCE_REF, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			ResourceRef.class);
		this.createAttribute(RESOURCE_REF, "enabled", "Enabled", 
						AttrProp.CDATA,
						null, "true");
		this.createAttribute(RESOURCE_REF, "ref", "Ref", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createProperty("application-ref", APPLICATION_REF, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			ApplicationRef.class);
		this.createAttribute(APPLICATION_REF, "enabled", "Enabled", 
						AttrProp.CDATA,
						null, "true");
		this.createAttribute(APPLICATION_REF, "virtual-servers", "VirtualServers", 
						AttrProp.CDATA | AttrProp.IMPLIED,
						null, null);
		this.createAttribute(APPLICATION_REF, "lb-enabled", "LbEnabled", 
						AttrProp.CDATA,
						null, "false");
		this.createAttribute(APPLICATION_REF, "disable-timeout-in-minutes", "DisableTimeoutInMinutes", 
						AttrProp.CDATA,
						null, "30");
		this.createAttribute(APPLICATION_REF, "ref", "Ref", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createProperty("system-property", SYSTEM_PROPERTY, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			SystemProperty.class);
		this.createAttribute(SYSTEM_PROPERTY, "name", "Name", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createAttribute(SYSTEM_PROPERTY, "value", "Value", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createProperty("property", ELEMENT_PROPERTY, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			ElementProperty.class);
		this.createAttribute(ELEMENT_PROPERTY, "name", "Name", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createAttribute(ELEMENT_PROPERTY, "value", "Value", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.initialize(options);
	
Methods Summary
public intaddApplicationRef(ApplicationRef value)

		return addApplicationRef(value, true);
	
public intaddApplicationRef(ApplicationRef value, boolean overwrite)

		ApplicationRef old = getApplicationRefByRef(value.getRef());
		if(old != null) {
			throw new ConfigException(StringManager.getManager(Cluster.class).getString("cannotAddDuplicate",  "ApplicationRef"));
		}
		return this.addValue(APPLICATION_REF, value, overwrite);
	
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public intaddElementProperty(ElementProperty value)

		return addElementProperty(value, true);
	
public intaddElementProperty(ElementProperty value, boolean overwrite)

		ElementProperty old = getElementPropertyByName(value.getName());
		if(old != null) {
			throw new ConfigException(StringManager.getManager(Cluster.class).getString("cannotAddDuplicate",  "ElementProperty"));
		}
		return this.addValue(ELEMENT_PROPERTY, value, overwrite);
	
public intaddResourceRef(ResourceRef value)

		return addResourceRef(value, true);
	
public intaddResourceRef(ResourceRef value, boolean overwrite)

		ResourceRef old = getResourceRefByRef(value.getRef());
		if(old != null) {
			throw new ConfigException(StringManager.getManager(Cluster.class).getString("cannotAddDuplicate",  "ResourceRef"));
		}
		return this.addValue(RESOURCE_REF, value, overwrite);
	
public intaddServerRef(ServerRef value)

		return addServerRef(value, true);
	
public intaddServerRef(ServerRef value, boolean overwrite)

		ServerRef old = getServerRefByRef(value.getRef());
		if(old != null) {
			throw new ConfigException(StringManager.getManager(Cluster.class).getString("cannotAddDuplicate",  "ServerRef"));
		}
		return this.addValue(SERVER_REF, value, overwrite);
	
public intaddSystemProperty(SystemProperty value)

		return addSystemProperty(value, true);
	
public intaddSystemProperty(SystemProperty value, boolean overwrite)

		SystemProperty old = getSystemPropertyByName(value.getName());
		if(old != null) {
			throw new ConfigException(StringManager.getManager(Cluster.class).getString("cannotAddDuplicate",  "SystemProperty"));
		}
		return this.addValue(SYSTEM_PROPERTY, value, overwrite);
	
public voiddump(java.lang.StringBuffer str, java.lang.String indent)

		String s;
		Object o;
		org.netbeans.modules.schema2beans.BaseBean n;
		str.append(indent);
		str.append("ServerRef["+this.sizeServerRef()+"]");	// NOI18N
		for(int i=0; i<this.sizeServerRef(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getServerRef(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(SERVER_REF, i, str, indent);
		}

		str.append(indent);
		str.append("ResourceRef["+this.sizeResourceRef()+"]");	// NOI18N
		for(int i=0; i<this.sizeResourceRef(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getResourceRef(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(RESOURCE_REF, i, str, indent);
		}

		str.append(indent);
		str.append("ApplicationRef["+this.sizeApplicationRef()+"]");	// NOI18N
		for(int i=0; i<this.sizeApplicationRef(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getApplicationRef(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(APPLICATION_REF, i, str, indent);
		}

		str.append(indent);
		str.append("SystemProperty["+this.sizeSystemProperty()+"]");	// NOI18N
		for(int i=0; i<this.sizeSystemProperty(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getSystemProperty(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(SYSTEM_PROPERTY, i, str, indent);
		}

		str.append(indent);
		str.append("ElementProperty["+this.sizeElementProperty()+"]");	// NOI18N
		for(int i=0; i<this.sizeElementProperty(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getElementProperty(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(ELEMENT_PROPERTY, i, str, indent);
		}

	
public java.lang.StringdumpBeanNode()

		StringBuffer str = new StringBuffer();
		str.append("Cluster\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public ApplicationRefgetApplicationRef(int index)

		return (ApplicationRef)this.getValue(APPLICATION_REF, index);
	
public ApplicationRef[]getApplicationRef()

		return (ApplicationRef[])this.getValues(APPLICATION_REF);
	
public ApplicationRefgetApplicationRefByRef(java.lang.String id)

	 if (null != id) { id = id.trim(); }
	ApplicationRef[] o = getApplicationRef();
	 if (o == null) return null;

	 for (int i=0; i < o.length; i++) {
	     if(o[i].getAttributeValue(Common.convertName(ServerTags.REF)).equals(id)) {
	         return o[i];
	     }
	 }

		return null;
		
	
public java.lang.StringgetConfigRef()
Getter for ConfigRef of the Element cluster

return
the ConfigRef of the Element cluster

		return getAttributeValue(ServerTags.CONFIG_REF);
	
public static java.lang.StringgetDefaultAttributeValue(java.lang.String attr)

		if(attr == null) return null;
		attr = attr.trim();
		if(attr.equals(ServerTags.HEARTBEAT_ENABLED)) return "true".trim();
	return null;
	
public static java.lang.StringgetDefaultHeartbeatEnabled()
Get the default value of HeartbeatEnabled from dtd

		return "true".trim();
	
public ElementPropertygetElementProperty(int index)

		return (ElementProperty)this.getValue(ELEMENT_PROPERTY, index);
	
public ElementProperty[]getElementProperty()

		return (ElementProperty[])this.getValues(ELEMENT_PROPERTY);
	
public ElementPropertygetElementPropertyByName(java.lang.String id)

	 if (null != id) { id = id.trim(); }
	ElementProperty[] o = getElementProperty();
	 if (o == null) return null;

	 for (int i=0; i < o.length; i++) {
	     if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) {
	         return o[i];
	     }
	 }

		return null;
		
	
public java.lang.StringgetHeartbeatAddress()
Getter for HeartbeatAddress of the Element cluster

return
the HeartbeatAddress of the Element cluster

			return getAttributeValue(ServerTags.HEARTBEAT_ADDRESS);
	
public java.lang.StringgetHeartbeatPort()
Getter for HeartbeatPort of the Element cluster

return
the HeartbeatPort of the Element cluster

			return getAttributeValue(ServerTags.HEARTBEAT_PORT);
	
public java.lang.StringgetName()
Getter for Name of the Element cluster

return
the Name of the Element cluster

		return getAttributeValue(ServerTags.NAME);
	
protected java.lang.StringgetRelativeXPath()
get the xpath representation for this element returns something like abc[@name='value'] or abc depending on the type of the bean

	    String ret = null;
	    ret = "cluster" + (canHaveSiblings() ? "[@name='" + getAttributeValue("name") +"']" : "") ;
	    return (null != ret ? ret.trim() : null);
	
public ResourceRefgetResourceRef(int index)

		return (ResourceRef)this.getValue(RESOURCE_REF, index);
	
public ResourceRef[]getResourceRef()

		return (ResourceRef[])this.getValues(RESOURCE_REF);
	
public ResourceRefgetResourceRefByRef(java.lang.String id)

	 if (null != id) { id = id.trim(); }
	ResourceRef[] o = getResourceRef();
	 if (o == null) return null;

	 for (int i=0; i < o.length; i++) {
	     if(o[i].getAttributeValue(Common.convertName(ServerTags.REF)).equals(id)) {
	         return o[i];
	     }
	 }

		return null;
		
	
public ServerRefgetServerRef(int index)

		return (ServerRef)this.getValue(SERVER_REF, index);
	
public ServerRef[]getServerRef()

		return (ServerRef[])this.getValues(SERVER_REF);
	
public ServerRefgetServerRefByRef(java.lang.String id)

	 if (null != id) { id = id.trim(); }
	ServerRef[] o = getServerRef();
	 if (o == null) return null;

	 for (int i=0; i < o.length; i++) {
	     if(o[i].getAttributeValue(Common.convertName(ServerTags.REF)).equals(id)) {
	         return o[i];
	     }
	 }

		return null;
		
	
public SystemPropertygetSystemProperty(int index)

		return (SystemProperty)this.getValue(SYSTEM_PROPERTY, index);
	
public SystemProperty[]getSystemProperty()

		return (SystemProperty[])this.getValues(SYSTEM_PROPERTY);
	
public SystemPropertygetSystemPropertyByName(java.lang.String id)

	 if (null != id) { id = id.trim(); }
	SystemProperty[] o = getSystemProperty();
	 if (o == null) return null;

	 for (int i=0; i < o.length; i++) {
	     if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) {
	         return o[i];
	     }
	 }

		return null;
		
	
voidinitialize(int options)


	
public booleanisHeartbeatEnabled()
Getter for HeartbeatEnabled of the Element cluster

return
the HeartbeatEnabled of the Element cluster

		return toBoolean(getAttributeValue(ServerTags.HEARTBEAT_ENABLED));
	
public ApplicationRefnewApplicationRef()
Create a new bean using it's default constructor. This does not add it to any bean graph.

		return new ApplicationRef();
	
public ElementPropertynewElementProperty()
Create a new bean using it's default constructor. This does not add it to any bean graph.

		return new ElementProperty();
	
public ResourceRefnewResourceRef()
Create a new bean using it's default constructor. This does not add it to any bean graph.

		return new ResourceRef();
	
public ServerRefnewServerRef()
Create a new bean using it's default constructor. This does not add it to any bean graph.

		return new ServerRef();
	
public SystemPropertynewSystemProperty()
Create a new bean using it's default constructor. This does not add it to any bean graph.

		return new SystemProperty();
	
public intremoveApplicationRef(ApplicationRef value)

		return this.removeValue(APPLICATION_REF, value);
	
public intremoveApplicationRef(ApplicationRef value, boolean overwrite)

		return this.removeValue(APPLICATION_REF, value, overwrite);
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public intremoveElementProperty(ElementProperty value)

		return this.removeValue(ELEMENT_PROPERTY, value);
	
public intremoveElementProperty(ElementProperty value, boolean overwrite)

		return this.removeValue(ELEMENT_PROPERTY, value, overwrite);
	
public intremoveResourceRef(ResourceRef value)

		return this.removeValue(RESOURCE_REF, value);
	
public intremoveResourceRef(ResourceRef value, boolean overwrite)

		return this.removeValue(RESOURCE_REF, value, overwrite);
	
public intremoveServerRef(ServerRef value)

		return this.removeValue(SERVER_REF, value);
	
public intremoveServerRef(ServerRef value, boolean overwrite)

		return this.removeValue(SERVER_REF, value, overwrite);
	
public intremoveSystemProperty(SystemProperty value)

		return this.removeValue(SYSTEM_PROPERTY, value);
	
public intremoveSystemProperty(SystemProperty value, boolean overwrite)

		return this.removeValue(SYSTEM_PROPERTY, value, overwrite);
	
public voidsetApplicationRef(ApplicationRef[] value)

		this.setValue(APPLICATION_REF, value);
	
public voidsetConfigRef(java.lang.String v, boolean overwrite)
Modify the ConfigRef of the Element cluster

param
v the new value
throws
StaleWriteConfigException if overwrite is false and file changed on disk

		setAttributeValue(ServerTags.CONFIG_REF, v, overwrite);
	
public voidsetConfigRef(java.lang.String v)
Modify the ConfigRef of the Element cluster

param
v the new value

		setAttributeValue(ServerTags.CONFIG_REF, v);
	
public voidsetElementProperty(ElementProperty[] value)

		this.setValue(ELEMENT_PROPERTY, value);
	
public voidsetHeartbeatAddress(java.lang.String v, boolean overwrite)
Modify the HeartbeatAddress of the Element cluster

param
v the new value
throws
StaleWriteConfigException if overwrite is false and file changed on disk

		setAttributeValue(ServerTags.HEARTBEAT_ADDRESS, v, overwrite);
	
public voidsetHeartbeatAddress(java.lang.String v)
Modify the HeartbeatAddress of the Element cluster

param
v the new value

		setAttributeValue(ServerTags.HEARTBEAT_ADDRESS, v);
	
public voidsetHeartbeatEnabled(boolean v, boolean overwrite)
Modify the HeartbeatEnabled of the Element cluster

param
v the new value
throws
StaleWriteConfigException if overwrite is false and file changed on disk

		setAttributeValue(ServerTags.HEARTBEAT_ENABLED, ""+(v==true), overwrite);
	
public voidsetHeartbeatEnabled(boolean v)
Modify the HeartbeatEnabled of the Element cluster

param
v the new value

		setAttributeValue(ServerTags.HEARTBEAT_ENABLED, ""+(v==true));
	
public voidsetHeartbeatPort(java.lang.String v, boolean overwrite)
Modify the HeartbeatPort of the Element cluster

param
v the new value
throws
StaleWriteConfigException if overwrite is false and file changed on disk

		setAttributeValue(ServerTags.HEARTBEAT_PORT, v, overwrite);
	
public voidsetHeartbeatPort(java.lang.String v)
Modify the HeartbeatPort of the Element cluster

param
v the new value

		setAttributeValue(ServerTags.HEARTBEAT_PORT, v);
	
public voidsetName(java.lang.String v, boolean overwrite)
Modify the Name of the Element cluster

param
v the new value
throws
StaleWriteConfigException if overwrite is false and file changed on disk

		setAttributeValue(ServerTags.NAME, v, overwrite);
	
public voidsetName(java.lang.String v)
Modify the Name of the Element cluster

param
v the new value

		setAttributeValue(ServerTags.NAME, v);
	
public voidsetResourceRef(ResourceRef[] value)

		this.setValue(RESOURCE_REF, value);
	
public voidsetServerRef(ServerRef[] value)

		this.setValue(SERVER_REF, value);
	
public voidsetSystemProperty(SystemProperty[] value)

		this.setValue(SYSTEM_PROPERTY, value);
	
public intsizeApplicationRef()

		return this.size(APPLICATION_REF);
	
public intsizeElementProperty()

		return this.size(ELEMENT_PROPERTY);
	
public intsizeResourceRef()

		return this.size(RESOURCE_REF);
	
public intsizeServerRef()

		return this.size(SERVER_REF);
	
public intsizeSystemProperty()

		return this.size(SYSTEM_PROPERTY);
	
public voidvalidate()