Skip to Content.
Sympa Menu

perfsonar-dev - nmwg: r376 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 tools/owamp/summary/v2_0

Subject: perfsonar development work

List archive

nmwg: r376 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 tools/owamp/summary/v2_0


Chronological Thread 
  • From:
  • To: ,
  • Subject: nmwg: r376 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 tools/owamp/summary/v2_0
  • Date: Thu, 8 Jan 2009 15:08:44 -0500

Author: fernandes
Date: 2009-01-08 15:08:43 -0500 (Thu, 08 Jan 2009)
New Revision: 376

Added:
trunk/nmwg/java/org/ggf/ns/nmwg/base/v2_0/ParentElement.java

trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ReorderingBucket.java

trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ReorderingBuckets.java
Modified:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/Datum.java
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBucket.java
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBuckets.java
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBucket.java
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBuckets.java
Log:
- New class ParentElement is an Element that supports children (childrenMap
and methods based on Datum), Eventually Datum should extend it instead of
Element.
- Added ReorderingBuckets to owamp/summary eventType (bug fix).
- All buckets now extend ParentElement.
- Attributes type of owamp/summary eventType are now in sync with
owdsummary.rnc

Added: trunk/nmwg/java/org/ggf/ns/nmwg/base/v2_0/ParentElement.java

Modified: trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/Datum.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/Datum.java
2008-10-14 12:49:53 UTC (rev 375)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/Datum.java
2009-01-08 20:08:43 UTC (rev 376)
@@ -25,7 +25,7 @@
/**
* attribute for sent (Number of packets sent)
*/
- protected Integer sent;
+ protected Long sent;

/**
* attribute for sync (Synchronized clocks)
@@ -40,12 +40,12 @@
/**
* attribute for duplicates (Number of duplicated packets)
*/
- protected Integer duplicates;
+ protected Long duplicates;

/**
* attribute for loss (Number of packets lost)
*/
- protected Integer loss;
+ protected Long loss;

/**
* attribute for min (Minimum delay)
@@ -94,7 +94,7 @@
}
/* Add Specific Attributes from here */
else if(attr.equals("sent")) {
- setSent(new Integer(value));
+ setSent(new Long(value));
}
else if(attr.equals("sync")) {
setSync(new Boolean(value));
@@ -103,10 +103,10 @@
setMaxError(new Float(value));
}
else if(attr.equals("duplicates")) {
- setDuplicates(new Integer(value));
+ setDuplicates(new Long(value));
}
else if(attr.equals("loss")) {
- setLoss(new Integer(value));
+ setLoss(new Long(value));
}
else if(attr.equals("min_delay")) {
setMinDelay(new Float(value));
@@ -151,6 +151,8 @@
setChild(newChild);
}else
if(newChild.getQName().equals("owampsum:value_buckets")) {
setChild(newChild);
+ }else
if(newChild.getQName().equals("owampsum:reordering_buckets")) {
+ setChild(newChild);
}else {
System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
return false;
@@ -322,22 +324,22 @@
}


