perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5864 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType/store
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r5864 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType/store
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5864 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType/store
- Date: Wed, 5 Oct 2011 18:39:59 +0100 (BST)
Author: psnc.pikusa
Date: 2011-10-05 18:39:59 +0100 (Wed, 05 Oct 2011)
New Revision: 5864
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
Log:
changes
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
2011-10-05 17:35:42 UTC (rev 5863)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
2011-10-05 17:39:59 UTC (rev 5864)
@@ -4,73 +4,151 @@
*/
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.owamp.v2_0.Datum;
import org.perfsonar.base.exceptions.PerfSONARException;
+import
org.perfsonar.service.measurementArchive.sqlType.nmwg.OwampAggregationDatum;
/**
- * Moves data from nmwg data element into ibatis map structure
- *
- * @author fernandes
+ * Moves data from nmwg data element into ibatis map structure
+ *
+ * @author fernandes
*/
public class OwampStoreRequestProcess extends StoreRequestProcess {
+ // -------------------------------------- constructors
+ public OwampStoreRequestProcess() throws PerfSONARException {
- // -------------------------------------- constructors
+ super();
+ }
+ /**
+ * For test purposes only.
+ *
+ * @param test
+ */
+ public OwampStoreRequestProcess(String test) {
- public OwampStoreRequestProcess() throws PerfSONARException {
+ super(test);
- super();
+ }
- }
+ // -------------------------------------- public methods
+ public Map<String, Object> prepareStoreParameters(Element datum,
+ Map<String, Object> ibatisParams) {
+ String seqNum = ((OwampAggregationDatum) datum).getSeqNum();
+ System.out.println("DatumgetSeqNum: "+
((OwampAggregationDatum) datum).getSeqNum() + "wow");
+ String sendTime = ((OwampAggregationDatum)
datum).getSendTime();
+ String sendSynchronized = ((OwampAggregationDatum)
datum).getSendSynchronized();
+ String sendTimeError = ((OwampAggregationDatum)
datum).getSendTimeError();
+ String receiveTime = ((OwampAggregationDatum)
datum).getReceiveTime();
+ String receiveSynchronized = ((OwampAggregationDatum)
datum).getReceiveSynchronized();
+ String receiveTimeError = ((OwampAggregationDatum)
datum).getReceiveTimeError();
+ String ttl = ((OwampAggregationDatum) datum).getTTL();
- // -------------------------------------- public methods
+ // String timeType = ((Datum)datum).getTimeType();
+ // String timeValue = ((Datum)datum).getTimeValue();
+ boolean datumType = false; // default false mans it is Datum
from OWAMP Aggregation Datum
+ try {
+ // NMWG DATUM
+ if (receiveSynchronized != null
+ &&
!receiveSynchronized.trim().equals("")) {
+ ibatisParams.put("receiveSynchronized",
Integer
+
.parseInt(receiveSynchronized));
+ datumType = true;
+ }
- public Map prepareStoreParameters(Element datum, Map ibatisParams) {
+ if (receiveTime != null &&
!receiveTime.trim().equals("")) {
+ ibatisParams.put("receiveTime", receiveTime);
+ datumType = true;
+ }
+ if (receiveTimeError != null &&
!receiveTimeError.trim().equals("")) {
+ ibatisParams.put("receiveTimeError", Float
+
.parseFloat(receiveTimeError));
+ datumType = true;
+ }
+ if (sendSynchronized != null &&
!sendSynchronized.trim().equals("")) {
+ ibatisParams.put("sendSynchronized", Integer
+ .parseInt(sendSynchronized));
+ datumType = true;
+ }
+ if (sendTime != null && !sendTime.trim().equals("")) {
+ ibatisParams.put("sendTime", sendTime);
+ datumType = true;
+ }
+ if (sendTimeError != null &&
!sendTimeError.trim().equals("")){
+ ibatisParams.put("sendTimeError", Float
+ .parseFloat(sendTimeError));
+ datumType = true;
+ }
+ if (seqNum != null && !seqNum.trim().equals("")){
+ ibatisParams.put("seqNum",
Integer.parseInt(seqNum));
+ datumType = true;
+ }
+ // ibatisParams.put("timeType", timeType);
+ // ibatisParams.put("timeValue",
Long.parseLong(timeValue));
+ if (ttl != null && !ttl.trim().equals("")){
+ ibatisParams.put("ttl",
Integer.parseInt(ttl));
+ datumType = true;
+ }
+ System.out.println("DATUM TYPE! " + datumType);
+
+ if(datumType != true){
+ System.out.println("I AM HERE!");
+ // OWAMP AGGREGATION DATUM
+ ibatisParams.put("sender",
((OwampAggregationDatum) datum)
+ .getSender());
+ ibatisParams.put("receiver",
((OwampAggregationDatum) datum)
+ .getReceiver());
+ ibatisParams.put("sent", Integer
+
.parseInt(((OwampAggregationDatum) datum).getSent()));
+ ibatisParams.put("loss", Integer
+
.parseInt(((OwampAggregationDatum) datum).getLoss()));
+ ibatisParams.put("lostPercent", Float
+
.parseFloat(((OwampAggregationDatum) datum)
+
.getLostPercent()));
+ ibatisParams.put("duplicates", Integer
+
.parseInt(((OwampAggregationDatum) datum).getDuplicates()));
+ ibatisParams.put("minDelay", Float
+
.parseFloat(((OwampAggregationDatum) datum).getMinDelay()));
+ ibatisParams.put("medDelay", Float
+
.parseFloat(((OwampAggregationDatum) datum).getMedDelay()));
+ ibatisParams.put("maxDelay", Float
+
.parseFloat(((OwampAggregationDatum) datum).getMaxDelay()));
+ ibatisParams.put("delayUnits",
((OwampAggregationDatum) datum)
+ .getDelayUnits());
+ ibatisParams.put("error", Float
+
.parseFloat(((OwampAggregationDatum) datum).getError()));
+ ibatisParams.put("errorUnits",
((OwampAggregationDatum) datum)
+ .getErrorUnits());
+ ibatisParams.put("jitter", Float
+
.parseFloat(((OwampAggregationDatum) datum).getJitter()));
+ ibatisParams.put("jitterUnits",
((OwampAggregationDatum) datum)
+ .getJitterUnits());
+ ibatisParams.put("hops", Integer
+
.parseInt(((OwampAggregationDatum) datum).getHops()));
- String seqNum = ((Datum)datum).getSeqNum();
- String sendTime = ((Datum)datum).getSendTime();
- String sendSynchronized = ((Datum)datum).getSendSynchronized();
- String sendTimeError = ((Datum)datum).getSendTimeError();
- String receiveTime = ((Datum)datum).getReceiveTime();
- String receiveSynchronized = ((Datum)datum).getReceiveSynchronized();
- String receiveTimeError = ((Datum)datum).getReceiveTimeError();
- String ttl = ((Datum)datum).getTTL();
- String timeType = ((Datum)datum).getTimeType();
- String timeValue = ((Datum)datum).getTimeValue();
+ }
+
+ } catch (Exception ex) {
+ // logger.debug("OwampStoreRequestProcess.process: " +
+ // ex.toString());
+ System.out.println("EERRRRRRRRRORRRRRRRR!!!!!!!!11");
+ ex.printStackTrace();
- try{
+ }
- ibatisParams.put("receiveSynchronized",
Integer.parseInt(receiveSynchronized));
- ibatisParams.put("receiveTime", receiveTime);
- ibatisParams.put("receiveTimeError",
Float.parseFloat(receiveTimeError));
- ibatisParams.put("sendSynchronized",
Integer.parseInt(sendSynchronized));
- ibatisParams.put("sendTime", sendTime);
- ibatisParams.put("sendTimeError",
Float.parseFloat(sendTimeError));
- ibatisParams.put("seqNum", Integer.parseInt(seqNum));
- ibatisParams.put("timeType", timeType);
- ibatisParams.put("timeValue", Long.parseLong(timeValue));
- ibatisParams.put("ttl", Integer.parseInt(ttl));
+ return ibatisParams;
- } catch (Exception ex) {
- logger.debug("OwampStoreRequestProcess.process: " +
ex.toString());
- }
+ }
- return ibatisParams;
-
- }
-
-
-
-} //OwampStoreRequestProcess
+} // OwampStoreRequestProcess
- [pS-dev] [GEANT/SA2/ps-java-services] r5864 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType/store, svn-noreply, 10/05/2011
Archive powered by MHonArc 2.6.16.