perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6008 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r6008 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6008 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType
- Date: Fri, 5 Oct 2012 10:22:39 +0100 (BST)
Author: nordunet.behrmann
Date: 2012-10-05 10:22:39 +0100 (Fri, 05 Oct 2012)
New Revision: 6008
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
Log:
perfsonar-java-sql-ma: Fix eventType lookup when storing meta data
When storing meta data, SQL MA only looked for an eventType <parameter>
tag, not the <eventType> tag. This lead to OWAMP data storage to fail.
This patch fixes that problem by always looking for an <eventType> tag.
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2012-10-05 09:22:37 UTC (rev 6007)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2012-10-05 09:22:39 UTC (rev 6008)
@@ -214,19 +214,24 @@
protected Key getStoreKey(Metadata metadata)
throws PerfSONARException {
+ EventType eventTypeObj = metadata.getEventType();
+ if (eventTypeObj == null)
+ throw new PerfSONARException("error.ma.query",
+ "SQLTypeMAServiceEngine.getStoreKey: "
+ + "No eventType in the request metadata");
+
+ String eventType = eventTypeObj.getEventType().trim();
+ if (eventType.isEmpty())
+ throw new PerfSONARException("error.ma.query",
+ "SQLTypeMAServiceEngine.getStoreKey: "
+ + "eventType in the request metadata is empty");
+
Key key = metadata.getKey();
if (key != null) {
// check parameters in the key
- Parameter eventType = key.getParameterByName("eventType");
- if (eventType == null)
- throw new PerfSONARException(
- "error.ma.query",
- "SQLTypeMAServiceEngine.getStoreKey: "
- + "No eventType parameter in the key");
-
Parameter ibatisConfig = key.getParameterByName("ibatisConfig");
if (ibatisConfig == null) {
ibatisConfig = getIbatisConfig(eventType);
@@ -242,19 +247,6 @@
} else {
// no key in the request
-
- EventType eventTypeObj = metadata.getEventType();
- if (eventTypeObj == null)
- throw new PerfSONARException("error.ma.query",
- "SQLTypeMAServiceEngine.getStoreKey: "
- + "No eventType in the request metadata");
-
- String eventType = eventTypeObj.getEventType().trim();
- if (eventType.isEmpty())
- throw new PerfSONARException("error.ma.query",
- "SQLTypeMAServiceEngine.getStoreKey: "
- + "eventType in the request metadata is empty");
-
Message query = new Message();
query.addChild(metadata);
Message resp;
@@ -319,8 +311,7 @@
params.addChild(ibatisConfig);
} else if (params.getParameterByName("ibatisConfig") ==
null) {
-
- ibatisConfig =
getIbatisConfig(params.getParameterByName("eventType"));
+ ibatisConfig = getIbatisConfig(eventType);
if (ibatisConfig != null) params.addChild(ibatisConfig);
}
@@ -391,12 +382,9 @@
}
- protected Parameter getIbatisConfig(Parameter eventTypeParameter)
- throws PerfSONARException {
-
- if (eventTypeParameter == null) return null;
- String eventTypeStr = eventTypeParameter.getParameterValue();
-
+ protected Parameter getIbatisConfig(String eventTypeStr)
+ throws PerfSONARException
+ {
EventTypeConfigurationComponent eventTypeConfigurationComponent =
(EventTypeConfigurationComponent)
AuxiliaryComponentManager.
- [pS-dev] [GEANT/SA2/ps-java-services] r6008 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType, svn-noreply, 10/05/2012
Archive powered by MHonArc 2.6.16.