perfsonar-dev - perfsonar: r4365 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive: eventTypeConfig metadataConfig/keyGenerator
Subject: perfsonar development work
List archive
perfsonar: r4365 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive: eventTypeConfig metadataConfig/keyGenerator
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4365 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive: eventTypeConfig metadataConfig/keyGenerator
- Date: Wed, 20 Aug 2008 10:39:01 -0400
Author: roman
Date: 2008-08-20 10:39:01 -0400 (Wed, 20 Aug 2008)
New Revision: 4365
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventType.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventTypeConfiguration.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
Log:
new ibatisConfig parameter added
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventType.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventType.java
2008-08-20 14:36:41 UTC (rev 4364)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventType.java
2008-08-20 14:39:01 UTC (rev 4365)
@@ -26,8 +26,10 @@
private String responseGenerator = null;
private String storeRequestProcess = null;
private String baseChainingMerger = null;
+ private String ibatisConfig = null;
+
// -------------------------------------- constructors
@@ -98,5 +100,15 @@
}
+ public String getIbatisConfig() {
+ return ibatisConfig;
+ }
+
+ public void setIbatisConfig(String ibatisConfig) {
+ this.ibatisConfig = ibatisConfig;
+ }
+
+
+
} //EventType
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventTypeConfiguration.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventTypeConfiguration.java
2008-08-20 14:36:41 UTC (rev 4364)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/eventTypeConfig/EventTypeConfiguration.java
2008-08-20 14:39:01 UTC (rev 4365)
@@ -17,7 +17,7 @@
* @author romradz
*/
public class EventTypeConfiguration {
-
+
// -------------------------------------- class fields
private Map<String,EventType> eventTypeMap = null;
@@ -39,7 +39,7 @@
}
public Map<String,EventType> getEventTypeMap() {
- return eventTypeMap;
+ return eventTypeMap;
}
} //EventTypeConfiguration
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
2008-08-20 14:36:41 UTC (rev 4364)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
2008-08-20 14:39:01 UTC (rev 4365)
@@ -16,10 +16,13 @@
import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
+import
org.perfsonar.service.measurementArchive.eventTypeConfig.EventTypeConfigurationComponent;
+
public class L2PathStatusKeyGenerator implements MetadataKeyGenerator {
+
public Key getKey(Metadata metadata, Data data) throws
PerfSONARException {
if (metadata.getSubject() != null &&
@@ -45,12 +48,14 @@
ibatisConfig = new Parameter();
ibatisConfig.setParameterName("ibatisConfig");
ibatisConfig.setParameterValue(ibatisServiceConfigParameter);
- } else {
- return null;
}
}
+ if (ibatisConfig == null)
+ ibatisConfig =
getIbatisConfig(metadata.getEventType().getEventType());
+ if (ibatisConfig == null)
+ return null;
Key key = new Key();
key.addParameter("pathId", pathId);
@@ -75,5 +80,37 @@
}
+ public static Parameter getIbatisConfig(String eventTypeStr)
+ throws PerfSONARException {
+ EventTypeConfigurationComponent eventTypeConfigurationComponent =
+ (EventTypeConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent("eventType_config");
+
+ org.perfsonar.service.measurementArchive.eventTypeConfig.EventType
eventType =
+ eventTypeConfigurationComponent.getEventType(eventTypeStr);
+
+ if (eventType == null)
+ throw new PerfSONARException(
+ "error.ma.query",
+ "SQLTypeMAServiceEngine.getStoreKey: "
+ + "eventType " + eventTypeStr + " is not supported");
+
+
+ String ibatisConfigStr = eventType.getIbatisConfig();
+
+ if (ibatisConfigStr == null || ibatisConfigStr.trim().equals(""))
+ return null;
+
+ Parameter ibatisConfig = new Parameter();
+ ibatisConfig.setParameterName("ibatisConfig");
+ ibatisConfig.setParameterValue(ibatisConfigStr);
+
+ return ibatisConfig;
+ }
+
+
+
} //L2PathStatusKeyGenerator
\ No newline at end of file
- perfsonar: r4365 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive: eventTypeConfig metadataConfig/keyGenerator, svnlog, 08/20/2008
Archive powered by MHonArc 2.6.16.