Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2252 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch

Subject: perfsonar development work

List archive

perfsonar: r2252 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2252 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch
  • Date: Mon, 19 Mar 2007 08:34:05 -0400

Author: roman
Date: 2007-03-19 08:34:04 -0400 (Mon, 19 Mar 2007)
New Revision: 2252

Modified:

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
Log:

If there is no data in the database the response will have only one datum
element with 'UNKNOWN' values.

example:


<nmwg:data id="7f89" metadataIdRef="md-link-PSNC-2-DFN-MUE-004">
<ifevt:datum
xmlns:ifevt="http://ggf.org/ns/nmwg/event/status/base/2.0/";>
<ifevt:stateAdmin>UNKNOWN</ifevt:stateAdmin>
<ifevt:stateOper>UNKNOWN</ifevt:stateOper>
</ifevt:datum>
</nmwg:data>




Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
2007-03-19 12:01:39 UTC (rev 2251)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
2007-03-19 12:34:04 UTC (rev 2252)
@@ -50,6 +50,7 @@
Data data = new Data();


+ // if there is data in the database
for (int i = 0; i < resultList.size(); i++) {

Datum datum = new Datum();
@@ -113,6 +114,25 @@

}

+
+ // when there is no data in the database
+ if (resultList.size() == 0) {
+
+ Datum datum = new Datum();
+
+ StateOper stateOper = new StateOper();
+ stateOper.setStateOper("UNKNOWN");
+ datum.addChild(stateOper);
+
+ StateAdmin stateAdmin = new StateAdmin();
+ stateAdmin.setStateAdmin("UNKNOWN");
+ datum.addChild(stateAdmin);
+
+ data.addChild(datum);
+
+ }
+
+
return data;

}




Archive powered by MHonArc 2.6.16.

Top of Page