Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2702 - branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType

Subject: perfsonar development work

List archive

perfsonar: r2702 - branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2702 - branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType
  • Date: Wed, 22 Aug 2007 08:30:54 -0400

Author: roman
Date: 2007-08-22 08:30:53 -0400 (Wed, 22 Aug 2007)
New Revision: 2702

Modified:

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
Log:

exception handling improved



Modified:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
===================================================================
---
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
2007-08-22 10:43:49 UTC (rev 2701)
+++
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
2007-08-22 12:30:53 UTC (rev 2702)
@@ -319,6 +319,12 @@
Metadata md = (Metadata) it.next();
Key key = md.getKey();

+ if (key.getParameters() == null) {
+ throw new PerfSONARException (
+ "error.ma.query",
+ "RRDStorageManager.rrdFetch: key element does not
contain parameters element");
+ }
+
//select parameter elements
Parameter startTime =
key.getParameterByName("http://ggf.org/ns/nmwg/ops/select/2.0/";, "startTime");
Parameter endTime =
key.getParameterByName("http://ggf.org/ns/nmwg/ops/select/2.0/";, "endTime");

Modified:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2007-08-22 10:43:49 UTC (rev 2701)
+++
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2007-08-22 12:30:53 UTC (rev 2702)
@@ -426,26 +426,45 @@
for (Object d : msg.getDataMap().values())
message.addChild((Data)d);

- } else if
(metadata.getEventType().getEventType().trim().equals(SELECT_NAMESPACE)) {
+ } else {

- Parameters params = metadata.getParameters();
- String metadataIdRef =
metadata.getSubject().getMetadataIdRef();
- Metadata m = (Metadata) metadataMap.get(metadataIdRef);
+ String eventType = null;
+ try {
+ eventType = metadata.getEventType().getEventType().trim();
+ } catch (Exception ex) {
+ throw new PerfSONARException(
+ "error.ma.query",
+ "RRDTypeMAServiceEngine._getKey: "
+ + "something wrong with eventType in metadata
id=" + metadata.getId());
+ }

- _getKey(m, null, metadataMap, message, metadataConfig);
+ if
(metadata.getEventType().getEventType().trim().equals(SELECT_NAMESPACE)) {
+ Parameters params = metadata.getParameters();
+ String metadataIdRef =
metadata.getSubject().getMetadataIdRef();
+ Metadata m = (Metadata) metadataMap.get(metadataIdRef);

- for (Object d : message.getDataMap().values()) {
+ _getKey(m, null, metadataMap, message, metadataConfig);

- Key key = null;
- if ((key = ((Data)d).getKey()) != null) {
+ for (Object d : message.getDataMap().values()) {

- key = ((Data)d).getKey();
- key.setParameters(params);
+ Key key = null;
+ if ((key = ((Data)d).getKey()) != null) {
+ key = ((Data)d).getKey();
+ key.setParameters(params);
+ }

}

- }
+ } else {

+ throw new PerfSONARException(
+ "error.ma.query",
+ "RRDTypeMAServiceEngine._getKey: "
+ + "eventType " + eventType + " in metadata id="
+ metadata.getId()
+ + " is not supported");
+
+ }
+
}

} else {
@@ -497,6 +516,14 @@
for (Object d : msg.getDataMap().values())
message.addChild((Data)d);

+ } else if (key == null) {
+
+ throw new PerfSONARException(
+ "error.ma.query",
+ "RRDTypeMAServiceEngine._getKey: "
+ + "no eventType or key element in metadata id="
+ + metadata.getId());
+
}

}



  • perfsonar: r2702 - branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType, svnlog, 08/22/2007

Archive powered by MHonArc 2.6.16.

Top of Page