perfsonar-dev - r1507 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType
Subject: perfsonar development work
List archive
r1507 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType
Chronological Thread
- From:
- To:
- Subject: r1507 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType
- Date: Wed, 2 Aug 2006 10:03:39 -0400
Author: uros
Date: 2006-08-02 10:03:38 -0400 (Wed, 02 Aug 2006)
New Revision: 1507
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
Log:
Fixed success response massage by adding success result code to it.
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
2006-08-02 09:36:44 UTC (rev 1506)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/TCMPTypeMeasurementExecutor.java
2006-08-02 14:03:38 UTC (rev 1507)
@@ -39,8 +39,6 @@
import org.ggf.ns.nmwg.base.v2_0.Parameters;
import org.ggf.ns.nmwg.base.v2_0.Element;
import org.ggf.ns.nmwg.base.v2_0.CommonTime;
-import org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Subject;
-import org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum;
import org.ggf.ns.nmwg.topology.v2_0.Interface;
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.ggf.ns.nmwg.topology.v2_0.EndPointPair;
@@ -206,16 +204,28 @@
}
// Construct a generic OK response, with URL to resulted data,
- // and timestamp when measurement is completed
+ // and timestamp when measurement is completed.
+ // Also add success.mp.tcmp metadata,data pair
+ // (currently only one success message is generated by TCMP,
+ // later differentiation between different kind of successes might
+ // be added)
+ Metadata firstMetadata = null;
for (Iterator<Metadata> it = request.getMetadataIterator();
- it.hasNext(); )
- response.addChild(it.next());
+ it.hasNext(); ) {
+ Metadata md = it.next();
+ if (firstMetadata == null) firstMetadata = md;
+ response.addChild(md);
+ }
+ Data firstData = null;
for (Iterator<Data> it = request.getDataIterator();
it.hasNext(); ) {
Data d = it.next();
+ if (firstData == null) firstData = d;
// Just replace the original datums with URLs
CommonTime ct = d.getCommonTime();
- Datum datum = (Datum)ct.getDatum(0);
+ org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum datum =
+ (org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum)ct
+ .getDatum(0);
try {
datum.setFilename("http://"
+ InetAddress.getLocalHost().getCanonicalHostName()
@@ -223,7 +233,9 @@
+ datum.getFilename());
} catch (UnknownHostException e) { }
if (ct.getDatum(1) != null) {
- datum = (Datum)ct.getDatum(1);
+ datum =
+ (org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum)ct
+ .getDatum(1);
try {
datum.setFilename("http://"
+ InetAddress.getLocalHost().getCanonicalHostName()
@@ -234,6 +246,17 @@
response.addChild(d);
}
+ // Add successfull response elements to firstMetadata and firstData
+ // elements
+ EventType mdEventType = new EventType();
+ firstMetadata.setEventType(mdEventType);
+ org.ggf.ns.nmwg.base.v2_0.Datum dDatum =
+ new org.ggf.ns.nmwg.base.v2_0.Datum();
+ firstData.setDatum(dDatum);
+ mdEventType.setEventType("success.mp.tcmp");
+ dDatum.setDatum("Successfully initiated " + this.threadCount
+ + " capture(s).");
+
logger.info(type + ": Returning a response");
return response;
@@ -489,7 +512,9 @@
// Retrieve subject from metadata and verify it.
// Pupulate TCMPTypeMeasurementRequest object at the same time.
- Subject subject = (Subject)metadata.getSubject();
+ org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Subject subject =
+ (org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Subject)metadata
+ .getSubject();
if (subject == null) {
@@ -1006,7 +1031,8 @@
}
- Vector<Datum> datumVec = ct.getDatum();
+ Vector<org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum> datumVec =
+ ct.getDatum();
// datumVec must hold at least one element
if (datumVec == null || datumVec.size() < 1) {
@@ -1016,7 +1042,8 @@
type + ".validateTCMPRequest: commonTime must contain at
least one datum child.");
}
- Datum firstDatum = datumVec.get(0);
+ org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum firstDatum =
+ datumVec.get(0);
// Verify existance of filename in firstDatum
if (firstDatum == null ||
firstDatum.getFilename() == null ||
"".equals(firstDatum.getFilename())) {
@@ -1052,7 +1079,8 @@
type + ".validateTCMPRequest: commonTime must
contain two datum childs.");
}
- Datum secondDatum = datumVec.get(1);
+ org.ggf.ns.nmwg.tools.passivetracefile.v2_0.Datum secondDatum =
+ datumVec.get(1);
// Verify existance of filename in secondDatum
if (secondDatum == null ||
secondDatum.getFilename() == null ||
"".equals(secondDatum.getFilename())) {
- r1507 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType, svnlog, 08/02/2006
Archive powered by MHonArc 2.6.16.