Methods Summary |
---|
public int | addClusterStats(com.sun.enterprise.admin.monitor.stats.lb.ClusterStats value)
_ClusterStats.add(value);
return _ClusterStats.size()-1;
|
public void | changePropertyByName(java.lang.String name, java.lang.Object value)
if (name == null) return;
name = name.intern();
if (name == "clusterStats")
addClusterStats((ClusterStats)value);
else if (name == "clusterStats[]")
setClusterStats((ClusterStats[]) value);
else
throw new IllegalArgumentException(name+" is not a valid property name for LoadBalancerStats");
|
public com.sun.enterprise.admin.monitor.stats.lb.CommonBean[] | childBeans(boolean recursive)
java.util.List children = new java.util.LinkedList();
childBeans(recursive, children);
com.sun.enterprise.admin.monitor.stats.lb.CommonBean[] result = new com.sun.enterprise.admin.monitor.stats.lb.CommonBean[children.size()];
return (com.sun.enterprise.admin.monitor.stats.lb.CommonBean[]) children.toArray(result);
|
public void | childBeans(boolean recursive, java.util.List beans)
for (java.util.Iterator it = _ClusterStats.iterator();
it.hasNext(); ) {
com.sun.enterprise.admin.monitor.stats.lb.ClusterStats element = (com.sun.enterprise.admin.monitor.stats.lb.ClusterStats)it.next();
if (element != null) {
if (recursive) {
element.childBeans(true, beans);
}
beans.add(element);
}
}
|
public boolean | equals(java.lang.Object o)
if (o == this)
return true;
if (!(o instanceof com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats))
return false;
com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats inst = (com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats) o;
if (sizeClusterStats() != inst.sizeClusterStats())
return false;
// Compare every element.
for (java.util.Iterator it = _ClusterStats.iterator(), it2 = inst._ClusterStats.iterator();
it.hasNext() && it2.hasNext(); ) {
com.sun.enterprise.admin.monitor.stats.lb.ClusterStats element = (com.sun.enterprise.admin.monitor.stats.lb.ClusterStats)it.next();
com.sun.enterprise.admin.monitor.stats.lb.ClusterStats element2 = (com.sun.enterprise.admin.monitor.stats.lb.ClusterStats)it2.next();
if (!(element == null ? element2 == null : element.equals(element2)))
return false;
}
return true;
|
public java.util.List | fetchClusterStatsList()
return _ClusterStats;
|
public java.lang.Object | fetchPropertyByName(java.lang.String name)
if (name.equals("clusterStats[]"))
return getClusterStats();
throw new IllegalArgumentException(name+" is not a valid property name for LoadBalancerStats");
|
public com.sun.enterprise.admin.monitor.stats.lb.ClusterStats[] | getClusterStats()
ClusterStats[] arr = new ClusterStats[_ClusterStats.size()];
return (ClusterStats[]) _ClusterStats.toArray(arr);
|
public com.sun.enterprise.admin.monitor.stats.lb.ClusterStats | getClusterStats(int index)
return (ClusterStats)_ClusterStats.get(index);
|
public int | hashCode()
int result = 17;
result = 37*result + (_ClusterStats == null ? 0 : _ClusterStats.hashCode());
return result;
|
public static com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats | read(java.io.InputStream in)
return read(new org.xml.sax.InputSource(in), false, null, null);
|
public static com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats | read(org.xml.sax.InputSource in, boolean validate, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh)
javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
dbf.setValidating(validate);
javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
if (er != null) db.setEntityResolver(er);
if (eh != null) db.setErrorHandler(eh);
org.w3c.dom.Document doc = db.parse(in);
return read(doc);
|
public static com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats | read(org.w3c.dom.Document document)
LoadBalancerStats aLoadBalancerStats = new LoadBalancerStats();
aLoadBalancerStats.readNode(document.getDocumentElement());
return aLoadBalancerStats;
|
public static com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats | readNoEntityResolver(java.io.InputStream in)
return read(new org.xml.sax.InputSource(in), false,
new org.xml.sax.EntityResolver() {
public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) {
java.io.ByteArrayInputStream bin = new java.io.ByteArrayInputStream(new byte[0]);
return new org.xml.sax.InputSource(bin);
}
}
, null);
|
public void | readNode(org.w3c.dom.Node node)
org.w3c.dom.NodeList children = node.getChildNodes();
for (int i = 0, size = children.getLength(); i < size; ++i) {
org.w3c.dom.Node childNode = children.item(i);
String childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern());
String childNodeValue = "";
if (childNode.getFirstChild() != null) {
childNodeValue = childNode.getFirstChild().getNodeValue();
}
if (childNodeName == "cluster-stats") {
ClusterStats aClusterStats = new com.sun.enterprise.admin.monitor.stats.lb.ClusterStats();
aClusterStats.readNode(childNode);
_ClusterStats.add(aClusterStats);
}
else {
// Found extra unrecognized childNode
}
}
|
public int | removeClusterStats(com.sun.enterprise.admin.monitor.stats.lb.ClusterStats value)
int pos = _ClusterStats.indexOf(value);
if (pos >= 0) {
_ClusterStats.remove(pos);
}
return pos;
|
public void | setClusterStats(com.sun.enterprise.admin.monitor.stats.lb.ClusterStats[] value)
if (value == null)
value = new ClusterStats[0];
_ClusterStats.clear();
for (int i = 0; i < value.length; ++i) {
_ClusterStats.add(value[i]);
}
|
public void | setClusterStats(int index, com.sun.enterprise.admin.monitor.stats.lb.ClusterStats value)
_ClusterStats.set(index, value);
|
public int | sizeClusterStats()
return _ClusterStats.size();
|
public java.lang.String | toString()
java.io.StringWriter sw = new java.io.StringWriter();
try {
writeNode(sw, "LoadBalancerStats", "");
} catch (java.io.IOException e) {
// How can we actually get an IOException on a StringWriter?
// We'll just ignore it.
}
return sw.toString();
|
public void | validate()
boolean restrictionFailure = false;
// Validating property clusterStats
for (int _index = 0; _index < sizeClusterStats(); ++_index) {
com.sun.enterprise.admin.monitor.stats.lb.ClusterStats element = getClusterStats(_index);
if (element != null) {
element.validate();
}
}
|
public void | write(java.io.OutputStream out)
write(out, null);
|
public void | write(java.io.OutputStream out, java.lang.String encoding)
java.io.Writer w;
if (encoding == null) {
encoding = "UTF-8"; // NOI18N
}
w = new java.io.BufferedWriter(new java.io.OutputStreamWriter(out, encoding));
write(w, encoding);
w.flush();
|
public void | write(java.io.Writer out, java.lang.String encoding)
out.write("<?xml version='1.0'"); // NOI18N
if (encoding != null)
out.write(" encoding='"+encoding+"'"); // NOI18N
out.write(" ?>\n"); // NOI18N
writeNode(out, "load-balancer-stats", ""); // NOI18N
|
public void | writeNode(java.io.Writer out, java.lang.String nodeName, java.lang.String indent)
out.write(indent);
out.write("<");
out.write(nodeName);
out.write(">\n");
String nextIndent = indent + " ";
for (java.util.Iterator it = _ClusterStats.iterator();
it.hasNext(); ) {
com.sun.enterprise.admin.monitor.stats.lb.ClusterStats element = (com.sun.enterprise.admin.monitor.stats.lb.ClusterStats)it.next();
if (element != null) {
element.writeNode(out, "cluster-stats", nextIndent);
}
}
out.write(indent);
out.write("</"+nodeName+">\n");
|
public static void | writeXML(java.io.Writer out, java.lang.String msg)
writeXML(out, msg, true);
|
public static void | writeXML(java.io.Writer out, java.lang.String msg, boolean attribute)
if (msg == null)
return;
int msgLength = msg.length();
for (int i = 0; i < msgLength; ++i) {
char c = msg.charAt(i);
writeXML(out, c, attribute);
}
|
public static void | writeXML(java.io.Writer out, char msg, boolean attribute)
if (msg == '&")
out.write("&");
else if (msg == '<")
out.write("<");
else if (msg == '>")
out.write(">");
else if (attribute && msg == '"")
out.write(""");
else if (attribute && msg == '\'")
out.write("'");
else if (attribute && msg == '\n")
out.write("
");
else if (attribute && msg == '\t")
out.write(" ");
else
out.write(msg);
|