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

VirtualServer

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

Fields Summary
static Vector
comparators
private static final org.netbeans.modules.schema2beans.Version
runtimeVersion
public static final String
HTTP_ACCESS_LOG
public static final String
ELEMENT_PROPERTY
Constructors Summary
public VirtualServer()


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

		super(comparators, runtimeVersion);
		// Properties (see root bean comments for the bean graph)
		initPropertyTables(2);
		this.createProperty("http-access-log", HTTP_ACCESS_LOG, 
			Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 
			HttpAccessLog.class);
		this.createAttribute(HTTP_ACCESS_LOG, "log-directory", "LogDirectory", 
						AttrProp.CDATA,
						null, "${com.sun.aas.instanceRoot}/logs/access");
		this.createAttribute(HTTP_ACCESS_LOG, "iponly", "Iponly", 
						AttrProp.CDATA,
						null, "true");
		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 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(VirtualServer.class).getString("cannotAddDuplicate",  "ElementProperty"));
		}
		return this.addValue(ELEMENT_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("HttpAccessLog");	// NOI18N
		n = (org.netbeans.modules.schema2beans.BaseBean) this.getHttpAccessLog();
		if (n != null)
			n.dump(str, indent + "\t");	// NOI18N
		else
			str.append(indent+"\tnull");	// NOI18N
		this.dumpAttributes(HTTP_ACCESS_LOG, 0, 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("VirtualServer\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public static java.lang.StringgetDefaultAttributeValue(java.lang.String attr)

		if(attr == null) return null;
		attr = attr.trim();
		if(attr.equals(ServerTags.STATE)) return "on".trim();
		if(attr.equals(ServerTags.LOG_FILE)) return "${com.sun.aas.instanceRoot}/logs/server.log".trim();
	return null;
	
public static java.lang.StringgetDefaultLogFile()
Get the default value of LogFile from dtd

		return "${com.sun.aas.instanceRoot}/logs/server.log".trim();
	
public static java.lang.StringgetDefaultState()
Get the default value of State from dtd

		return "on".trim();
	
public java.lang.StringgetDefaultWebModule()
Getter for DefaultWebModule of the Element virtual-server

return
the DefaultWebModule of the Element virtual-server

			return getAttributeValue(ServerTags.DEFAULT_WEB_MODULE);
	
public java.lang.StringgetDocroot()
Getter for Docroot of the Element virtual-server

return
the Docroot of the Element virtual-server

			return getAttributeValue(ServerTags.DOCROOT);
	
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.StringgetHosts()
Getter for Hosts of the Element virtual-server

return
the Hosts of the Element virtual-server

		return getAttributeValue(ServerTags.HOSTS);
	
public HttpAccessLoggetHttpAccessLog()

		return (HttpAccessLog)this.getValue(HTTP_ACCESS_LOG);
	
public java.lang.StringgetHttpListeners()
Getter for HttpListeners of the Element virtual-server

return
the HttpListeners of the Element virtual-server

			return getAttributeValue(ServerTags.HTTP_LISTENERS);
	
public java.lang.StringgetId()
Getter for Id of the Element virtual-server

return
the Id of the Element virtual-server

		return getAttributeValue(ServerTags.ID);
	
public java.lang.StringgetLogFile()
Getter for LogFile of the Element virtual-server

return
the LogFile of the Element virtual-server

		return getAttributeValue(ServerTags.LOG_FILE);
	
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 = "virtual-server" + (canHaveSiblings() ? "[@id='" + getAttributeValue("id") +"']" : "") ;
	    return (null != ret ? ret.trim() : null);
	
public java.lang.StringgetState()
Getter for State of the Element virtual-server

return
the State of the Element virtual-server

		return getAttributeValue(ServerTags.STATE);
	
voidinitialize(int options)


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

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

		return new HttpAccessLog();
	
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 voidsetDefaultWebModule(java.lang.String v, boolean overwrite)
Modify the DefaultWebModule of the Element virtual-server

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

		setAttributeValue(ServerTags.DEFAULT_WEB_MODULE, v, overwrite);
	
public voidsetDefaultWebModule(java.lang.String v)
Modify the DefaultWebModule of the Element virtual-server

param
v the new value

		setAttributeValue(ServerTags.DEFAULT_WEB_MODULE, v);
	
public voidsetDocroot(java.lang.String v, boolean overwrite)
Modify the Docroot of the Element virtual-server

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

		setAttributeValue(ServerTags.DOCROOT, v, overwrite);
	
public voidsetDocroot(java.lang.String v)
Modify the Docroot of the Element virtual-server

param
v the new value

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

		this.setValue(ELEMENT_PROPERTY, value);
	
public voidsetHosts(java.lang.String v, boolean overwrite)
Modify the Hosts of the Element virtual-server

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

		setAttributeValue(ServerTags.HOSTS, v, overwrite);
	
public voidsetHosts(java.lang.String v)
Modify the Hosts of the Element virtual-server

param
v the new value

		setAttributeValue(ServerTags.HOSTS, v);
	
public voidsetHttpAccessLog(HttpAccessLog value)

		this.setValue(HTTP_ACCESS_LOG, value);
	
public voidsetHttpListeners(java.lang.String v, boolean overwrite)
Modify the HttpListeners of the Element virtual-server

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

		setAttributeValue(ServerTags.HTTP_LISTENERS, v, overwrite);
	
public voidsetHttpListeners(java.lang.String v)
Modify the HttpListeners of the Element virtual-server

param
v the new value

		setAttributeValue(ServerTags.HTTP_LISTENERS, v);
	
public voidsetId(java.lang.String v, boolean overwrite)
Modify the Id of the Element virtual-server

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

		setAttributeValue(ServerTags.ID, v, overwrite);
	
public voidsetId(java.lang.String v)
Modify the Id of the Element virtual-server

param
v the new value

		setAttributeValue(ServerTags.ID, v);
	
public voidsetLogFile(java.lang.String v, boolean overwrite)
Modify the LogFile of the Element virtual-server

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

		setAttributeValue(ServerTags.LOG_FILE, v, overwrite);
	
public voidsetLogFile(java.lang.String v)
Modify the LogFile of the Element virtual-server

param
v the new value

		setAttributeValue(ServerTags.LOG_FILE, v);
	
public voidsetState(java.lang.String v, boolean overwrite)
Modify the State of the Element virtual-server

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

		setAttributeValue(ServerTags.STATE, v, overwrite);
	
public voidsetState(java.lang.String v)
Modify the State of the Element virtual-server

param
v the new value

		setAttributeValue(ServerTags.STATE, v);
	
public intsizeElementProperty()

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