- public Integer getDuplicates() {
+ public Long getDuplicates() {
return duplicates;
}


- public void setDuplicates(Integer duplicates) {
+ public void setDuplicates(Long duplicates) {
this.duplicates = duplicates;
}


- public Integer getLoss() {
+ public Long getLoss() {
return loss;
}


- public void setLoss(Integer loss) {
+ public void setLoss(Long loss) {
this.loss = loss;
}

@@ -372,12 +374,12 @@
}


- public Integer getSent() {
+ public Long getSent() {
return sent;
}


- public void setSent(Integer sent) {
+ public void setSent(Long sent) {
this.sent = sent;
}


Added:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ReorderingBucket.java

Added:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ReorderingBuckets.java

Modified:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBucket.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBucket.java
2008-10-14 12:49:53 UTC (rev 375)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBucket.java
2009-01-08 20:08:43 UTC (rev 376)
@@ -11,15 +11,12 @@
*/
package org.ggf.ns.nmwg.tools.owamp.summary.v2_0;

-import java.util.Collection;
-import java.util.Iterator;
-
import org.ggf.ns.nmwg.base.v2_0.Element;
import org.xml.sax.ContentHandler;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;

-public class TTLBucket extends org.ggf.ns.nmwg.base.v2_0.Datum {
+public class TTLBucket extends org.ggf.ns.nmwg.base.v2_0.Element {

/**
* attribute for ttl
@@ -29,7 +26,7 @@
/**
* attribute for count
*/
- protected Integer count;
+ protected Long count;

/**
* The constructor initializes the variables and
@@ -58,9 +55,9 @@
setTtl(new Integer(value));
}
else if(attr.equals("count")) {
- setCount(new Integer(value));
+ setCount(new Long(value));
}
- if(attr.indexOf("xmlns") >= 0) {
+ else if(attr.indexOf("xmlns") >= 0) {
if(attr.split(":").length == 1) {
if(nss.getURI("") == null) {
nss.declarePrefix("", value);
@@ -99,7 +96,6 @@
public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
try {
handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
handler.endElement(getUri(), getLocalName(),
getQName());

if(getCompleted()) {
@@ -120,7 +116,7 @@
AttributesImpl atts = new AttributesImpl();

if(!(getTtl().equals(""))) {
- atts.addAttribute(getUri(), "ttl", "tll", "CDATA",
getTtl().toString());
+ atts.addAttribute(getUri(), "ttl", "ttl", "CDATA",
getTtl().toString());
}
if(!(getCount().equals(""))) {
atts.addAttribute(getUri(), "count", "count",
"CDATA", getCount().toString());
@@ -145,23 +141,15 @@
* the children elements.
*/
public void getDOM(org.w3c.dom.Element parent) {
- Element c;
- Collection cc = getChildMap().values();
-
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element datum = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(datum);
+ org.w3c.dom.Document doc = parent.getOwnerDocument();
+ org.w3c.dom.Element ttlBucket = doc.createElementNS(getUri(),
getQName());
+ parent.appendChild(ttlBucket);
if(!(getTtl().equals(""))) {
- datum.setAttribute("ttl", getTtl().toString());
+ ttlBucket.setAttribute("ttl", getTtl().toString());
}
if(!(getCount().equals(""))) {
- datum.setAttribute("count", getCount().toString());
+ ttlBucket.setAttribute("count",
getCount().toString());
}
-
- for(Iterator i = cc.iterator(); i.hasNext(); ){
- c = (Element)i.next();
- c.getDOM(datum);
- }
}

/**
@@ -169,28 +157,18 @@
* an output statement.
*/
public String toString() {
- String cv = "";
- Element c;
- Collection cc = getChildMap().values();

-
- for(Iterator i = cc.iterator(); i.hasNext(); ){
- c = (Element)i.next();
- cv = cv + c.toString();
- }
-
return getFileName() + ": ---> " +
" ttl: " + getTtl() +
- " sent:" + getCount() +
- " " + cv;
+ " count:" + getCount();
}


- public Integer getCount() {
+ public Long getCount() {
return count;
}


- public void setCount(Integer count) {
+ public void setCount(Long count) {
this.count = count;
}


Modified:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBuckets.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBuckets.java
2008-10-14 12:49:53 UTC (rev 375)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/TTLBuckets.java
2009-01-08 20:08:43 UTC (rev 376)
@@ -13,13 +13,14 @@

import java.util.Collection;
import java.util.Iterator;
+import java.util.Map;

import org.ggf.ns.nmwg.base.v2_0.Element;
import org.xml.sax.ContentHandler;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;

-public class TTLBuckets extends org.ggf.ns.nmwg.base.v2_0.Datum {
+public class TTLBuckets extends org.ggf.ns.nmwg.base.v2_0.ParentElement {

/**
* The constructor initializes the variables and
@@ -38,6 +39,7 @@
}


+
/**
* Sets attributes, it is important to note that we
* access the underlying NMWG Datum information from the

Modified:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBucket.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBucket.java
2008-10-14 12:49:53 UTC (rev 375)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBucket.java
2009-01-08 20:08:43 UTC (rev 376)
@@ -11,20 +11,22 @@
*/
package org.ggf.ns.nmwg.tools.owamp.summary.v2_0;

-import java.util.Collection;
-import java.util.Iterator;
-
import org.ggf.ns.nmwg.base.v2_0.Element;
import org.xml.sax.ContentHandler;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;

-public class ValueBucket extends org.ggf.ns.nmwg.base.v2_0.Datum {
+public class ValueBucket extends org.ggf.ns.nmwg.base.v2_0.Element {

/**
+ * attribute for value
+ */
+ protected Integer value;
+
+ /**
* attribute for count
*/
- protected Integer count;
+ protected Long count;

/**
* The constructor initializes the variables and
@@ -50,12 +52,12 @@
*/
public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
if(attr.equals("value")) {
- setValue(value);
+ setValue(new Integer(value));
}
else if(attr.equals("count")) {
- setCount(new Integer(value));
+ setCount(new Long(value));
}
- if(attr.indexOf("xmlns") >= 0) {
+ else if(attr.indexOf("xmlns") >= 0) {
if(attr.split(":").length == 1) {
if(nss.getURI("") == null) {
nss.declarePrefix("", value);
@@ -81,19 +83,12 @@
}

/**
- * The only allowable childs for a value_buckets element are
- * value_bucket elements.
+ * No childs allowed.
*/
public boolean addChild(Element newChild) {
- if(newChild.getLocalName().equals("value_bucket")) {
- setChild(newChild);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
- return false;
- }
- return true;
- }
+ System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
+ return false;
+ }

/**
* Converts the contents of this object into an xml tag.
@@ -101,7 +96,6 @@
public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
try {
handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
handler.endElement(getUri(), getLocalName(),
getQName());

if(getCompleted()) {
@@ -122,7 +116,7 @@
AttributesImpl atts = new AttributesImpl();

if(!(getValue().equals(""))) {
- atts.addAttribute(getUri(), "value", "value",
"CDATA", getValue());
+ atts.addAttribute(getUri(), "value", "value",
"CDATA", getValue().toString());
}
if(!(getCount().equals(""))) {
atts.addAttribute(getUri(), "count", "count",
"CDATA", getCount().toString());
@@ -147,23 +141,17 @@
* the children elements.
*/
public void getDOM(org.w3c.dom.Element parent) {
- Element c;
- Collection cc = getChildMap().values();

- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element datum = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(datum);
+ org.w3c.dom.Document doc = parent.getOwnerDocument();
+ org.w3c.dom.Element valueBucket = doc.createElementNS(getUri(),
getQName());
+ parent.appendChild(valueBucket);
if(!(getValue().equals(""))) {
- datum.setAttribute("value", getValue());
+ valueBucket.setAttribute("value",
getValue().toString());
}
if(!(getCount().equals(""))) {
- datum.setAttribute("count", getCount().toString());
- }
+ valueBucket.setAttribute("count",
getCount().toString());
+ }

- for(Iterator i = cc.iterator(); i.hasNext(); ){
- c = (Element)i.next();
- c.getDOM(datum);
- }
}

/**
@@ -171,29 +159,30 @@
* an output statement.
*/
public String toString() {
- String cv = "";
- Element c;
- Collection cc = getChildMap().values();

-
- for(Iterator i = cc.iterator(); i.hasNext(); ){
- c = (Element)i.next();
- cv = cv + c.toString();
- }
-
- return getFileName() + ": ---> " + getValue() +
- " sent:" + getCount() +
- " " + cv;
+ return getFileName() + ": ---> " +
+ " value: " + getValue() +
+ " sent: " + getCount();
}


- public Integer getCount() {
+ public Long getCount() {
return count;
}


- public void setCount(Integer count) {
+ public void setCount(Long count) {
this.count = count;
}

+
+ public Integer getValue() {
+ return value;
+ }
+
+
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+
}


Modified:
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBuckets.java
===================================================================
---
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBuckets.java
2008-10-14 12:49:53 UTC (rev 375)
+++
trunk/nmwg/java/org/ggf/ns/nmwg/tools/owamp/summary/v2_0/ValueBuckets.java
2009-01-08 20:08:43 UTC (rev 376)
@@ -19,7 +19,7 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;

-public class ValueBuckets extends org.ggf.ns.nmwg.base.v2_0.Datum {
+public class ValueBuckets extends org.ggf.ns.nmwg.base.v2_0.ParentElement {

/**
* The constructor initializes the variables and



  • nmwg: r376 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 tools/owamp/summary/v2_0, svnlog, 01/08/2009

Archive powered by MHonArc 2.6.16.

Top of Page