Methods Summary |
---|
public java.lang.String | _getSchemaLocation()
if (beanProp().getAttrProp("xsi:schemaLocation", true) == null) {
createAttribute("xmlns:xsi", "xmlns:xsi", AttrProp.CDATA | AttrProp.IMPLIED, null, "http://www.w3.org/2001/XMLSchema-instance");
setAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
createAttribute("xsi:schemaLocation", "xsi:schemaLocation", AttrProp.CDATA | AttrProp.IMPLIED, null, null);
}
return getAttributeValue("xsi:schemaLocation");
|
public void | _setSchemaLocation(java.lang.String location)
if (beanProp().getAttrProp("xsi:schemaLocation", true) == null) {
createAttribute("xmlns:xsi", "xmlns:xsi", AttrProp.CDATA | AttrProp.IMPLIED, null, "http://www.w3.org/2001/XMLSchema-instance");
setAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
createAttribute("xsi:schemaLocation", "xsi:schemaLocation", AttrProp.CDATA | AttrProp.IMPLIED, null, location);
}
setAttributeValue("xsi:schemaLocation", location);
|
public static void | addComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.add(c);
|
public int | addElementProperty(ElementProperty value)
return addElementProperty(value, true);
|
public int | addElementProperty(ElementProperty value, boolean overwrite)
ElementProperty old = getElementPropertyByName(value.getName());
if(old != null) {
throw new ConfigException(StringManager.getManager(Domain.class).getString("cannotAddDuplicate", "ElementProperty"));
}
return this.addValue(ELEMENT_PROPERTY, value, overwrite);
|
public int | addSystemProperty(SystemProperty value)
return addSystemProperty(value, true);
|
public int | addSystemProperty(SystemProperty value, boolean overwrite)
SystemProperty old = getSystemPropertyByName(value.getName());
if(old != null) {
throw new ConfigException(StringManager.getManager(Domain.class).getString("cannotAddDuplicate", "SystemProperty"));
}
return this.addValue(SYSTEM_PROPERTY, value, overwrite);
|
public static com.sun.enterprise.config.serverbeans.Domain | createGraph(org.w3c.dom.Node doc)
return new Domain(doc, Common.NO_DEFAULT_VALUES);
|
public static com.sun.enterprise.config.serverbeans.Domain | createGraph(java.io.File f)
java.io.InputStream in = new java.io.FileInputStream(f);
try {
return createGraph(in, false);
} finally {
in.close();
}
|
public static com.sun.enterprise.config.serverbeans.Domain | createGraph(java.io.InputStream in)
return createGraph(in, false);
|
public static com.sun.enterprise.config.serverbeans.Domain | createGraph(java.io.InputStream in, boolean validate)
try {
Document doc = GraphManager.createXmlDocument(in, validate);
return createGraph(doc);
}
catch (Exception t) {
throw new RuntimeException(Common.getMessage(
"DOMGraphCreateFailed_msg",
t));
}
|
public static com.sun.enterprise.config.serverbeans.Domain | createGraph()
return new Domain();
|
public void | dump(java.lang.StringBuffer str, java.lang.String indent)
String s;
Object o;
org.netbeans.modules.schema2beans.BaseBean n;
str.append(indent);
str.append("Applications"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getApplications();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(APPLICATIONS, 0, str, indent);
str.append(indent);
str.append("Resources"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getResources();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(RESOURCES, 0, str, indent);
str.append(indent);
str.append("Configs"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getConfigs();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(CONFIGS, 0, str, indent);
str.append(indent);
str.append("Servers"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getServers();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(SERVERS, 0, str, indent);
str.append(indent);
str.append("Clusters"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getClusters();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(CLUSTERS, 0, str, indent);
str.append(indent);
str.append("NodeAgents"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getNodeAgents();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(NODE_AGENTS, 0, str, indent);
str.append(indent);
str.append("LbConfigs"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getLbConfigs();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(LB_CONFIGS, 0, str, indent);
str.append(indent);
str.append("LoadBalancers"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getLoadBalancers();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(LOAD_BALANCERS, 0, 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.String | dumpBeanNode()
StringBuffer str = new StringBuffer();
str.append("Domain\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
|
public java.lang.String | getApplicationRoot()Getter for ApplicationRoot of the Element domain
return getAttributeValue(ServerTags.APPLICATION_ROOT);
|
public Applications | getApplications()
return (Applications)this.getValue(APPLICATIONS);
|
public Clusters | getClusters()
return (Clusters)this.getValue(CLUSTERS);
|
public Configs | getConfigs()
return (Configs)this.getValue(CONFIGS);
|
public static java.lang.String | getDefaultAttributeValue(java.lang.String attr)
if(attr == null) return null;
attr = attr.trim();
return null;
|
public ElementProperty | getElementProperty(int index)
return (ElementProperty)this.getValue(ELEMENT_PROPERTY, index);
|
public ElementProperty[] | getElementProperty()
return (ElementProperty[])this.getValues(ELEMENT_PROPERTY);
|
public ElementProperty | getElementPropertyByName(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 LbConfigs | getLbConfigs()
return (LbConfigs)this.getValue(LB_CONFIGS);
|
public LoadBalancers | getLoadBalancers()
return (LoadBalancers)this.getValue(LOAD_BALANCERS);
|
public java.lang.String | getLocale()Getter for Locale of the Element domain
return getAttributeValue(ServerTags.LOCALE);
|
public java.lang.String | getLogRoot()Getter for LogRoot of the Element domain
return getAttributeValue(ServerTags.LOG_ROOT);
|
public NodeAgents | getNodeAgents()
return (NodeAgents)this.getValue(NODE_AGENTS);
|
protected java.lang.String | getRelativeXPath()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 = "domain";
return (null != ret ? ret.trim() : null);
|
public Resources | getResources()
return (Resources)this.getValue(RESOURCES);
|
public Servers | getServers()
return (Servers)this.getValue(SERVERS);
|
public SystemProperty | getSystemProperty(int index)
return (SystemProperty)this.getValue(SYSTEM_PROPERTY, index);
|
public SystemProperty[] | getSystemProperty()
return (SystemProperty[])this.getValues(SYSTEM_PROPERTY);
|
public SystemProperty | getSystemPropertyByName(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;
|
protected void | initFromNode(org.w3c.dom.Node doc, int options)
if (doc == null)
{
doc = GraphManager.createRootElementNode("domain"); // NOI18N
if (doc == null)
throw new Schema2BeansException(Common.getMessage(
"CantCreateDOMRoot_msg", "domain"));
}
Node n = GraphManager.getElementNode("domain", doc); // NOI18N
if (n == null)
throw new Schema2BeansException(Common.getMessage(
"DocRootNotInDOMGraph_msg", "domain", doc.getFirstChild().getNodeName()));
this.graphManager.setXmlDocument(doc);
// Entry point of the createBeans() recursive calls
this.createBean(n, this.graphManager());
this.initialize(options);
|
protected void | initOptions(int options)
// The graph manager is allocated in the bean root
this.graphManager = new GraphManager(this);
this.createRoot("domain", "Domain", // NOI18N
Common.TYPE_1 | Common.TYPE_BEAN, Domain.class);
// Properties (see root bean comments for the bean graph)
initPropertyTables(10);
this.createProperty("applications", APPLICATIONS,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
Applications.class);
this.createProperty("resources", RESOURCES,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
Resources.class);
this.createProperty("configs", CONFIGS,
Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
Configs.class);
this.createProperty("servers", SERVERS,
Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
Servers.class);
this.createProperty("clusters", CLUSTERS,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
Clusters.class);
this.createProperty("node-agents", NODE_AGENTS,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
NodeAgents.class);
this.createProperty("lb-configs", LB_CONFIGS,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
LbConfigs.class);
this.createProperty("load-balancers", LOAD_BALANCERS,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
LoadBalancers.class);
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.createAttribute("application-root", "ApplicationRoot",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.createAttribute("log-root", "LogRoot",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.createAttribute("locale", "Locale",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.initialize(options);
|
void | initialize(int options)
|
public Applications | newApplications()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new Applications();
|
public Clusters | newClusters()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new Clusters();
|
public Configs | newConfigs()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new Configs();
|
public ElementProperty | newElementProperty()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new ElementProperty();
|
public LbConfigs | newLbConfigs()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new LbConfigs();
|
public LoadBalancers | newLoadBalancers()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new LoadBalancers();
|
public NodeAgents | newNodeAgents()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new NodeAgents();
|
public Resources | newResources()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new Resources();
|
public Servers | newServers()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new Servers();
|
public SystemProperty | newSystemProperty()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new SystemProperty();
|
private synchronized void | readObject(java.io.ObjectInputStream in)
try{
in.defaultReadObject();
init(comparators, runtimeVersion);
//init(comparators, new GenBeans.Version(1, 0, 8));
final int numStrings = in.readInt();
final int max_size = in.readInt();
final StringBuffer sb = new StringBuffer(numStrings * max_size);
for (int i = 0; i < numStrings; i++){
sb.append(in.readUTF());
}
ByteArrayInputStream bais = new ByteArrayInputStream(sb.toString().getBytes());
Document doc = GraphManager.createXmlDocument(bais, false);
initOptions(Common.NO_DEFAULT_VALUES);
initFromNode(doc, Common.NO_DEFAULT_VALUES);
}
catch (Schema2BeansException e) {
throw new RuntimeException(e);
}
|
public static void | removeComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.remove(c);
|
public int | removeElementProperty(ElementProperty value)
return this.removeValue(ELEMENT_PROPERTY, value);
|
public int | removeElementProperty(ElementProperty value, boolean overwrite)
return this.removeValue(ELEMENT_PROPERTY, value, overwrite);
|
public int | removeSystemProperty(SystemProperty value)
return this.removeValue(SYSTEM_PROPERTY, value);
|
public int | removeSystemProperty(SystemProperty value, boolean overwrite)
return this.removeValue(SYSTEM_PROPERTY, value, overwrite);
|
public void | setApplicationRoot(java.lang.String v, boolean overwrite)Modify the ApplicationRoot of the Element domain
setAttributeValue(ServerTags.APPLICATION_ROOT, v, overwrite);
|
public void | setApplicationRoot(java.lang.String v)Modify the ApplicationRoot of the Element domain
setAttributeValue(ServerTags.APPLICATION_ROOT, v);
|
public void | setApplications(Applications value)
this.setValue(APPLICATIONS, value);
|
public void | setClusters(Clusters value)
this.setValue(CLUSTERS, value);
|
public void | setConfigs(Configs value)
this.setValue(CONFIGS, value);
|
public void | setElementProperty(ElementProperty[] value)
this.setValue(ELEMENT_PROPERTY, value);
|
public void | setLbConfigs(LbConfigs value)
this.setValue(LB_CONFIGS, value);
|
public void | setLoadBalancers(LoadBalancers value)
this.setValue(LOAD_BALANCERS, value);
|
public void | setLocale(java.lang.String v, boolean overwrite)Modify the Locale of the Element domain
setAttributeValue(ServerTags.LOCALE, v, overwrite);
|
public void | setLocale(java.lang.String v)Modify the Locale of the Element domain
setAttributeValue(ServerTags.LOCALE, v);
|
public void | setLogRoot(java.lang.String v, boolean overwrite)Modify the LogRoot of the Element domain
setAttributeValue(ServerTags.LOG_ROOT, v, overwrite);
|
public void | setLogRoot(java.lang.String v)Modify the LogRoot of the Element domain
setAttributeValue(ServerTags.LOG_ROOT, v);
|
public void | setNodeAgents(NodeAgents value)
this.setValue(NODE_AGENTS, value);
|
public void | setResources(Resources value)
this.setValue(RESOURCES, value);
|
public void | setServers(Servers value)
this.setValue(SERVERS, value);
|
public void | setSystemProperty(SystemProperty[] value)
this.setValue(SYSTEM_PROPERTY, value);
|
public int | sizeElementProperty()
return this.size(ELEMENT_PROPERTY);
|
public int | sizeSystemProperty()
return this.size(SYSTEM_PROPERTY);
|
public void | validate()
|
private synchronized void | writeObject(java.io.ObjectOutputStream out)
out.defaultWriteObject();
final int MAX_SIZE = 0XFFFF;
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
write(baos);
final byte [] array = baos.toByteArray();
final int numStrings = array.length / MAX_SIZE;
final int leftover = array.length % MAX_SIZE;
out.writeInt(numStrings + (0 == leftover ? 0 : 1));
out.writeInt(MAX_SIZE);
int offset = 0;
for (int i = 0; i < numStrings; i++){
out.writeUTF(new String(array, offset, MAX_SIZE));
offset += MAX_SIZE;
}
if (leftover > 0){
final int count = array.length - offset;
out.writeUTF(new String(array, offset, count));
}
|