Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2239 - in branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive: metadataConfig metadataConfig/queryGenerator rrdType sqlType

Subject: perfsonar development work

List archive

perfsonar: r2239 - in branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive: metadataConfig metadataConfig/queryGenerator rrdType sqlType


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2239 - in branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive: metadataConfig metadataConfig/queryGenerator rrdType sqlType
  • Date: Thu, 15 Mar 2007 09:53:56 -0400

Author: roman
Date: 2007-03-15 09:53:56 -0400 (Thu, 15 Mar 2007)
New Revision: 2239

Modified:

branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java

branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java

branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java

branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java

branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
Log:

merged with the trunk

svn merge -r 2235:2238
https://svn.perfsonar.net/svn/perfsonar/trunk/perfsonar




Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2007-03-15 13:42:50 UTC (rev 2238)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2007-03-15 13:53:56 UTC (rev 2239)
@@ -190,9 +190,9 @@
String[] tagNames = {"metadata", "data"};
Map elements =
transformations.transformResults(xmlResult, tagNames);
-
+
if (elements == null)
- throw new SystemException(
+ throw new SystemException(
"warning.ma.metadata_configuration",
"MetadataConfigurationStorageManager.fetch: "
+ "No metadata or data elements in the fetch result "
@@ -262,7 +262,7 @@
+ "</xu:modifications>";

logger.debug("RRDConfigurationStorageManagerdata.store: "
- + "XUpdate statement to store metadata element: \n"
+ + "XUpdate statement to store metadata element: \n"
+ metaXUpdate);



Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java
2007-03-15 13:42:50 UTC (rev 2238)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java
2007-03-15 13:53:56 UTC (rev 2239)
@@ -151,7 +151,7 @@

} catch (PerfSONARException pex) {

- throw new SystemException(pex.getResultCode(),
pex.getMessage());
+ throw new SystemException(pex.getResultCode(), pex.getMessage());

} catch (Exception ex) {

@@ -161,11 +161,11 @@
+ "from the request metadata. "
+ ex.toString());
throw new RequestException(
- "error.ma.query",
+ "error.ma.query",
"Unable to generate xquery statement "
+ "for the metadata configuration "
+ "from the request metadata. "
- + ex.toString());
+ + ex.toString());

}


Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-03-15 13:42:50 UTC (rev 2238)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-03-15 13:53:56 UTC (rev 2239)
@@ -77,14 +77,6 @@
//logger.debug("UtilizationQueryGenerator.getMetadataQuery: "
// + "start getMetadataQuery");

