FileDocCategorySizeDatePackage
Server.javaAPI DocGlassfish v2 API18734Fri May 26 10:47:10 BST 2006com.sun.enterprise.config.serverbeans

Server

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

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


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

		super(comparators, runtimeVersion);
		// Properties (see root bean comments for the bean graph)
		initPropertyTables(4);
		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("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("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(Server.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(Server.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(Server.class).getString("cannotAddDuplicate",  "ResourceRef"));
		}
		return this.addValue(RESOURCE_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(Server.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("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("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("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("Server\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 server

return
the ConfigRef of the Element server

			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.LB_WEIGHT)) return "100".trim();
	return null;
	
public static java.lang.StringgetDefaultLbWeight()
Get the default value of LbWeight from dtd

		return "100".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.StringgetLbWeight()
Getter for LbWeight of the Element server

return
the LbWeight of the Element server

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

return
the Name of the Element server

		return getAttributeValue(ServerTags.NAME);
	
public java.lang.StringgetNodeAgentRef()
Getter for NodeAgentRef of the Element server

return
the NodeAgentRef of the Element server

			return getAttributeValue(ServerTags.NODE_AGENT_REF);
	
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 = "server" + (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 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 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 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 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 server

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 server

param
v the new value

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

		this.setValue(ELEMENT_PROPERTY, value);
	
public voidsetLbWeight(java.lang.String v, boolean overwrite)
Modify the LbWeight of the Element server

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

		setAttributeValue(ServerTags.LB_WEIGHT, v, overwrite);
	
public voidsetLbWeight(java.lang.String v)
Modify the LbWeight of the Element server

param
v the new value

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

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 server

param
v the new value

		setAttributeValue(ServerTags.NAME, v);
	
public voidsetNodeAgentRef(java.lang.String v, boolean overwrite)
Modify the NodeAgentRef of the Element server

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

		setAttributeValue(ServerTags.NODE_AGENT_REF, v, overwrite);
	
public voidsetNodeAgentRef(java.lang.String v)
Modify the NodeAgentRef of the Element server

param
v the new value

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

		this.setValue(RESOURCE_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 intsizeSystemProperty()

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