perfsonar-dev - r1951 - branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType
Subject: perfsonar development work
List archive
r1951 - branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType
Chronological Thread
- From:
- To:
- Subject: r1951 - branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType
- Date: Mon, 22 Jan 2007 06:32:36 -0500
Author: roman
Date: 2007-01-22 06:32:35 -0500 (Mon, 22 Jan 2007)
New Revision: 1951
Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
Log:
When startTime or endTime parameter in the request to the SQL MA had wrong
format then the exception were not caught.
Now it's fixed and relevant result (error) code is generated and sent in the
response.
Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2007-01-22 09:56:46 UTC (rev 1950)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2007-01-22 11:32:35 UTC (rev 1951)
@@ -131,11 +131,29 @@
// + pname + ", " + pvalue + "]");
if (pname.equals("startTime")) {
- long startTime = Long.parseLong(pvalue);
+ long startTime = 0;
+ try {
+ startTime = Long.parseLong(pvalue);
+ } catch (NumberFormatException nfex) {
+ throw new RequestException(
+ "error.ma.query",
+ "SQLStorageManager.fetch: "
+ + "startTime parameter in the request "
+ + "has wrong format");
+ }
ibatisParams.put(pname, startTime);
} else if (pname.equals("endTime")) {
- long endTime = Long.parseLong(pvalue);
+ long endTime = 0;
+ try {
+ endTime = Long.parseLong(pvalue);
+ } catch (NumberFormatException nfex) {
+ throw new RequestException(
+ "error.ma.query",
+ "SQLStorageManager.fetch: "
+ + "endTime parameter in the request "
+ + "has wrong format");
+ }
ibatisParams.put(pname, endTime);
} else {
- r1951 - branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/sqlType, svnlog, 01/22/2007
Archive powered by MHonArc 2.6.16.