-
- if (query == null)
- throw new SystemException(
- "error.ma.query",
- "UtilizationQueryGenerator.getMetadataQuery: "
- + "Input message is null");
-
-
String eventType = "";
String ipAddress = "";
String hostName = "";

Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2007-03-15 13:42:50 UTC (rev 2238)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2007-03-15 13:53:56 UTC (rev 2239)
@@ -244,7 +244,7 @@

} else if (actionType.equals(ActionType.ECHO)) {

- response = getEcho(request);
+ response = getEcho(request);

} else {

@@ -278,17 +278,17 @@

public static String getSeq() {

- String strSeq = null;
- try {
- seq = seq + 1;
- strSeq = Long.toString(seq);
- } catch (Exception ex) {
- strSeq = "0";
- seq = 0;
- }
-
- return strSeq;
+ String strSeq = null;
+ try {
+ seq = seq + 1;
+ strSeq = Long.toString(seq);
+ } catch (Exception ex) {
+ strSeq = "0";
+ seq = 0;
+ }

+ return strSeq;
+
}


@@ -327,11 +327,11 @@

try {

- _getKey(metadata, null, metadataMap, message, metadataConfig);
+ _getKey(metadata, null, metadataMap, message,
metadataConfig);

} catch (NullPointerException npex) {

- throw new RequestException(
+ throw new RequestException(
"error.ma.query",
"RRDTypeMAServiceEngine.getKey: "
+ "getting the key is impossible "
@@ -602,11 +602,11 @@
Key key = null;
try {

- key = getStoreKey(meta);
+ key = getStoreKey(meta);

} catch (NullPointerException npex) {

- throw new RequestException(
+ throw new RequestException(
"error.ma.query",
"RRDTypeMAServiceEngine.storeData: "
+ "getting the store key is impossible "
@@ -825,18 +825,18 @@

protected Message getEcho(Message request) {

- Message response = new Message();
+ Message response = new Message();

- PerfSONARException pex =
- new PerfSONARException(
- "error.request",
- "This eventType in echo request is not
supported");
+ PerfSONARException pex =
+ new PerfSONARException(
+ "error.request",
+ "This eventType in echo request is not supported");

- // this method will be used for advanced types of echo request
+ // this method will be used for advanced types of echo request

- ResultCodesUtil.createResultCodeMetadata(response, pex);
+ ResultCodesUtil.createResultCodeMetadata(response, pex);

- return response;
+ return response;

}

@@ -852,13 +852,13 @@
try {
eventType = metadata.getEventType().getEventType();
} catch (Exception ex1) {
- ;
+ ;
}

for (Object d : msg.getDataMap().values()) {
Key key = ((Data)d).getKey();
if (key.getParameters().getParameterMap().get("eventType") ==
null)
- key.addParameter("eventType", eventType);
+ key.addParameter("eventType", eventType);
}

return eventType;

Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2007-03-15 13:42:50 UTC (rev 2238)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2007-03-15 13:53:56 UTC (rev 2239)
@@ -12,6 +12,7 @@

import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.base.v2_0.EventType;
import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Datum;
import org.ggf.ns.nmwg.base.v2_0.Key;
@@ -207,14 +208,14 @@
Parameter ibatisConfig = key.getParameterByName("ibatisConfig");
if (ibatisConfig == null)
throw new RequestException(
- "error.ma.sql.db_connection.ibatis",
+ "error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "No ibatisConfig parameter in the key");

Parameter eventType = key.getParameterByName("eventType");
if (eventType == null)
- throw new RequestException(
- "error.ma.sql.db_connection.ibatis",
+ throw new RequestException(
+ "error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "No eventType parameter in the key");

@@ -222,25 +223,31 @@

// no key in the request

- String eventType =
metadata.getEventType().getEventType().trim();
- if (eventType.equals(""))
- throw new
RequestException("error.ma.sql.db_connection.ibatis",
- "SQLTypeMAServiceEngine.getStoreKey: "
+ EventType eventTypeObj = metadata.getEventType();
+ if (eventTypeObj == null)
+ throw new RequestException("error.ma.query",
+ "SQLTypeMAServiceEngine.getStoreKey: "
+ "No eventType in the request metadata");
-
+
+ String eventType = eventTypeObj.getEventType().trim();
+ if (eventType.equals(""))
+ throw new RequestException("error.ma.query",
+ "SQLTypeMAServiceEngine.getStoreKey: "
+ + "eventType in the request metadata is empty");
+
Message query = new Message();
query.addChild(metadata);
Message resp = null;

try{
- resp = metadataConfig.fetch(query);
+ resp = metadataConfig.fetch(query);
} catch (SystemException sex) {
- if
(sex.getResultCode().equals("warning.ma.metadata_configuration"))
- resp = new Message();
- else
- throw new SystemException(
- sex.getResultCode(),
- sex.getResultDescription());
+ if
(sex.getResultCode().equals("warning.ma.metadata_configuration"))
+ resp = new Message();
+ else
+ throw new SystemException(
+ sex.getResultCode(),
+ sex.getResultDescription());
}

if (resp.getDataMap().size() > 0) {
@@ -250,30 +257,30 @@
Data d = (resp.getDataArray())[0];
Key k = d.getKey();
key = k;
-
+
if (key.getParameterByName("eventType") == null)
- key.addParameter("eventType", eventType);
+ key.addParameter("eventType", eventType);

} else {

// metadata does not exist in xmldb

// getting default ibatis parameter from service.properties
- String ibatis_config_str = "";
- try {
- ibatis_config_str =
-
configuration.getProperty("service.ma.sql.default_ibatis_config");
- } catch (Exception ex) {
- ibatis_config_str = "";
- }
+ String ibatis_config_str = "";
+ try {
+ ibatis_config_str =
+
configuration.getProperty("service.ma.sql.default_ibatis_config");
+ } catch (Exception ex) {
+ ibatis_config_str = "";
+ }

Parameter ibatisConfig = null;
if (!ibatis_config_str.trim().equals("")) {

- ibatisConfig = new Parameter();
- ibatisConfig.setParameterName("ibatisConfig");
+ ibatisConfig = new Parameter();
+ ibatisConfig.setParameterName("ibatisConfig");

- ibatisConfig.setParameterValue(ibatis_config_str);
+ ibatisConfig.setParameterValue(ibatis_config_str);
}

Key k = new Key();
@@ -283,19 +290,20 @@

Parameters params = metadata.getParameters();
if (params == null)
- params = new Parameters();
+ params = new Parameters();


if (ibatisConfig != null) {

- params.getParameterMap().remove("ibatisConfig");
- params.addChild(ibatisConfig);
+ params.getParameterMap().remove("ibatisConfig");
+ params.addChild(ibatisConfig);
+
}

if (params.getParameterByName("ibatisConfig") == null) {
- logger.error("SQLTypeMAServiceEngine.getStoreKey: "
- + "No default ibatis property in the
key");
- throw new RequestException(
+ logger.error("SQLTypeMAServiceEngine.getStoreKey: "
+ + "No default ibatis property in the key");
+ throw new RequestException(
"error.ma.sql.db_connection.ibatis",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "No default ibatis property "
@@ -328,8 +336,8 @@
configMessage.addChild(dk);

//logger.debug("SQLTypeMAServiceEngine.getStoreKey: "
- // + "metadataConfig message: "
- // + configMessage.toString());
+ // + "metadataConfig message: "
+ // + configMessage.toString());

metadataConfig.store(configMessage);

@@ -343,4 +351,4 @@



-} //SQLTypeMAServiceEngine
+} //SQLTypeMAServiceEngine
\ No newline at end of file



  • perfsonar: r2239 - in branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive: metadataConfig metadataConfig/queryGenerator rrdType sqlType, svnlog, 03/15/2007

Archive powered by MHonArc 2.6.16.

Top of Page