Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6015 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType/fetch perfsonar-jav a-sql-ma/src/main/java/org/perfsonar/service/measurementAr chive/sqlType/nmwg perfsonar-java-sql-ma/src/main/java/org /perfsonar/service/measurementArchive/sqlType/store perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/queryGenerator

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r6015 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType/fetch perfsonar-jav a-sql-ma/src/main/java/org/perfsonar/service/measurementAr chive/sqlType/nmwg perfsonar-java-sql-ma/src/main/java/org /perfsonar/service/measurementArchive/sqlType/store perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/queryGenerator


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6015 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType/fetch perfsonar-jav a-sql-ma/src/main/java/org/perfsonar/service/measurementAr chive/sqlType/nmwg perfsonar-java-sql-ma/src/main/java/org /perfsonar/service/measurementArchive/sqlType/store perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/queryGenerator
  • Date: Fri, 5 Oct 2012 10:22:52 +0100 (BST)

Author: nordunet.behrmann
Date: 2012-10-05 10:22:52 +0100 (Fri, 05 Oct 2012)
New Revision: 6015

Modified:

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/BwctlStoreRequestProcess.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/PingStoreRequestProcess.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
Log:
perfsonar_base, perfsonar-java-sql-ma: Convert DOS to UNIX newlines

Issue: PSSERVICES-588

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,134 +1,134 @@
-package org.perfsonar.service.measurementArchive.sqlType.fetch;
-
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.ggf.ns.nmwg.base.v2_0.Data;
-import org.ggf.ns.nmwg.tools.bwctl.v2_0.Datum;
-import org.perfsonar.base.exceptions.PerfSONARException;
-
-/**
- * Creates the response of service for bwctl data.
- *
- * @author fernandes
- */
-
-public class BwctlResponseGenerator extends ResponseGenerator
-{
-
-
- // -------------------------------------- constructors
-
-
- public BwctlResponseGenerator() throws PerfSONARException
- {
-
- super();
-
- }
-
-
- // -------------------------------------- public methods
-
-
- @Override
- public Data getResponse(List<Map<String,Object>> resultList) throws
Exception
- {
-
-
- Data data = new Data();
-
-
- for (Map<String,Object> resultMap: resultList) {
-
- Datum datum = new Datum();
-
- Collection<String> kCollection = resultMap.keySet();
-
- for (String column : kCollection) {
-
- Object value = resultMap.get(column);
- String className = value.getClass().getName();
- String strValue = null;
-
- if (className.equals("java.lang.Float")) {
- strValue = Float.toString((Float) value);
- }
- if (className.equals("java.lang.Double")) {
- strValue = Double.toString((Double) value);
- } else if (className.equals("java.lang.Integer")) {
- strValue = Integer.toString((Integer) value);
- } else if (className.equals("java.lang.Long")) {
- strValue = Long.toString((Long) value);
- } else if (className.equals("java.lang.Date")) {
- strValue = value.toString();
- } else if (className.equals("java.lang.String")) {
- strValue = (String) value;
- }
-
- if (strValue != null) {
-
- if (column.equals("intervalEnd")) {
- datum.setIntervalEnd(strValue);
- } else if (column.equals("intervalStart")) {
- datum.setIntervalStart(strValue);
- } else if (column.equals("intervalUnit")) {
- datum.setIntervalUnit(strValue);
- } else if (column.equals("numBytes")) {
- datum.setNumBytes(strValue);
- } else if (column.equals("numBytesUnits")) {
- datum.setNumBytesUnits(strValue);
- } else if (column.equals("timeType")) {
- datum.setTimeType(strValue);
- } else if (column.equals("timeValue")) {
- datum.setTimeValue(strValue);
- } else if (column.equals("value")) {
- datum.setValue(strValue);
- } else if (column.equals("valueUnits")) {
- datum.setValueUnits(strValue);
- } else if (column.equals("tcpAdapterType")) {
- datum.setTcpAdapterType(strValue);
- } else if (column.equals("tcpMSSSize")) {
- datum.setTcpMSSSize(strValue);
- } else if (column.equals("tcpMSSUnit")) {
- datum.setTcpMSSUnit(strValue);
- } else if (column.equals("tcpMTUUnit")) {
- datum.setTcpMTUUnit(strValue);
- } else if (column.equals("tcpMTUSize")) {
- datum.setTcpMTUSize(strValue);
- } else if (column.equals("tcpWindowSize")) {
- datum.setTcpWindowSize(strValue);
- } else if (column.equals("tcpWindowUnit")) {
- datum.setTcpWindowUnit(strValue);
- } else if (column.equals("udpBufferSize")) {
- datum.setUdpBufferSize(strValue);
- } else if (column.equals("udpBufferUnit")) {
- datum.setUdpBufferUnit(strValue);
- } else if (column.equals("udpJitter")) {
- datum.setUdpJitter(strValue);
- } else if (column.equals("udpJitterUnit")) {
- datum.setUdpJitterUnit(strValue);
- } else if (column.equals("udpPacketLoss")) {
- datum.setUdpPacketLoss(strValue);
- } else if (column.equals("udpPacketLossPercentage")) {
- datum.setUdpPacketLossPercentage(strValue);
- } else if (column.equals("udpPacketSent")) {
- datum.setUdpPacketSent(strValue);
- }
- }
-
-
- }
-
- data.addChild(datum);
-
- }
-
- return data;
-
- }
-
-
-} //BwctlResponseGenerator
+package org.perfsonar.service.measurementArchive.sqlType.fetch;
+
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.ggf.ns.nmwg.base.v2_0.Data;
+import org.ggf.ns.nmwg.tools.bwctl.v2_0.Datum;
+import org.perfsonar.base.exceptions.PerfSONARException;
+
+/**
+ * Creates the response of service for bwctl data.
+ *
+ * @author fernandes
+ */
+
+public class BwctlResponseGenerator extends ResponseGenerator
+{
+
+
+ // -------------------------------------- constructors
+
+
+ public BwctlResponseGenerator() throws PerfSONARException
+ {
+
+ super();
+
+ }
+
+
+ // -------------------------------------- public methods
+
+
+ @Override
+ public Data getResponse(List<Map<String,Object>> resultList) throws
Exception
+ {
+
+
+ Data data = new Data();
+
+
+ for (Map<String,Object> resultMap: resultList) {
+
+ Datum datum = new Datum();
+
+ Collection<String> kCollection = resultMap.keySet();
+
+ for (String column : kCollection) {
+
+ Object value = resultMap.get(column);
+ String className = value.getClass().getName();
+ String strValue = null;
+
+ if (className.equals("java.lang.Float")) {
+ strValue = Float.toString((Float) value);
+ }
+ if (className.equals("java.lang.Double")) {
+ strValue = Double.toString((Double) value);
+ } else if (className.equals("java.lang.Integer")) {
+ strValue = Integer.toString((Integer) value);
+ } else if (className.equals("java.lang.Long")) {
+ strValue = Long.toString((Long) value);
+ } else if (className.equals("java.lang.Date")) {
+ strValue = value.toString();
+ } else if (className.equals("java.lang.String")) {
+ strValue = (String) value;
+ }
+
+ if (strValue != null) {
+
+ if (column.equals("intervalEnd")) {
+ datum.setIntervalEnd(strValue);
+ } else if (column.equals("intervalStart")) {
+ datum.setIntervalStart(strValue);
+ } else if (column.equals("intervalUnit")) {
+ datum.setIntervalUnit(strValue);
+ } else if (column.equals("numBytes")) {
+ datum.setNumBytes(strValue);
+ } else if (column.equals("numBytesUnits")) {
+ datum.setNumBytesUnits(strValue);
+ } else if (column.equals("timeType")) {
+ datum.setTimeType(strValue);
+ } else if (column.equals("timeValue")) {
+ datum.setTimeValue(strValue);
+ } else if (column.equals("value")) {
+ datum.setValue(strValue);
+ } else if (column.equals("valueUnits")) {
+ datum.setValueUnits(strValue);
+ } else if (column.equals("tcpAdapterType")) {
+ datum.setTcpAdapterType(strValue);
+ } else if (column.equals("tcpMSSSize")) {
+ datum.setTcpMSSSize(strValue);
+ } else if (column.equals("tcpMSSUnit")) {
+ datum.setTcpMSSUnit(strValue);
+ } else if (column.equals("tcpMTUUnit")) {
+ datum.setTcpMTUUnit(strValue);
+ } else if (column.equals("tcpMTUSize")) {
+ datum.setTcpMTUSize(strValue);
+ } else if (column.equals("tcpWindowSize")) {
+ datum.setTcpWindowSize(strValue);
+ } else if (column.equals("tcpWindowUnit")) {
+ datum.setTcpWindowUnit(strValue);
+ } else if (column.equals("udpBufferSize")) {
+ datum.setUdpBufferSize(strValue);
+ } else if (column.equals("udpBufferUnit")) {
+ datum.setUdpBufferUnit(strValue);
+ } else if (column.equals("udpJitter")) {
+ datum.setUdpJitter(strValue);
+ } else if (column.equals("udpJitterUnit")) {
+ datum.setUdpJitterUnit(strValue);
+ } else if (column.equals("udpPacketLoss")) {
+ datum.setUdpPacketLoss(strValue);
+ } else if (column.equals("udpPacketLossPercentage")) {
+ datum.setUdpPacketLossPercentage(strValue);
+ } else if (column.equals("udpPacketSent")) {
+ datum.setUdpPacketSent(strValue);
+ }
+ }
+
+
+ }
+
+ data.addChild(datum);
+
+ }
+
+ return data;
+
+ }
+
+
+} //BwctlResponseGenerator

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,105 +1,105 @@
-package org.perfsonar.service.measurementArchive.sqlType.fetch;
-
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.ggf.ns.nmwg.base.v2_0.Data;
-import org.ggf.ns.nmwg.tools.ping.v2_0.Datum;
-import org.perfsonar.base.exceptions.PerfSONARException;
-
-/**
- * Creates the response of service for ping data.
- *
- * @author fernandes
- */
-
-public class PingResponseGenerator extends ResponseGenerator
-{
-
-
- // -------------------------------------- constructors
-
-
- public PingResponseGenerator() throws PerfSONARException
- {
-
- super();
-
- }
-
-
- // -------------------------------------- public methods
-
-
- @Override
- public Data getResponse(List<Map<String,Object>> resultList) throws
Exception
- {
-
-
- Data data = new Data();
-
-
- for (Map<String,Object> resultMap : resultList) {
-
- Datum datum = new Datum();
-
- for (String column : resultMap.keySet()) {
-
- Object value = resultMap.get(column);
- String className = value.getClass().getName();
- String strValue = null;
-
- if (className.equals("java.lang.Float")) {
- strValue = Float.toString((Float) value);
- }
- if (className.equals("java.lang.Double")) {
- strValue = Double.toString((Double) value);
- } else if (className.equals("java.lang.Integer")) {
- strValue = Integer.toString((Integer) value);
- } else if (className.equals("java.lang.Long")) {
- strValue = Long.toString((Long) value);
- } else if (className.equals("java.lang.Date")) {
- strValue = value.toString();
- } else if (className.equals("java.lang.String")) {
- strValue = (String) value;
- }
-
- if (strValue != null) {
-
- if (column.equals("numBytes")) {
- datum.setNumBytes(strValue);
- } else if (column.equals("numBytesUnits")) {
- datum.setNumBytesUnits(strValue);
- } else if (column.equals("seqNum")) {
- datum.setSeqNum(strValue);
- } else if (column.equals("value")) {
- datum.setValue(strValue);
- } else if (column.equals("valueUnits")) {
- datum.setValueUnits(strValue);
- } else if (column.equals("ttl")) {
- datum.setTTL(strValue);
- } else if (column.equals("timeType")) {
- datum.setTimeType(strValue);
- } else if (column.equals("timeValue")) {
- datum.setTimeValue(strValue);
- }
-
- //logger.debug("SQLStorageManager.fetch: "
- // + "column: " + column + ", value: " + strValue );
-
- }
-
- }
-
- data.addChild(datum);
-
- }
-
- return data;
-
- }
-
-
-} //PingResponseGenerator
+package org.perfsonar.service.measurementArchive.sqlType.fetch;
+
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.ggf.ns.nmwg.base.v2_0.Data;
+import org.ggf.ns.nmwg.tools.ping.v2_0.Datum;
+import org.perfsonar.base.exceptions.PerfSONARException;
+
+/**
+ * Creates the response of service for ping data.
+ *
+ * @author fernandes
+ */
+
+public class PingResponseGenerator extends ResponseGenerator
+{
+
+
+ // -------------------------------------- constructors
+
+
+ public PingResponseGenerator() throws PerfSONARException
+ {
+
+ super();
+
+ }
+
+
+ // -------------------------------------- public methods
+
+
+ @Override
+ public Data getResponse(List<Map<String,Object>> resultList) throws
Exception
+ {
+
+
+ Data data = new Data();
+
+
+ for (Map<String,Object> resultMap : resultList) {
+
+ Datum datum = new Datum();
+
+ for (String column : resultMap.keySet()) {
+
+ Object value = resultMap.get(column);
+ String className = value.getClass().getName();
+ String strValue = null;
+
+ if (className.equals("java.lang.Float")) {
+ strValue = Float.toString((Float) value);
+ }
+ if (className.equals("java.lang.Double")) {
+ strValue = Double.toString((Double) value);
+ } else if (className.equals("java.lang.Integer")) {
+ strValue = Integer.toString((Integer) value);
+ } else if (className.equals("java.lang.Long")) {
+ strValue = Long.toString((Long) value);
+ } else if (className.equals("java.lang.Date")) {
+ strValue = value.toString();
+ } else if (className.equals("java.lang.String")) {
+ strValue = (String) value;
+ }
+
+ if (strValue != null) {
+
+ if (column.equals("numBytes")) {
+ datum.setNumBytes(strValue);
+ } else if (column.equals("numBytesUnits")) {
+ datum.setNumBytesUnits(strValue);
+ } else if (column.equals("seqNum")) {
+ datum.setSeqNum(strValue);
+ } else if (column.equals("value")) {
+ datum.setValue(strValue);
+ } else if (column.equals("valueUnits")) {
+ datum.setValueUnits(strValue);
+ } else if (column.equals("ttl")) {
+ datum.setTTL(strValue);
+ } else if (column.equals("timeType")) {
+ datum.setTimeType(strValue);
+ } else if (column.equals("timeValue")) {
+ datum.setTimeValue(strValue);
+ }
+
+ //logger.debug("SQLStorageManager.fetch: "
+ // + "column: " + column + ", value: " + strValue );
+
+ }
+
+ }
+
+ data.addChild(datum);
+
+ }
+
+ return data;
+
+ }
+
+
+} //PingResponseGenerator

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,671 +1,671 @@
-package org.perfsonar.service.measurementArchive.sqlType.nmwg;
-
-/**
- * This describes the datum format of a ping measurement.
- *
- * @author Piotr Pikusa
- * @version $Id$
- * @see org.ggf.ns.nmwg.base.v2_0.Element
- * @see org.ggf.ns.nmwg.base.v2_0.Datum
- * @see org.ggf.ns.nmwg.time.v2_0.Time
- * @see org.w3c.dom.Document
- * @see org.w3c.dom.Element
- */
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.helpers.AttributesImpl;
-import org.ggf.ns.nmwg.base.v2_0.Element;
-import org.ggf.ns.nmwg.time.v2_0.Time;
-import org.xml.sax.helpers.NamespaceSupport;
-
-public class OwampAggregationDatum extends
org.ggf.ns.nmwg.tools.owamp.v2_0.Datum
-{
-
- public static final String FILENAME =
"org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java";
-
- /**
- * attribute for Sender
- */
- protected String sender;
-
- /**
- * attribute for receiver
- */
- protected String receiver;
-
- /**
- * attribute for sent
- */
- protected String sent;
-
- /**
- * attribute for loss
- */
- protected String loss;
-
- /**
- * attribute for RECVTIME (Receive timestamp)
- */
- protected String duplicates;
-
- /**
- * attribute for Lost in percrent
- */
- protected String lostPercent;
-
- /**
- * attribute for minimum dealy
- */
- protected String minDelay;
-
- /**
- * attribute for medium delay
- */
- protected String medDelay;
-
- protected String maxDelay;
-
- protected String delayUnits;
-
- protected String error;
-
- protected String errorUnits;
-
- protected String jitter;
-
- protected String jitterUnits;
-
- protected String hops;
-
- public String getSender()
- {
- return sender;
- }
-
- public void setSender(String sender)
- {
- this.sender = sender;
- }
-
- public String getReceiver()
- {
- return receiver;
- }
-
- public void setReceiver(String receiver)
- {
- this.receiver = receiver;
- }
-
- public String getSent()
- {
- return sent;
- }
-
- public void setSent(String sent)
- {
- this.sent = sent;
- }
-
- public String getLoss()
- {
- return loss;
- }
-
- public void setLoss(String loss)
- {
- this.loss = loss;
- }
-
- public String getDuplicates()
- {
- return duplicates;
- }
-
- public void setDuplicates(String duplicates)
- {
- this.duplicates = duplicates;
- }
-
- public String getLostPercent()
- {
- return lostPercent;
- }
-
- public void setLostPercent(String lostPercent)
- {
- this.lostPercent = lostPercent;
- }
-
- public String getMinDelay()
- {
- return minDelay;
- }
-
- public void setMinDelay(String minDelay)
- {
- this.minDelay = minDelay;
- }
-
- public String getMedDelay()
- {
- return medDelay;
- }
-
- public void setMedDelay(String medDelay)
- {
- this.medDelay = medDelay;
- }
-
- public String getMaxDelay()
- {
- return maxDelay;
- }
-
- public void setMaxDelay(String maxDelay)
- {
- this.maxDelay = maxDelay;
- }
-
- public String getDelayUnits()
- {
- return delayUnits;
- }
-
- public void setDelayUnits(String delayUnits)
- {
- this.delayUnits = delayUnits;
- }
-
- public String getError()
- {
- return error;
- }
-
- public void setError(String error)
- {
- this.error = error;
- }
-
- public String getErrorUnits()
- {
- return errorUnits;
- }
-
- public void setErrorUnits(String errorUnits)
- {
- this.errorUnits = errorUnits;
- }
-
- public String getJitter()
- {
- return jitter;
- }
-
- public void setJitter(String jitter)
- {
- this.jitter = jitter;
- }
-
- public String getJitterUnits()
- {
- return jitterUnits;
- }
-
- public void setJitterUnits(String jitterUnits)
- {
- this.jitterUnits = jitterUnits;
- }
-
- public String getHops()
- {
- return hops;
- }
-
- public void setHops(String hops)
- {
- this.hops = hops;
- }
-
- /**
- * The constructor initializes the variables and sets xml element
- * information (when applicable).
- */
- public OwampAggregationDatum()
- {
- sender = "";
- receiver = "";
- sent = "";
- loss = "";
- duplicates = "";
- lostPercent = "";
- minDelay = "";
- medDelay = "";
-
- parent = null;
- id = "";
- completed = false;
-
- localName = "datum";
- uri = "http://ggf.org/ns/nmwg/tools/owamp/2.0/";;
- qName = "owamp:datum";
- prefix = "owamp";
- fileName =
"org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java";
- }
-
- @Override
- public boolean addAttr(String attr, String value, NamespaceSupport nss)
- {
-
-
- if (attr.equals("value")) {
- setValue(value);
- }
- //OWAMP SUMMARY DATUM PARAMETERS
- else if (attr.equals("valueUnits")) {
- setValueUnits(value);
- } else if (attr.equals("numBytes")) {
- setNumBytes(value);
- } else if (attr.equals("numBytesUnits")) {
- setNumBytesUnits(value);
- } else if (attr.equals("sender")) {
- setSender(value);
- } else if (attr.equals("receiver")) {
- setReceiver(value);
- } else if (attr.equals("sent")) {
- setSent(value);
- } else if (attr.equals("loss")) {
- setLoss(value);
- } else if (attr.equals("lostPercent")) {
- setLostPercent(value);
- } else if (attr.equals("duplicates")) {
- setDuplicates(value);
- } else if (attr.equals("minDelay")) {
- setMinDelay(value);
- } else if (attr.equals("medDelay")) {
- setMedDelay(value);
- } else if (attr.equals("maxDelay")) {
- setMaxDelay(value);
- } else if (attr.equals("delayUnits")) {
- setDelayUnits(value);
- } else if (attr.equals("error")) {
- setError(value);
- } else if (attr.equals("errorUnits")) {
- setErrorUnits(value);
- } else if (attr.equals("jitter")) {
- setJitter(value);
- } else if (attr.equals("jitterUnits")) {
- setJitterUnits(value);
- } else if (attr.equals("hops")) {
- setHops(value);
- }
- //OWAMP DATUM PARAMETERS
- else if (attr.equals("seqNum")) {
- setSeqNum(value);
- } else if (attr.equals("sendTime")) {
- setSendTime(value);
- } else if (attr.equals("sendSynchronized")) {
- setSendSynchronized(value);
- } else if (attr.equals("sendTimeError")) {
- setSendTimeError(value);
- } else if (attr.equals("receiveTime")) {
- setReceiveTime(value);
- } else if (attr.equals("receiveSynchronized")) {
- setReceiveSynchronized(value);
- } else if (attr.equals("receiveTimeError")) {
- setReceiveTimeError(value);
- } else if (attr.equals("ttl")) {
- setTTL(value);
- } else if (attr.contains("xmlns")) {
- if (attr.split(":").length == 1) {
- if (nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if ((prefix.isEmpty()) && !(value.equals(uri))) {
- uri = value;
- }
- } else {
- if (nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1], value);
- }
- if ((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- } else {
- System.err
- .println("Error: "
- + getFileName()
- + " addAttr(String, String, NamespaceSupport)
unrecognized attribute pair: "
- + attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The only allowable child for a datum element is the time.
- */
- @Override
- public boolean addChild(Element newChild)
- {
- if (newChild.getLocalName().equals("time")) {
- setTime((Time) newChild);
- } else {
- System.err.println("Error: " + getFileName()
- + " addChild(Element) unrecognized child: " + newChild);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- @Override
- 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()) {
- nss.popContext();
- unSetCompleted();
- }
- } catch (Exception e) {
- System.err
- .println("Error: "
- + getFileName()
- + " toXML(ContentHandler, NamespaceSupport) XML
formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- @Override
- public AttributesImpl getAttributes(NamespaceSupport nss)
- {
- AttributesImpl atts = new AttributesImpl();
-
- //SUMMARY DAT
- if (!(getValue().isEmpty())) {
- atts.addAttribute(getUri(), "value", "value", "CDATA",
getValue());
- }
- if (!(getValueUnits().isEmpty())) {
- atts.addAttribute(getUri(), "valueUnits", "valueUnits", "CDATA",
- getValueUnits());
- }
- if (!(getNumBytes().isEmpty())) {
- atts.addAttribute(getUri(), "numBytes", "numBytes", "CDATA",
- getNumBytes());
- }
- if (!(getNumBytesUnits().isEmpty())) {
- atts.addAttribute(getUri(), "numBytesUnits", "numBytesUnits",
- "CDATA", getNumBytesUnits());
- }
- if (!(getTimeType().isEmpty())) {
- atts.addAttribute(getUri(), "timeType", "timeType", "CDATA",
- getTimeType());
- }
- if (!(getTimeValue().isEmpty())) {
- atts.addAttribute(getUri(), "timeValue", "timeValue", "CDATA",
- getTimeValue());
- }
- /* Add Specific Attributes from here */
- if (!(getSender().isEmpty())) {
- atts.addAttribute(getUri(), "sender", "sender", "CDATA",
- getSender());
- }
- if (!(getReceiver().isEmpty())) {
- atts.addAttribute(getUri(), "receiver", "receiver", "CDATA",
- getReceiver());
- }
- if (!(getSent().isEmpty())) {
- atts.addAttribute(getUri(), "sent", "sent",
- "CDATA", getSent());
- }
- if (!(getLoss().isEmpty())) {
- atts.addAttribute(getUri(), "loss", "loss",
- "CDATA", getLoss());
- }
- if (!(getLostPercent().isEmpty())) {
- atts.addAttribute(getUri(), "lostPercent", "lostPercent",
"CDATA",
- getLostPercent());
- }
- if (!(getDuplicates().isEmpty())) {
- atts.addAttribute(getUri(), "duplicates",
- "duplicates", "CDATA", getDuplicates());
- }
- if (!(getMinDelay().isEmpty())) {
- atts.addAttribute(getUri(), "minDelay", "minDelay",
- "CDATA", getMinDelay());
- }
- if (!(getMedDelay().isEmpty())) {
- atts.addAttribute(getUri(), "medDelay", "medDelay", "CDATA",
getMedDelay());
- }
- if (!(getMaxDelay().isEmpty())) {
- atts.addAttribute(getUri(), "maxDelay", "maxDelay", "CDATA",
getMaxDelay());
- }
- if (!(getDelayUnits().isEmpty())) {
- atts.addAttribute(getUri(), "delayUnits", "delayUnits", "CDATA",
getDelayUnits());
- }
- if (!(getError().isEmpty())) {
- atts.addAttribute(getUri(), "error", "error", "CDATA",
getError());
- }
- if (!(getErrorUnits().isEmpty())) {
- atts.addAttribute(getUri(), "errorUnits", "errorUnits", "CDATA",
getErrorUnits());
- }
- if (!(getJitter().isEmpty())) {
- atts.addAttribute(getUri(), "jitter", "jitter", "CDATA",
getJitter());
- }
- if (!(getJitterUnits().isEmpty())) {
- atts.addAttribute(getUri(), "jitterUnits", "jitterUnits",
"CDATA", getJitterUnits());
- }
- if (!(getHops().isEmpty())) {
- atts.addAttribute(getUri(), "hops", "hops", "CDATA", getHops());
- }
-
- //REGULAR DATUM
- if (!(getValue().isEmpty())) {
- atts.addAttribute(getUri(), "value", "value", "CDATA",
getValue());
- }
- if (!(getValueUnits().isEmpty())) {
- atts.addAttribute(getUri(), "valueUnits", "valueUnits", "CDATA",
getValueUnits());
- }
- if (!(getNumBytes().isEmpty())) {
- atts.addAttribute(getUri(), "numBytes", "numBytes", "CDATA",
getNumBytes());
- }
- if (!(getNumBytesUnits().isEmpty())) {
- atts.addAttribute(getUri(), "numBytesUnits", "numBytesUnits",
"CDATA", getNumBytesUnits());
- }
- if (!(getTimeType().isEmpty())) {
- atts.addAttribute(getUri(), "timeType", "timeType", "CDATA",
getTimeType());
- }
- if (!(getTimeValue().isEmpty())) {
- atts.addAttribute(getUri(), "timeValue", "timeValue", "CDATA",
getTimeValue());
- }
- if (!(getSeqNum().isEmpty())) {
- atts.addAttribute(getUri(), "seqNum", "seqNum", "CDATA",
getSeqNum());
- }
- if (!(getSendTime().isEmpty())) {
- atts.addAttribute(getUri(), "sendTime", "sendTime", "CDATA",
getSendTime());
- }
- if (!(getSendSynchronized().isEmpty())) {
- atts.addAttribute(getUri(), "sendSynchronized",
"sendSynchronized", "CDATA", getSendSynchronized());
- }
- if (!(getSendTimeError().isEmpty())) {
- atts.addAttribute(getUri(), "sendTimeError", "sendTimeError",
"CDATA", getSendTimeError());
- }
- if (!(getReceiveTime().isEmpty())) {
- atts.addAttribute(getUri(), "receiveTime", "receiveTime",
"CDATA", getReceiveTime());
- }
- if (!(getReceiveSynchronized().isEmpty())) {
- atts.addAttribute(getUri(), "receiveSynchronized",
"receiveSynchronized", "CDATA", getReceiveSynchronized());
- }
- if (!(getReceiveTimeError().isEmpty())) {
- atts.addAttribute(getUri(), "receiveTimeError",
"receiveTimeError", "CDATA", getReceiveTimeError());
- }
- if (!(getTTL().isEmpty())) {
- atts.addAttribute(getUri(), "ttl", "ttl", "CDATA", getTTL());
- }
-
-
- if (nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if (getPrefix().isEmpty()) {
- atts.addAttribute(getUri(), "xmlns", "xmlns", "CDATA",
getUri());
- } else {
- atts.addAttribute(getUri(), "xmlns:" + getPrefix(), "xmlns:"
- + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Chases children references down to print out all related xml tags.
- */
- @Override
- public ContentHandler getChildren(ContentHandler handler,
- NamespaceSupport nss) throws Exception
- {
- if (getTime() != null) {
- handler = getTime().toXML(handler, nss);
- }
- return handler;
- }
-
- /**
- * Given a DOM element (a parent), construct the children elements.
- */
- @Override
- public void getDOM(org.w3c.dom.Element parent)
- {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element datum = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(datum);
- if (!(getValue().isEmpty())) {
- datum.setAttribute("value", getValue());
- }
- if (!(getValueUnits().isEmpty())) {
- datum.setAttribute("valueUnits", getValueUnits());
- }
- if (!(getTimeType().isEmpty())) {
- datum.setAttribute("timeType", getTimeType());
- }
- if (!(getTimeValue().isEmpty())) {
- datum.setAttribute("timeValue", getTimeValue());
- }
- if (!(getNumBytes().isEmpty())) {
- datum.setAttribute("numBytes", getNumBytes());
- }
- if (!(getNumBytesUnits().isEmpty())) {
- datum.setAttribute("numBytesUnits", getNumBytesUnits());
- }
- /* Add Specific Attributes from here */
- if (!(getSent().isEmpty())) {
- datum.setAttribute("sent", getSent());
- }
- if (!(getReceiver().isEmpty())) {
- datum.setAttribute("receiver", getReceiver());
- }
- if (!(getSender().isEmpty())) {
- datum.setAttribute("sender", getSender());
- }
- if (!(getLoss().isEmpty())) {
- datum.setAttribute("loss", getLoss());
- }
- if (!(getLostPercent().isEmpty())) {
- datum.setAttribute("lostPercent", getLostPercent());
- }
- if (!(getDuplicates().isEmpty())) {
- datum.setAttribute("duplicates", getDuplicates());
- }
- if (!(getMinDelay().isEmpty())) {
- datum.setAttribute("minDelay", getMinDelay());
- }
- if (!(getMedDelay().isEmpty())) {
- datum.setAttribute("medDelay", getMedDelay());
- }
- if (!(getMaxDelay().isEmpty())) {
- datum.setAttribute("maxDelay", getMaxDelay());
- }
- if (!(getDelayUnits().isEmpty())) {
- datum.setAttribute("delayUnits", getDelayUnits());
- }
- if (!(getError().isEmpty())) {
- datum.setAttribute("error", getError());
- }
- if (!(getErrorUnits().isEmpty())) {
- datum.setAttribute("errorUnits", getErrorUnits());
- }
- if (!(getJitter().isEmpty())) {
- datum.setAttribute("jitter", getJitter());
- }
- if (!(getJitterUnits().isEmpty())) {
- datum.setAttribute("jitterUnits", getJitterUnits());
- }
- if (!(getHops().isEmpty())) {
- datum.setAttribute("hops", getHops());
- }
-
- if (getTime() != null) {
- getTime().getDOM(datum);
- }
-
-
- //REGULAR DATUM
- if (!(getSeqNum().isEmpty())) {
- datum.setAttribute("seqNum", getSeqNum());
- }
- if (!(getSendTime().isEmpty())) {
- datum.setAttribute("sendTime", getSendTime());
- }
- if (!(getSendSynchronized().isEmpty())) {
- datum.setAttribute("sendSynchronized", getSendSynchronized());
- }
- if (!(getSendTimeError().isEmpty())) {
- datum.setAttribute("sendTimeError", getSendTimeError());
- }
- if (!(getReceiveTime().isEmpty())) {
- datum.setAttribute("receiveTime", getReceiveTime());
- }
- if (!(getReceiveSynchronized().isEmpty())) {
- datum.setAttribute("receiveSynchronized",
getReceiveSynchronized());
- }
- if (!(getReceiveTimeError().isEmpty())) {
- datum.setAttribute("receiveTimeError", getReceiveTimeError());
- }
- if (!(getTTL().isEmpty())) {
- datum.setAttribute("ttl", getTTL());
- }
-
- if (getTime() != null) {
- getTime().getDOM(datum);
- }
-
- }
-
-
- @Override
- public String toString()
- {
- return getFileName() + ": ---> " + getValue() + " sender=" + sender
+ ", receiver="
- + receiver + ", sent=" + sent + ", loss=" + loss
- + ", duplicates=" + duplicates + ", lostPercent=" + lostPercent
- + ", minDelay=" + minDelay + ", medDelay=" + medDelay
- + ", maxDelay=" + maxDelay + ", delayUnits=" + delayUnits
- + ", error=" + error + ", errorUnits=" + errorUnits
- + ", jitter=" + jitter + ", jitterUnits=" + jitterUnits
- + ", hops=" + hops;
- }
-}
+package org.perfsonar.service.measurementArchive.sqlType.nmwg;
+
+/**
+ * This describes the datum format of a ping measurement.
+ *
+ * @author Piotr Pikusa
+ * @version $Id$
+ * @see org.ggf.ns.nmwg.base.v2_0.Element
+ * @see org.ggf.ns.nmwg.base.v2_0.Datum
+ * @see org.ggf.ns.nmwg.time.v2_0.Time
+ * @see org.w3c.dom.Document
+ * @see org.w3c.dom.Element
+ */
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.helpers.AttributesImpl;
+import org.ggf.ns.nmwg.base.v2_0.Element;
+import org.ggf.ns.nmwg.time.v2_0.Time;
+import org.xml.sax.helpers.NamespaceSupport;
+
+public class OwampAggregationDatum extends
org.ggf.ns.nmwg.tools.owamp.v2_0.Datum
+{
+
+ public static final String FILENAME =
"org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java";
+
+ /**
+ * attribute for Sender
+ */
+ protected String sender;
+
+ /**
+ * attribute for receiver
+ */
+ protected String receiver;
+
+ /**
+ * attribute for sent
+ */
+ protected String sent;
+
+ /**
+ * attribute for loss
+ */
+ protected String loss;
+
+ /**
+ * attribute for RECVTIME (Receive timestamp)
+ */
+ protected String duplicates;
+
+ /**
+ * attribute for Lost in percrent
+ */
+ protected String lostPercent;
+
+ /**
+ * attribute for minimum dealy
+ */
+ protected String minDelay;
+
+ /**
+ * attribute for medium delay
+ */
+ protected String medDelay;
+
+ protected String maxDelay;
+
+ protected String delayUnits;
+
+ protected String error;
+
+ protected String errorUnits;
+
+ protected String jitter;
+
+ protected String jitterUnits;
+
+ protected String hops;
+
+ public String getSender()
+ {
+ return sender;
+ }
+
+ public void setSender(String sender)
+ {
+ this.sender = sender;
+ }
+
+ public String getReceiver()
+ {
+ return receiver;
+ }
+
+ public void setReceiver(String receiver)
+ {
+ this.receiver = receiver;
+ }
+
+ public String getSent()
+ {
+ return sent;
+ }
+
+ public void setSent(String sent)
+ {
+ this.sent = sent;
+ }
+
+ public String getLoss()
+ {
+ return loss;
+ }
+
+ public void setLoss(String loss)
+ {
+ this.loss = loss;
+ }
+
+ public String getDuplicates()
+ {
+ return duplicates;
+ }
+
+ public void setDuplicates(String duplicates)
+ {
+ this.duplicates = duplicates;
+ }
+
+ public String getLostPercent()
+ {
+ return lostPercent;
+ }
+
+ public void setLostPercent(String lostPercent)
+ {
+ this.lostPercent = lostPercent;
+ }
+
+ public String getMinDelay()
+ {
+ return minDelay;
+ }
+
+ public void setMinDelay(String minDelay)
+ {
+ this.minDelay = minDelay;
+ }
+
+ public String getMedDelay()
+ {
+ return medDelay;
+ }
+
+ public void setMedDelay(String medDelay)
+ {
+ this.medDelay = medDelay;
+ }
+
+ public String getMaxDelay()
+ {
+ return maxDelay;
+ }
+
+ public void setMaxDelay(String maxDelay)
+ {
+ this.maxDelay = maxDelay;
+ }
+
+ public String getDelayUnits()
+ {
+ return delayUnits;
+ }
+
+ public void setDelayUnits(String delayUnits)
+ {
+ this.delayUnits = delayUnits;
+ }
+
+ public String getError()
+ {
+ return error;
+ }
+
+ public void setError(String error)
+ {
+ this.error = error;
+ }
+
+ public String getErrorUnits()
+ {
+ return errorUnits;
+ }
+
+ public void setErrorUnits(String errorUnits)
+ {
+ this.errorUnits = errorUnits;
+ }
+
+ public String getJitter()
+ {
+ return jitter;
+ }
+
+ public void setJitter(String jitter)
+ {
+ this.jitter = jitter;
+ }
+
+ public String getJitterUnits()
+ {
+ return jitterUnits;
+ }
+
+ public void setJitterUnits(String jitterUnits)
+ {
+ this.jitterUnits = jitterUnits;
+ }
+
+ public String getHops()
+ {
+ return hops;
+ }
+
+ public void setHops(String hops)
+ {
+ this.hops = hops;
+ }
+
+ /**
+ * The constructor initializes the variables and sets xml element
+ * information (when applicable).
+ */
+ public OwampAggregationDatum()
+ {
+ sender = "";
+ receiver = "";
+ sent = "";
+ loss = "";
+ duplicates = "";
+ lostPercent = "";
+ minDelay = "";
+ medDelay = "";
+
+ parent = null;
+ id = "";
+ completed = false;
+
+ localName = "datum";
+ uri = "http://ggf.org/ns/nmwg/tools/owamp/2.0/";;
+ qName = "owamp:datum";
+ prefix = "owamp";
+ fileName =
"org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java";
+ }
+
+ @Override
+ public boolean addAttr(String attr, String value, NamespaceSupport nss)
+ {
+
+
+ if (attr.equals("value")) {
+ setValue(value);
+ }
+ //OWAMP SUMMARY DATUM PARAMETERS
+ else if (attr.equals("valueUnits")) {
+ setValueUnits(value);
+ } else if (attr.equals("numBytes")) {
+ setNumBytes(value);
+ } else if (attr.equals("numBytesUnits")) {
+ setNumBytesUnits(value);
+ } else if (attr.equals("sender")) {
+ setSender(value);
+ } else if (attr.equals("receiver")) {
+ setReceiver(value);
+ } else if (attr.equals("sent")) {
+ setSent(value);
+ } else if (attr.equals("loss")) {
+ setLoss(value);
+ } else if (attr.equals("lostPercent")) {
+ setLostPercent(value);
+ } else if (attr.equals("duplicates")) {
+ setDuplicates(value);
+ } else if (attr.equals("minDelay")) {
+ setMinDelay(value);
+ } else if (attr.equals("medDelay")) {
+ setMedDelay(value);
+ } else if (attr.equals("maxDelay")) {
+ setMaxDelay(value);
+ } else if (attr.equals("delayUnits")) {
+ setDelayUnits(value);
+ } else if (attr.equals("error")) {
+ setError(value);
+ } else if (attr.equals("errorUnits")) {
+ setErrorUnits(value);
+ } else if (attr.equals("jitter")) {
+ setJitter(value);
+ } else if (attr.equals("jitterUnits")) {
+ setJitterUnits(value);
+ } else if (attr.equals("hops")) {
+ setHops(value);
+ }
+ //OWAMP DATUM PARAMETERS
+ else if (attr.equals("seqNum")) {
+ setSeqNum(value);
+ } else if (attr.equals("sendTime")) {
+ setSendTime(value);
+ } else if (attr.equals("sendSynchronized")) {
+ setSendSynchronized(value);
+ } else if (attr.equals("sendTimeError")) {
+ setSendTimeError(value);
+ } else if (attr.equals("receiveTime")) {
+ setReceiveTime(value);
+ } else if (attr.equals("receiveSynchronized")) {
+ setReceiveSynchronized(value);
+ } else if (attr.equals("receiveTimeError")) {
+ setReceiveTimeError(value);
+ } else if (attr.equals("ttl")) {
+ setTTL(value);
+ } else if (attr.contains("xmlns")) {
+ if (attr.split(":").length == 1) {
+ if (nss.getURI("") == null) {
+ nss.declarePrefix("", value);
+ }
+ if ((prefix.isEmpty()) && !(value.equals(uri))) {
+ uri = value;
+ }
+ } else {
+ if (nss.getURI(attr.split(":")[1]) == null) {
+ nss.declarePrefix(attr.split(":")[1], value);
+ }
+ if ((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
+ uri = value;
+ }
+ }
+ } else {
+ System.err
+ .println("Error: "
+ + getFileName()
+ + " addAttr(String, String, NamespaceSupport)
unrecognized attribute pair: "
+ + attr + " - " + value);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The only allowable child for a datum element is the time.
+ */
+ @Override
+ public boolean addChild(Element newChild)
+ {
+ if (newChild.getLocalName().equals("time")) {
+ setTime((Time) newChild);
+ } else {
+ System.err.println("Error: " + getFileName()
+ + " addChild(Element) unrecognized child: " + newChild);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Converts the contents of this object into an xml tag.
+ */
+ @Override
+ 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()) {
+ nss.popContext();
+ unSetCompleted();
+ }
+ } catch (Exception e) {
+ System.err
+ .println("Error: "
+ + getFileName()
+ + " toXML(ContentHandler, NamespaceSupport) XML
formulation error.");
+ }
+ return handler;
+ }
+
+ /**
+ * Converts items into attributes for an xml tag.
+ */
+ @Override
+ public AttributesImpl getAttributes(NamespaceSupport nss)
+ {
+ AttributesImpl atts = new AttributesImpl();
+
+ //SUMMARY DAT
+ if (!(getValue().isEmpty())) {
+ atts.addAttribute(getUri(), "value", "value", "CDATA",
getValue());
+ }
+ if (!(getValueUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "valueUnits", "valueUnits", "CDATA",
+ getValueUnits());
+ }
+ if (!(getNumBytes().isEmpty())) {
+ atts.addAttribute(getUri(), "numBytes", "numBytes", "CDATA",
+ getNumBytes());
+ }
+ if (!(getNumBytesUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "numBytesUnits", "numBytesUnits",
+ "CDATA", getNumBytesUnits());
+ }
+ if (!(getTimeType().isEmpty())) {
+ atts.addAttribute(getUri(), "timeType", "timeType", "CDATA",
+ getTimeType());
+ }
+ if (!(getTimeValue().isEmpty())) {
+ atts.addAttribute(getUri(), "timeValue", "timeValue", "CDATA",
+ getTimeValue());
+ }
+ /* Add Specific Attributes from here */
+ if (!(getSender().isEmpty())) {
+ atts.addAttribute(getUri(), "sender", "sender", "CDATA",
+ getSender());
+ }
+ if (!(getReceiver().isEmpty())) {
+ atts.addAttribute(getUri(), "receiver", "receiver", "CDATA",
+ getReceiver());
+ }
+ if (!(getSent().isEmpty())) {
+ atts.addAttribute(getUri(), "sent", "sent",
+ "CDATA", getSent());
+ }
+ if (!(getLoss().isEmpty())) {
+ atts.addAttribute(getUri(), "loss", "loss",
+ "CDATA", getLoss());
+ }
+ if (!(getLostPercent().isEmpty())) {
+ atts.addAttribute(getUri(), "lostPercent", "lostPercent",
"CDATA",
+ getLostPercent());
+ }
+ if (!(getDuplicates().isEmpty())) {
+ atts.addAttribute(getUri(), "duplicates",
+ "duplicates", "CDATA", getDuplicates());
+ }
+ if (!(getMinDelay().isEmpty())) {
+ atts.addAttribute(getUri(), "minDelay", "minDelay",
+ "CDATA", getMinDelay());
+ }
+ if (!(getMedDelay().isEmpty())) {
+ atts.addAttribute(getUri(), "medDelay", "medDelay", "CDATA",
getMedDelay());
+ }
+ if (!(getMaxDelay().isEmpty())) {
+ atts.addAttribute(getUri(), "maxDelay", "maxDelay", "CDATA",
getMaxDelay());
+ }
+ if (!(getDelayUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "delayUnits", "delayUnits", "CDATA",
getDelayUnits());
+ }
+ if (!(getError().isEmpty())) {
+ atts.addAttribute(getUri(), "error", "error", "CDATA",
getError());
+ }
+ if (!(getErrorUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "errorUnits", "errorUnits", "CDATA",
getErrorUnits());
+ }
+ if (!(getJitter().isEmpty())) {
+ atts.addAttribute(getUri(), "jitter", "jitter", "CDATA",
getJitter());
+ }
+ if (!(getJitterUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "jitterUnits", "jitterUnits",
"CDATA", getJitterUnits());
+ }
+ if (!(getHops().isEmpty())) {
+ atts.addAttribute(getUri(), "hops", "hops", "CDATA", getHops());
+ }
+
+ //REGULAR DATUM
+ if (!(getValue().isEmpty())) {
+ atts.addAttribute(getUri(), "value", "value", "CDATA",
getValue());
+ }
+ if (!(getValueUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "valueUnits", "valueUnits", "CDATA",
getValueUnits());
+ }
+ if (!(getNumBytes().isEmpty())) {
+ atts.addAttribute(getUri(), "numBytes", "numBytes", "CDATA",
getNumBytes());
+ }
+ if (!(getNumBytesUnits().isEmpty())) {
+ atts.addAttribute(getUri(), "numBytesUnits", "numBytesUnits",
"CDATA", getNumBytesUnits());
+ }
+ if (!(getTimeType().isEmpty())) {
+ atts.addAttribute(getUri(), "timeType", "timeType", "CDATA",
getTimeType());
+ }
+ if (!(getTimeValue().isEmpty())) {
+ atts.addAttribute(getUri(), "timeValue", "timeValue", "CDATA",
getTimeValue());
+ }
+ if (!(getSeqNum().isEmpty())) {
+ atts.addAttribute(getUri(), "seqNum", "seqNum", "CDATA",
getSeqNum());
+ }
+ if (!(getSendTime().isEmpty())) {
+ atts.addAttribute(getUri(), "sendTime", "sendTime", "CDATA",
getSendTime());
+ }
+ if (!(getSendSynchronized().isEmpty())) {
+ atts.addAttribute(getUri(), "sendSynchronized",
"sendSynchronized", "CDATA", getSendSynchronized());
+ }
+ if (!(getSendTimeError().isEmpty())) {
+ atts.addAttribute(getUri(), "sendTimeError", "sendTimeError",
"CDATA", getSendTimeError());
+ }
+ if (!(getReceiveTime().isEmpty())) {
+ atts.addAttribute(getUri(), "receiveTime", "receiveTime",
"CDATA", getReceiveTime());
+ }
+ if (!(getReceiveSynchronized().isEmpty())) {
+ atts.addAttribute(getUri(), "receiveSynchronized",
"receiveSynchronized", "CDATA", getReceiveSynchronized());
+ }
+ if (!(getReceiveTimeError().isEmpty())) {
+ atts.addAttribute(getUri(), "receiveTimeError",
"receiveTimeError", "CDATA", getReceiveTimeError());
+ }
+ if (!(getTTL().isEmpty())) {
+ atts.addAttribute(getUri(), "ttl", "ttl", "CDATA", getTTL());
+ }
+
+
+ if (nss.getURI(getPrefix()) == null) {
+ nss.pushContext();
+ if (getPrefix().isEmpty()) {
+ atts.addAttribute(getUri(), "xmlns", "xmlns", "CDATA",
getUri());
+ } else {
+ atts.addAttribute(getUri(), "xmlns:" + getPrefix(), "xmlns:"
+ + getPrefix(), "CDATA", getUri());
+ }
+ nss.declarePrefix(getPrefix(), getUri());
+ setCompleted();
+ }
+
+ return atts;
+ }
+
+ /**
+ * Chases children references down to print out all related xml tags.
+ */
+ @Override
+ public ContentHandler getChildren(ContentHandler handler,
+ NamespaceSupport nss) throws Exception
+ {
+ if (getTime() != null) {
+ handler = getTime().toXML(handler, nss);
+ }
+ return handler;
+ }
+
+ /**
+ * Given a DOM element (a parent), construct the children elements.
+ */
+ @Override
+ public void getDOM(org.w3c.dom.Element parent)
+ {
+ org.w3c.dom.Document doc = parent.getOwnerDocument();
+ org.w3c.dom.Element datum = doc.createElementNS(getUri(),
getQName());
+ parent.appendChild(datum);
+ if (!(getValue().isEmpty())) {
+ datum.setAttribute("value", getValue());
+ }
+ if (!(getValueUnits().isEmpty())) {
+ datum.setAttribute("valueUnits", getValueUnits());
+ }
+ if (!(getTimeType().isEmpty())) {
+ datum.setAttribute("timeType", getTimeType());
+ }
+ if (!(getTimeValue().isEmpty())) {
+ datum.setAttribute("timeValue", getTimeValue());
+ }
+ if (!(getNumBytes().isEmpty())) {
+ datum.setAttribute("numBytes", getNumBytes());
+ }
+ if (!(getNumBytesUnits().isEmpty())) {
+ datum.setAttribute("numBytesUnits", getNumBytesUnits());
+ }
+ /* Add Specific Attributes from here */
+ if (!(getSent().isEmpty())) {
+ datum.setAttribute("sent", getSent());
+ }
+ if (!(getReceiver().isEmpty())) {
+ datum.setAttribute("receiver", getReceiver());
+ }
+ if (!(getSender().isEmpty())) {
+ datum.setAttribute("sender", getSender());
+ }
+ if (!(getLoss().isEmpty())) {
+ datum.setAttribute("loss", getLoss());
+ }
+ if (!(getLostPercent().isEmpty())) {
+ datum.setAttribute("lostPercent", getLostPercent());
+ }
+ if (!(getDuplicates().isEmpty())) {
+ datum.setAttribute("duplicates", getDuplicates());
+ }
+ if (!(getMinDelay().isEmpty())) {
+ datum.setAttribute("minDelay", getMinDelay());
+ }
+ if (!(getMedDelay().isEmpty())) {
+ datum.setAttribute("medDelay", getMedDelay());
+ }
+ if (!(getMaxDelay().isEmpty())) {
+ datum.setAttribute("maxDelay", getMaxDelay());
+ }
+ if (!(getDelayUnits().isEmpty())) {
+ datum.setAttribute("delayUnits", getDelayUnits());
+ }
+ if (!(getError().isEmpty())) {
+ datum.setAttribute("error", getError());
+ }
+ if (!(getErrorUnits().isEmpty())) {
+ datum.setAttribute("errorUnits", getErrorUnits());
+ }
+ if (!(getJitter().isEmpty())) {
+ datum.setAttribute("jitter", getJitter());
+ }
+ if (!(getJitterUnits().isEmpty())) {
+ datum.setAttribute("jitterUnits", getJitterUnits());
+ }
+ if (!(getHops().isEmpty())) {
+ datum.setAttribute("hops", getHops());
+ }
+
+ if (getTime() != null) {
+ getTime().getDOM(datum);
+ }
+
+
+ //REGULAR DATUM
+ if (!(getSeqNum().isEmpty())) {
+ datum.setAttribute("seqNum", getSeqNum());
+ }
+ if (!(getSendTime().isEmpty())) {
+ datum.setAttribute("sendTime", getSendTime());
+ }
+ if (!(getSendSynchronized().isEmpty())) {
+ datum.setAttribute("sendSynchronized", getSendSynchronized());
+ }
+ if (!(getSendTimeError().isEmpty())) {
+ datum.setAttribute("sendTimeError", getSendTimeError());
+ }
+ if (!(getReceiveTime().isEmpty())) {
+ datum.setAttribute("receiveTime", getReceiveTime());
+ }
+ if (!(getReceiveSynchronized().isEmpty())) {
+ datum.setAttribute("receiveSynchronized",
getReceiveSynchronized());
+ }
+ if (!(getReceiveTimeError().isEmpty())) {
+ datum.setAttribute("receiveTimeError", getReceiveTimeError());
+ }
+ if (!(getTTL().isEmpty())) {
+ datum.setAttribute("ttl", getTTL());
+ }
+
+ if (getTime() != null) {
+ getTime().getDOM(datum);
+ }
+
+ }
+
+
+ @Override
+ public String toString()
+ {
+ return getFileName() + ": ---> " + getValue() + " sender=" + sender
+ ", receiver="
+ + receiver + ", sent=" + sent + ", loss=" + loss
+ + ", duplicates=" + duplicates + ", lostPercent=" + lostPercent
+ + ", minDelay=" + minDelay + ", medDelay=" + medDelay
+ + ", maxDelay=" + maxDelay + ", delayUnits=" + delayUnits
+ + ", error=" + error + ", errorUnits=" + errorUnits
+ + ", jitter=" + jitter + ", jitterUnits=" + jitterUnits
+ + ", hops=" + hops;
+ }
+}

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/BwctlStoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/BwctlStoreRequestProcess.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/BwctlStoreRequestProcess.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,101 +1,101 @@
-/**
- * $Id$
- * Project: perfSONAR
- */
-package org.perfsonar.service.measurementArchive.sqlType.store;
-
-
-import java.util.Map;
-
-import org.ggf.ns.nmwg.base.v2_0.Element;
-import org.ggf.ns.nmwg.tools.bwctl.v2_0.Datum;
-import org.perfsonar.base.exceptions.PerfSONARException;
-
-/**
- * Moves data from nmwg data element into ibatis map structure
- *
- * @author fernandes
- */
-public class BwctlStoreRequestProcess extends StoreRequestProcess
-{
-
-
- // -------------------------------------- constructors
-
-
- public BwctlStoreRequestProcess() throws PerfSONARException
- {
-
- super();
-
- }
-
-
- // -------------------------------------- public methods
-
-
- @Override
- public Map<String,Object> prepareStoreParameters(Element datum,
Map<String,Object> ibatisParams)
- {
-
-
- String intervalEnd = ((Datum) datum).getIntervalEnd();
- String intervalStart = ((Datum) datum).getIntervalStart();
- String intervalUnit = ((Datum) datum).getIntervalUnit();
- String numBytes = ((Datum) datum).getNumBytes();
- String numBytesUnits = ((Datum) datum).getNumBytesUnits();
- String tcpAdapterType = ((Datum) datum).getTcpAdapterType();
- String tcpMSSSize = ((Datum) datum).getTcpMSSSize();
- String timeType = ((Datum) datum).getTimeType();
- String timeValue = ((Datum) datum).getTimeValue();
- String value = ((Datum) datum).getValue();
- String valueUnits = ((Datum) datum).getValueUnits();
- String tcpMSSUnit = ((Datum) datum).getTcpMSSUnit();
- String tcpMTUSize = ((Datum) datum).getTcpMTUSize();
- String tcpMTUUnit = ((Datum) datum).getTcpMTUUnit();
- String tcpWindowSize = ((Datum) datum).getTcpWindowSize();
- String tcpWindowUnit = ((Datum) datum).getTcpWindowUnit();
- String udpBufferSize = ((Datum) datum).getUdpBufferSize();
- String udpBufferUnit = ((Datum) datum).getUdpBufferUnit();
- String udpJitter = ((Datum) datum).getUdpJitter();
- String udpJitterUnit = ((Datum) datum).getUdpJitterUnit();
- String udpPacketLoss = ((Datum) datum).getUdpPacketLoss();
- String udpPacketLossPercentage = ((Datum)
datum).getUdpPacketLossPercentage();
- String udpPacketSent = ((Datum) datum).getUdpPacketSent();
-
- try {
-
- ibatisParams.put("intervalEnd", intervalEnd);
- ibatisParams.put("intervalStart", intervalStart);
- ibatisParams.put("intervalUnit", intervalUnit);
- ibatisParams.put("numBytes", numBytes);
- ibatisParams.put("numBytesUnits", numBytesUnits);
- ibatisParams.put("tcpAdapterType", tcpAdapterType);
- ibatisParams.put("tcpMSSSize", tcpMSSSize);
- ibatisParams.put("timeType", timeType);
- ibatisParams.put("timeValue", Long.parseLong(timeValue));
- ibatisParams.put("value", Long.parseLong(value));
- ibatisParams.put("valueUnits", valueUnits);
- ibatisParams.put("tcpMSSUnit", tcpMSSUnit);
- ibatisParams.put("tcpMTUSize", tcpMTUSize);
- ibatisParams.put("tcpMTUUnit", tcpMTUUnit);
- ibatisParams.put("tcpWindowSize", tcpWindowSize);
- ibatisParams.put("tcpWindowUnit", tcpWindowUnit);
- ibatisParams.put("udpBufferSize", udpBufferSize);
- ibatisParams.put("udpBufferUnit", udpBufferUnit);
- ibatisParams.put("udpJitter", udpJitter);
- ibatisParams.put("udpJitterUnit", udpJitterUnit);
- ibatisParams.put("udpPacketLoss", udpPacketLoss);
- ibatisParams.put("udpPacketLossPercentage",
udpPacketLossPercentage);
- ibatisParams.put("udpPacketSent", udpPacketSent);
-
- } catch (Exception ex) {
- logger.debug("BwctlStoreRequestProcess.process: " +
ex.toString());
- }
-
- return ibatisParams;
-
- }
-
-
-} //BwctlStoreRequestProcess
+/**
+ * $Id$
+ * Project: perfSONAR
+ */
+package org.perfsonar.service.measurementArchive.sqlType.store;
+
+
+import java.util.Map;
+
+import org.ggf.ns.nmwg.base.v2_0.Element;
+import org.ggf.ns.nmwg.tools.bwctl.v2_0.Datum;
+import org.perfsonar.base.exceptions.PerfSONARException;
+
+/**
+ * Moves data from nmwg data element into ibatis map structure
+ *
+ * @author fernandes
+ */
+public class BwctlStoreRequestProcess extends StoreRequestProcess
+{
+
+
+ // -------------------------------------- constructors
+
+
+ public BwctlStoreRequestProcess() throws PerfSONARException
+ {
+
+ super();
+
+ }
+
+
+ // -------------------------------------- public methods
+
+
+ @Override
+ public Map<String,Object> prepareStoreParameters(Element datum,
Map<String,Object> ibatisParams)
+ {
+
+
+ String intervalEnd = ((Datum) datum).getIntervalEnd();
+ String intervalStart = ((Datum) datum).getIntervalStart();
+ String intervalUnit = ((Datum) datum).getIntervalUnit();
+ String numBytes = ((Datum) datum).getNumBytes();
+ String numBytesUnits = ((Datum) datum).getNumBytesUnits();
+ String tcpAdapterType = ((Datum) datum).getTcpAdapterType();
+ String tcpMSSSize = ((Datum) datum).getTcpMSSSize();
+ String timeType = ((Datum) datum).getTimeType();
+ String timeValue = ((Datum) datum).getTimeValue();
+ String value = ((Datum) datum).getValue();
+ String valueUnits = ((Datum) datum).getValueUnits();
+ String tcpMSSUnit = ((Datum) datum).getTcpMSSUnit();
+ String tcpMTUSize = ((Datum) datum).getTcpMTUSize();
+ String tcpMTUUnit = ((Datum) datum).getTcpMTUUnit();
+ String tcpWindowSize = ((Datum) datum).getTcpWindowSize();
+ String tcpWindowUnit = ((Datum) datum).getTcpWindowUnit();
+ String udpBufferSize = ((Datum) datum).getUdpBufferSize();
+ String udpBufferUnit = ((Datum) datum).getUdpBufferUnit();
+ String udpJitter = ((Datum) datum).getUdpJitter();
+ String udpJitterUnit = ((Datum) datum).getUdpJitterUnit();
+ String udpPacketLoss = ((Datum) datum).getUdpPacketLoss();
+ String udpPacketLossPercentage = ((Datum)
datum).getUdpPacketLossPercentage();
+ String udpPacketSent = ((Datum) datum).getUdpPacketSent();
+
+ try {
+
+ ibatisParams.put("intervalEnd", intervalEnd);
+ ibatisParams.put("intervalStart", intervalStart);
+ ibatisParams.put("intervalUnit", intervalUnit);
+ ibatisParams.put("numBytes", numBytes);
+ ibatisParams.put("numBytesUnits", numBytesUnits);
+ ibatisParams.put("tcpAdapterType", tcpAdapterType);
+ ibatisParams.put("tcpMSSSize", tcpMSSSize);
+ ibatisParams.put("timeType", timeType);
+ ibatisParams.put("timeValue", Long.parseLong(timeValue));
+ ibatisParams.put("value", Long.parseLong(value));
+ ibatisParams.put("valueUnits", valueUnits);
+ ibatisParams.put("tcpMSSUnit", tcpMSSUnit);
+ ibatisParams.put("tcpMTUSize", tcpMTUSize);
+ ibatisParams.put("tcpMTUUnit", tcpMTUUnit);
+ ibatisParams.put("tcpWindowSize", tcpWindowSize);
+ ibatisParams.put("tcpWindowUnit", tcpWindowUnit);
+ ibatisParams.put("udpBufferSize", udpBufferSize);
+ ibatisParams.put("udpBufferUnit", udpBufferUnit);
+ ibatisParams.put("udpJitter", udpJitter);
+ ibatisParams.put("udpJitterUnit", udpJitterUnit);
+ ibatisParams.put("udpPacketLoss", udpPacketLoss);
+ ibatisParams.put("udpPacketLossPercentage",
udpPacketLossPercentage);
+ ibatisParams.put("udpPacketSent", udpPacketSent);
+
+ } catch (Exception ex) {
+ logger.debug("BwctlStoreRequestProcess.process: " +
ex.toString());
+ }
+
+ return ibatisParams;
+
+ }
+
+
+} //BwctlStoreRequestProcess

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/PingStoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/PingStoreRequestProcess.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/PingStoreRequestProcess.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,72 +1,72 @@
-/**
- * $Id$
- * Project: perfSONAR
- */
-package org.perfsonar.service.measurementArchive.sqlType.store;
-
-
-import java.util.Map;
-
-import org.ggf.ns.nmwg.base.v2_0.Element;
-import org.ggf.ns.nmwg.tools.ping.v2_0.Datum;
-import org.perfsonar.base.exceptions.PerfSONARException;
-
-/**
- * Moves data from nmwg data element into ibatis map structure
- *
- * @author fernandes
- */
-public class PingStoreRequestProcess extends StoreRequestProcess
-{
-
-
- // -------------------------------------- constructors
-
-
- public PingStoreRequestProcess() throws PerfSONARException
- {
-
- super();
-
- }
-
-
- // -------------------------------------- public methods
-
-
- @Override
- public Map<String,Object> prepareStoreParameters(Element datum,
Map<String,Object> ibatisParams)
- {
-
-
- String seqNum = ((Datum) datum).getSeqNum();
- String numBytes = ((Datum) datum).getNumBytes();
- String numBytesUnits = ((Datum) datum).getNumBytesUnits();
- String value = ((Datum) datum).getValue();
- String valueUnits = ((Datum) datum).getValueUnits();
- String ttl = ((Datum) datum).getTTL();
- String timeType = ((Datum) datum).getTimeType();
- String timeValue = ((Datum) datum).getTimeValue();
-
- try {
-
- ibatisParams.put("numBytes", Integer.parseInt(numBytes));
- ibatisParams.put("numBytesUnits", numBytesUnits);
- ibatisParams.put("value", Float.parseFloat(value));
- ibatisParams.put("valueUnits", valueUnits);
- ibatisParams.put("seqNum", Integer.parseInt(seqNum));
- ibatisParams.put("timeType", timeType);
- ibatisParams.put("timeValue", Long.parseLong(timeValue));
- ibatisParams.put("ttl", Integer.parseInt(ttl));
-
- // or a float
- } catch (Exception ex) {
- logger.debug("SQLStorageManager.store: " + ex.toString());
- }
-
- return ibatisParams;
-
- }
-
-
-} //PingRequestProcess
+/**
+ * $Id$
+ * Project: perfSONAR
+ */
+package org.perfsonar.service.measurementArchive.sqlType.store;
+
+
+import java.util.Map;
+
+import org.ggf.ns.nmwg.base.v2_0.Element;
+import org.ggf.ns.nmwg.tools.ping.v2_0.Datum;
+import org.perfsonar.base.exceptions.PerfSONARException;
+
+/**
+ * Moves data from nmwg data element into ibatis map structure
+ *
+ * @author fernandes
+ */
+public class PingStoreRequestProcess extends StoreRequestProcess
+{
+
+
+ // -------------------------------------- constructors
+
+
+ public PingStoreRequestProcess() throws PerfSONARException
+ {
+
+ super();
+
+ }
+
+
+ // -------------------------------------- public methods
+
+
+ @Override
+ public Map<String,Object> prepareStoreParameters(Element datum,
Map<String,Object> ibatisParams)
+ {
+
+
+ String seqNum = ((Datum) datum).getSeqNum();
+ String numBytes = ((Datum) datum).getNumBytes();
+ String numBytesUnits = ((Datum) datum).getNumBytesUnits();
+ String value = ((Datum) datum).getValue();
+ String valueUnits = ((Datum) datum).getValueUnits();
+ String ttl = ((Datum) datum).getTTL();
+ String timeType = ((Datum) datum).getTimeType();
+ String timeValue = ((Datum) datum).getTimeValue();
+
+ try {
+
+ ibatisParams.put("numBytes", Integer.parseInt(numBytes));
+ ibatisParams.put("numBytesUnits", numBytesUnits);
+ ibatisParams.put("value", Float.parseFloat(value));
+ ibatisParams.put("valueUnits", valueUnits);
+ ibatisParams.put("seqNum", Integer.parseInt(seqNum));
+ ibatisParams.put("timeType", timeType);
+ ibatisParams.put("timeValue", Long.parseLong(timeValue));
+ ibatisParams.put("ttl", Integer.parseInt(ttl));
+
+ // or a float
+ } catch (Exception ex) {
+ logger.debug("SQLStorageManager.store: " + ex.toString());
+ }
+
+ return ibatisParams;
+
+ }
+
+
+} //PingRequestProcess

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,186 +1,186 @@
-package
org.perfsonar.service.measurementArchive.metadataConfig.queryGenerator;
-
-
-import java.util.HashMap;
-import java.util.Set;
-
-import org.ggf.ns.nmwg.base.v2_0.Message;
-import org.ggf.ns.nmwg.base.v2_0.Metadata;
-import org.ggf.ns.nmwg.base.v2_0.Parameters;
-import org.ggf.ns.nmwg.tools.bwctl.v2_0.Subject;
-import org.ggf.ns.nmwg.topology.v2_0.EndPointPair;
-import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
-import org.perfsonar.base.auxiliary.ComponentNames;
-import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
-import org.perfsonar.base.exceptions.PerfSONARException;
-
-
-/**
- * Transforms nmwg message into xquery/xpath
- * (query to fetch metadata with bwctl data)
- *
- * @author fernandes
- */
-
-public class BwctlQueryGenerator implements MetadataQueryGenerator
-{
-
-
- // -------------------------------------- class fields
-
-
- protected LoggerComponent logger = null;
-
- private final String[] parameters = {"interval", "length", "windowSize",
"unsynchronized",
- "dynamicWindowSize", "concurrentConnections", "bandwidth",
- "duration", "tos", "protocol", "role"};
-
- // -------------------------------------- constructors
-
-
- public BwctlQueryGenerator() throws PerfSONARException
- {
-
- try {
-
- this.logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
- } catch (PerfSONARException e) {
-
- throw new PerfSONARException(
- "error.common.no_logger",
- "BwctlQueryGenerator.constructor: "
- + "Cannot get logger component");
-
- }
-
- }
-
-
- // -------------------------------------- public methods
-
-
- /**
- * Returns xpath query created using the information
- * stored in Message object.
- */
- @Override
- public String getMetadataQuery(Message query)
- throws PerfSONARException
- {
-
-
- if (query == null) {
- throw new PerfSONARException(
- "error.ma.query",
- "BwctlQueryGenerator.getMetadataQuery: "
- + "Input message is null");
- }
-
-
- String src = "";
- String dst = "";
- String eventType = "";
-
- Metadata metadata;
- try {
- Metadata[] metadataArray = (query.getMetadataArray());
- metadata = metadataArray[0];
- } catch (Exception ex) {
- logger.error(
- "BwctlQueryGenerator.getMetadataQuery: "
- + "Unable to get metadata from the message");
- throw new PerfSONARException(
- "error.ma.query",
- "BwctlQueryGenerator.getMetadataQuery: "
- + "Unable to get metadata from the message; "
- + ex.toString());
- }
-
- HashMap<String, String> parametersMap = new HashMap<String,
String>();
- if (metadata != null) {
-
- eventType = (metadata.getEventType() != null ?
metadata.getEventType().getEventType().trim() : "");
- Subject subject = (Subject) metadata.getSubject();
- EndPointPair end = subject.getEndPointPair();
-
- Parameters params = metadata.getParameters();
- for (String parameter : parameters) {
- if (params.getParameterByName(parameter) != null) {
- parametersMap.put(parameter,
-
(params.getParameterByName(parameter).getParameterValue() != null ?
-
params.getParameterByName(parameter).getParameterValue().trim() : ""));
- }
- }
-
- if (end != null) {
- src = (end.getSourceElement() != null ?
end.getSourceElement().getValue().trim() : "");
- dst = (end.getDestinationElement() != null ?
end.getDestinationElement().getValue().trim() : "");
- }
-
- }
-
- String xQuery = "\n"
- + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; "
- + "declare namespace
bwctl='http://ggf.org/ns/nmwg/tools/bwctl/2.0/'; "
- + "declare namespace
nmwgt='http://ggf.org/ns/nmwg/topology/2.0/'; \n\n";
-
- xQuery +=
- " let $res :=
\n"
- + " for $i in //nmwg:metadata \n"
- + " where 1
\n";
-
- if (!eventType.isEmpty()) {
- xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
- }
-
- if (!src.isEmpty()) {
- xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
- }
-
- if (!dst.isEmpty()) {
- xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
- }
-
- Set<String> keySet = parametersMap.keySet();
- for (String key : keySet) {
- String v = parametersMap.get(key);
- if (!v.isEmpty()) {
- xQuery += "and $i/bwctl:parameters/nmwg:parameter[(text()='"
+ v + "' and @name='" + key + "') "
- + "or (@value='" + v + "' and @name='" + key + "')]";
- }
- }
-
- xQuery += "\n"
- + " return $i
\n"
- + "
\n"
- + " let $metaids :=
\n"
- + " for $j in $res
\n"
- + " return fn:data($j/@id)
\n"
- + "
\n"
- + " let $datas :=
\n"
- + " for $k in $metaids
\n"
- + " let $d :=
\n"
- + " for $l in //nmwg:data \n"
- + " where $l/@metadataIdRef = $k \n"
- + " return $l
\n"
- + " return $d
\n"
- + "
\n"
- + " return ($res, $datas)
\n";
-
-
- //logger.debug(
- // "BwctlQueryGenerator.getMetadataQuery: "
- // + "meta query: "
- // + xQuery);
-
-
- return xQuery;
-
-
- }
-
-
-} //BwctlQueryGenerator
+package
org.perfsonar.service.measurementArchive.metadataConfig.queryGenerator;
+
+
+import java.util.HashMap;
+import java.util.Set;
+
+import org.ggf.ns.nmwg.base.v2_0.Message;
+import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.base.v2_0.Parameters;
+import org.ggf.ns.nmwg.tools.bwctl.v2_0.Subject;
+import org.ggf.ns.nmwg.topology.v2_0.EndPointPair;
+import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
+import org.perfsonar.base.auxiliary.ComponentNames;
+import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
+import org.perfsonar.base.exceptions.PerfSONARException;
+
+
+/**
+ * Transforms nmwg message into xquery/xpath
+ * (query to fetch metadata with bwctl data)
+ *
+ * @author fernandes
+ */
+
+public class BwctlQueryGenerator implements MetadataQueryGenerator
+{
+
+
+ // -------------------------------------- class fields
+
+
+ protected LoggerComponent logger = null;
+
+ private final String[] parameters = {"interval", "length", "windowSize",
"unsynchronized",
+ "dynamicWindowSize", "concurrentConnections", "bandwidth",
+ "duration", "tos", "protocol", "role"};
+
+ // -------------------------------------- constructors
+
+
+ public BwctlQueryGenerator() throws PerfSONARException
+ {
+
+ try {
+
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (PerfSONARException e) {
+
+ throw new PerfSONARException(
+ "error.common.no_logger",
+ "BwctlQueryGenerator.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ }
+
+
+ // -------------------------------------- public methods
+
+
+ /**
+ * Returns xpath query created using the information
+ * stored in Message object.
+ */
+ @Override
+ public String getMetadataQuery(Message query)
+ throws PerfSONARException
+ {
+
+
+ if (query == null) {
+ throw new PerfSONARException(
+ "error.ma.query",
+ "BwctlQueryGenerator.getMetadataQuery: "
+ + "Input message is null");
+ }
+
+
+ String src = "";
+ String dst = "";
+ String eventType = "";
+
+ Metadata metadata;
+ try {
+ Metadata[] metadataArray = (query.getMetadataArray());
+ metadata = metadataArray[0];
+ } catch (Exception ex) {
+ logger.error(
+ "BwctlQueryGenerator.getMetadataQuery: "
+ + "Unable to get metadata from the message");
+ throw new PerfSONARException(
+ "error.ma.query",
+ "BwctlQueryGenerator.getMetadataQuery: "
+ + "Unable to get metadata from the message; "
+ + ex.toString());
+ }
+
+ HashMap<String, String> parametersMap = new HashMap<String,
String>();
+ if (metadata != null) {
+
+ eventType = (metadata.getEventType() != null ?
metadata.getEventType().getEventType().trim() : "");
+ Subject subject = (Subject) metadata.getSubject();
+ EndPointPair end = subject.getEndPointPair();
+
+ Parameters params = metadata.getParameters();
+ for (String parameter : parameters) {
+ if (params.getParameterByName(parameter) != null) {
+ parametersMap.put(parameter,
+
(params.getParameterByName(parameter).getParameterValue() != null ?
+
params.getParameterByName(parameter).getParameterValue().trim() : ""));
+ }
+ }
+
+ if (end != null) {
+ src = (end.getSourceElement() != null ?
end.getSourceElement().getValue().trim() : "");
+ dst = (end.getDestinationElement() != null ?
end.getDestinationElement().getValue().trim() : "");
+ }
+
+ }
+
+ String xQuery = "\n"
+ + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; "
+ + "declare namespace
bwctl='http://ggf.org/ns/nmwg/tools/bwctl/2.0/'; "
+ + "declare namespace
nmwgt='http://ggf.org/ns/nmwg/topology/2.0/'; \n\n";
+
+ xQuery +=
+ " let $res :=
\n"
+ + " for $i in //nmwg:metadata \n"
+ + " where 1
\n";
+
+ if (!eventType.isEmpty()) {
+ xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
+ }
+
+ if (!src.isEmpty()) {
+ xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
+ }
+
+ if (!dst.isEmpty()) {
+ xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
+ }
+
+ Set<String> keySet = parametersMap.keySet();
+ for (String key : keySet) {
+ String v = parametersMap.get(key);
+ if (!v.isEmpty()) {
+ xQuery += "and $i/bwctl:parameters/nmwg:parameter[(text()='"
+ v + "' and @name='" + key + "') "
+ + "or (@value='" + v + "' and @name='" + key + "')]";
+ }
+ }
+
+ xQuery += "\n"
+ + " return $i
\n"
+ + "
\n"
+ + " let $metaids :=
\n"
+ + " for $j in $res
\n"
+ + " return fn:data($j/@id)
\n"
+ + "
\n"
+ + " let $datas :=
\n"
+ + " for $k in $metaids
\n"
+ + " let $d :=
\n"
+ + " for $l in //nmwg:data \n"
+ + " where $l/@metadataIdRef = $k \n"
+ + " return $l
\n"
+ + " return $d
\n"
+ + "
\n"
+ + " return ($res, $datas)
\n";
+
+
+ //logger.debug(
+ // "BwctlQueryGenerator.getMetadataQuery: "
+ // + "meta query: "
+ // + xQuery);
+
+
+ return xQuery;
+
+
+ }
+
+
+} //BwctlQueryGenerator

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
2012-10-05 09:22:51 UTC (rev 6014)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
2012-10-05 09:22:52 UTC (rev 6015)
@@ -1,182 +1,182 @@
-package
org.perfsonar.service.measurementArchive.metadataConfig.queryGenerator;
-
-
-import java.util.HashMap;
-import java.util.Set;
-
-import org.ggf.ns.nmwg.base.v2_0.Message;
-import org.ggf.ns.nmwg.base.v2_0.Metadata;
-import org.ggf.ns.nmwg.base.v2_0.Parameters;
-import org.ggf.ns.nmwg.tools.ping.v2_0.Subject;
-import org.ggf.ns.nmwg.topology.v2_0.EndPointPair;
-import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
-import org.perfsonar.base.auxiliary.ComponentNames;
-import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
-import org.perfsonar.base.exceptions.PerfSONARException;
-
-
-/**
- * Transforms nmwg message into xquery/xpath
- * (query to fetch metadata with owamp data)
- *
- * @author fernandes
- */
-
-public class PingQueryGenerator implements MetadataQueryGenerator
-{
-
-
- // -------------------------------------- class fields
-
-
- protected LoggerComponent logger = null;
-
- private final String[] parameters = {"count", "interval", "deadline",
"packetSize", "ttl"};
-
-
- // -------------------------------------- constructors
-
-
- public PingQueryGenerator() throws PerfSONARException
- {
-
- try {
-
- this.logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
- } catch (PerfSONARException e) {
-
- throw new PerfSONARException(
- "error.common.no_logger",
- "OwampQueryGenerator.constructor: "
- + "Cannot get logger component");
-
- }
-
- }
-
-
- // -------------------------------------- public methods
-
-
- /**
- * Returns xpath query created using the information
- * stored in Message object.
- */
- @Override
- public String getMetadataQuery(Message query)
- throws PerfSONARException
- {
-
-
- if (query == null) {
- throw new PerfSONARException(
- "error.ma.query",
- "PingQueryGenerator.getMetadataQuery: "
- + "Input message is null");
- }
-
- String src = "";
- String dst = "";
- String eventType = "";
-
- Metadata metadata;
- try {
- Metadata[] metadataArray = (query.getMetadataArray());
- metadata = metadataArray[0];
- } catch (Exception ex) {
- logger.error(
- "PingQueryGenerator.getMetadataQuery: "
- + "Unable to get metadata from the message");
- throw new PerfSONARException(
- "error.ma.query",
- "PingQueryGenerator.getMetadataQuery: "
- + "Unable to get metadata from the message; "
- + ex.toString());
- }
-
- HashMap<String, String> parametersMap = new HashMap<String,
String>();
- if (metadata != null) {
-
- eventType = (metadata.getEventType() != null ?
metadata.getEventType().getEventType().trim() : "");
-
- Subject subject = (Subject) metadata.getSubject();
- EndPointPair end = subject.getEndPointPair();
-
- Parameters params = metadata.getParameters();
-
- if (params != null) {
- for (String parameter : parameters) {
- if (params.getParameterByName(parameter) != null)
- parametersMap.put(parameter,
-
(params.getParameterByName(parameter).getParameterValue() != null ?
-
params.getParameterByName(parameter).getParameterValue().trim() : ""));
- }
- }
-
- if (end != null) {
- src = (end.getSourceElement() != null ?
end.getSourceElement().getValue().trim() : "");
- dst = (end.getDestinationElement() != null ?
end.getDestinationElement().getValue().trim() : "");
- }
-
- }
-
- String xQuery = "\n"
- + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; "
- + "declare namespace
ping='http://ggf.org/ns/nmwg/tools/ping/2.0/'; "
- + "declare namespace
nmwgt='http://ggf.org/ns/nmwg/topology/2.0/'; \n\n";
-
- xQuery +=
- " let $res :=
\n"
- + " for $i in //nmwg:metadata \n"
- + " where 1
\n";
-
-
- if (!eventType.isEmpty()) {
- xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
- }
-
- if (!src.isEmpty()) {
- xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
- }
-
- if (!dst.isEmpty()) {
- xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
- }
-
- Set<String> keySet = parametersMap.keySet();
- for (String key : keySet) {
- String v = parametersMap.get(key);
- if (!v.isEmpty()) {
- xQuery += "and $i/ping:parameters/nmwg:parameter[(text()='"
+ v + "' and @name='" + key + "') "
- + "or (@value='" + v + "' and @name='" + key + "')]";
- }
- }
-
- xQuery += "\n"
- + " return $i
\n"
- + "
\n"
- + " let $metaids :=
\n"
- + " for $j in $res
\n"
- + " return fn:data($j/@id)
\n"
- + "
\n"
- + " let $datas :=
\n"
- + " for $k in $metaids
\n"
- + " let $d :=
\n"
- + " for $l in //nmwg:data \n"
- + " where $l/@metadataIdRef = $k \n"
- + " return $l
\n"
- + " return $d
\n"
- + "
\n"
- + " return ($res, $datas)
\n";
-
-
- return xQuery;
-
-
- }
-
-
-} //PingQueryGenerator
+package
org.perfsonar.service.measurementArchive.metadataConfig.queryGenerator;
+
+
+import java.util.HashMap;
+import java.util.Set;
+
+import org.ggf.ns.nmwg.base.v2_0.Message;
+import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.base.v2_0.Parameters;
+import org.ggf.ns.nmwg.tools.ping.v2_0.Subject;
+import org.ggf.ns.nmwg.topology.v2_0.EndPointPair;
+import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
+import org.perfsonar.base.auxiliary.ComponentNames;
+import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
+import org.perfsonar.base.exceptions.PerfSONARException;
+
+
+/**
+ * Transforms nmwg message into xquery/xpath
+ * (query to fetch metadata with owamp data)
+ *
+ * @author fernandes
+ */
+
+public class PingQueryGenerator implements MetadataQueryGenerator
+{
+
+
+ // -------------------------------------- class fields
+
+
+ protected LoggerComponent logger = null;
+
+ private final String[] parameters = {"count", "interval", "deadline",
"packetSize", "ttl"};
+
+
+ // -------------------------------------- constructors
+
+
+ public PingQueryGenerator() throws PerfSONARException
+ {
+
+ try {
+
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (PerfSONARException e) {
+
+ throw new PerfSONARException(
+ "error.common.no_logger",
+ "OwampQueryGenerator.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ }
+
+
+ // -------------------------------------- public methods
+
+
+ /**
+ * Returns xpath query created using the information
+ * stored in Message object.
+ */
+ @Override
+ public String getMetadataQuery(Message query)
+ throws PerfSONARException
+ {
+
+
+ if (query == null) {
+ throw new PerfSONARException(
+ "error.ma.query",
+ "PingQueryGenerator.getMetadataQuery: "
+ + "Input message is null");
+ }
+
+ String src = "";
+ String dst = "";
+ String eventType = "";
+
+ Metadata metadata;
+ try {
+ Metadata[] metadataArray = (query.getMetadataArray());
+ metadata = metadataArray[0];
+ } catch (Exception ex) {
+ logger.error(
+ "PingQueryGenerator.getMetadataQuery: "
+ + "Unable to get metadata from the message");
+ throw new PerfSONARException(
+ "error.ma.query",
+ "PingQueryGenerator.getMetadataQuery: "
+ + "Unable to get metadata from the message; "
+ + ex.toString());
+ }
+
+ HashMap<String, String> parametersMap = new HashMap<String,
String>();
+ if (metadata != null) {
+
+ eventType = (metadata.getEventType() != null ?
metadata.getEventType().getEventType().trim() : "");
+
+ Subject subject = (Subject) metadata.getSubject();
+ EndPointPair end = subject.getEndPointPair();
+
+ Parameters params = metadata.getParameters();
+
+ if (params != null) {
+ for (String parameter : parameters) {
+ if (params.getParameterByName(parameter) != null)
+ parametersMap.put(parameter,
+
(params.getParameterByName(parameter).getParameterValue() != null ?
+
params.getParameterByName(parameter).getParameterValue().trim() : ""));
+ }
+ }
+
+ if (end != null) {
+ src = (end.getSourceElement() != null ?
end.getSourceElement().getValue().trim() : "");
+ dst = (end.getDestinationElement() != null ?
end.getDestinationElement().getValue().trim() : "");
+ }
+
+ }
+
+ String xQuery = "\n"
+ + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; "
+ + "declare namespace
ping='http://ggf.org/ns/nmwg/tools/ping/2.0/'; "
+ + "declare namespace
nmwgt='http://ggf.org/ns/nmwg/topology/2.0/'; \n\n";
+
+ xQuery +=
+ " let $res :=
\n"
+ + " for $i in //nmwg:metadata \n"
+ + " where 1
\n";
+
+
+ if (!eventType.isEmpty()) {
+ xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
+ }
+
+ if (!src.isEmpty()) {
+ xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
+ }
+
+ if (!dst.isEmpty()) {
+ xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
+ }
+
+ Set<String> keySet = parametersMap.keySet();
+ for (String key : keySet) {
+ String v = parametersMap.get(key);
+ if (!v.isEmpty()) {
+ xQuery += "and $i/ping:parameters/nmwg:parameter[(text()='"
+ v + "' and @name='" + key + "') "
+ + "or (@value='" + v + "' and @name='" + key + "')]";
+ }
+ }
+
+ xQuery += "\n"
+ + " return $i
\n"
+ + "
\n"
+ + " let $metaids :=
\n"
+ + " for $j in $res
\n"
+ + " return fn:data($j/@id)
\n"
+ + "
\n"
+ + " let $datas :=
\n"
+ + " for $k in $metaids
\n"
+ + " let $d :=
\n"
+ + " for $l in //nmwg:data \n"
+ + " where $l/@metadataIdRef = $k \n"
+ + " return $l
\n"
+ + " return $d
\n"
+ + "
\n"
+ + " return ($res, $datas)
\n";
+
+
+ return xQuery;
+
+
+ }
+
+
+} //PingQueryGenerator



  • [pS-dev] [GEANT/SA2/ps-java-services] r6015 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType/fetch perfsonar-jav a-sql-ma/src/main/java/org/perfsonar/service/measurementAr chive/sqlType/nmwg perfsonar-java-sql-ma/src/main/java/org /perfsonar/service/measurementArchive/sqlType/store perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/queryGenerator, svn-noreply, 10/05/2012

Archive powered by MHonArc 2.6.16.

Top of Page