perfsonar-dev - r1388 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: register rrdType storageManager
Subject: perfsonar development work
List archive
r1388 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: register rrdType storageManager
Chronological Thread
- From:
- To:
- Subject: r1388 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: register rrdType storageManager
- Date: Thu, 6 Jul 2006 05:05:15 -0400
Author: roman
Date: 2006-07-06 05:05:14 -0400 (Thu, 06 Jul 2006)
New Revision: 1388
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/L2PathStatusQuery.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/RRDStorageManager.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SimpleMetadataConfigurationStorageManager.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/Transformations.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/UtilizationQuery.java
Log:
- better exception handling while logger and configuration are created
- better names of some varaibales
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -58,7 +58,7 @@
private LoggerComponent logger = null;
- private ConfigurationComponent config = null;
+ private ConfigurationComponent configuration = null;
private Scheduler scheduler = null;
@@ -72,7 +72,7 @@
try {
- logger = (LoggerComponent)
+ this.logger = (LoggerComponent)
AuxiliaryComponentManager.
getInstance().
getComponent(ComponentNames.LOGGER);
@@ -89,7 +89,7 @@
try {
- config = (ConfigurationComponent)
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.
getInstance().
getComponent(ComponentNames.CONFIG);
@@ -119,9 +119,9 @@
try {
String maRRDConfigFile =
- config.getProperty(LSRegistrationComponent.MA_CONFIG_FILE);
+
configuration.getProperty(LSRegistrationComponent.MA_CONFIG_FILE);
- String lsURL = config.getProperty(
+ String lsURL = configuration.getProperty(
"service.r.ls_url");
logger.debug("LSRegistrationComponent.runAction: "
@@ -171,7 +171,7 @@
try {
- String intervalVal = config.getProperty(
+ String intervalVal = configuration.getProperty(
"component." + componentName + ".interval");
interval = Integer.parseInt(intervalVal);
@@ -192,7 +192,7 @@
//get scheduler - parameter "component.CName.scheduler_component"
try {
- String schedulerVal = config.getProperty(
+ String schedulerVal = configuration.getProperty(
"component." + componentName + ".scheduler_component");
logger.debug("LSRegistrationComponent.initComponent: "
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -97,18 +97,40 @@
this.serviceEngineType = "service.MeasurementArchive.RRDType";
- this.logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- this.configuration = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+ throw new SystemException(
+ "error.common.no_logger",
+ "RRDTypeMAServiceEngine.constructor: "
+ + "Cannot get logger component");
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "RRDTypeMAServiceEngine.constructor: "
+ + "Cannot get config component");
+
+ }
+
+
+
// checking if using xml db is allowed
String dbStatus =
configuration.getProperty("component.ma.xmldb.db_status");
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/L2PathStatusQuery.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/L2PathStatusQuery.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/L2PathStatusQuery.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -52,16 +52,39 @@
public L2PathStatusQuery() throws SystemException {
- logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- configuration = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_logger",
+ "L2PathStatusQuery.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "L2PathStatusQuery.constructor: "
+ + "Cannot get config component");
+
+ }
+
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -55,17 +55,39 @@
public MetadataConfigurationStorageManager() throws SystemException {
- logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- configuration = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+ throw new SystemException(
+ "error.common.no_logger",
+ "MetadataConfigurationStorageManager.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "MetadataConfigurationStorageManager.constructor: "
+ + "Cannot get config component");
+
+ }
+
+
this.existDbXmlStorageManager = new ExistDbXmlStorageManager();
this.transformations = new Transformations();
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/RRDStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/RRDStorageManager.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/RRDStorageManager.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -85,9 +85,9 @@
public static final String RESOLUTION = "--resolution";
- private LoggerComponent log = null;
+ private LoggerComponent logger = null;
- private ConfigurationComponent config = null;
+ private ConfigurationComponent configuration = null;
@@ -98,16 +98,38 @@
public RRDStorageManager() throws SystemException {
- this.log = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- this.config = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_logger",
+ "RRDStorageManager.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "RRDStorageManager.constructor: "
+ + "Cannot get config component");
+
+ }
+
}
@@ -184,7 +206,7 @@
if (rrdFileKey == null)
continue;
else {
- log.debug ("RRDStorageManager.store: "
+ logger.debug ("RRDStorageManager.store: "
+ "RRD Key for storing data was found in the
message");
break;
}
@@ -193,7 +215,7 @@
if (rrdFileKey == null) {
- log.fatal("RRDStorageManager.store: The metadata elements
supplied " +
+ logger.fatal("RRDStorageManager.store: The metadata elements
supplied " +
"for storage do not contain a key. Key is necessary to
identify" +
"the file where data should be stored. Cannot continue
with storage");
@@ -212,7 +234,7 @@
if (fileNameParameter == null || dataSourceParameter == null) {
- log.fatal("RRDStorageManager.store: The metadata elements
supplied " +
+ logger.fatal("RRDStorageManager.store: The metadata elements
supplied " +
"for storage do not contain a key. Key is necessary to
identify" +
"the file where data should be stored. Cannot continue
with storage");
@@ -234,7 +256,7 @@
throw se;
}
catch (Exception e) {
- log.fatal("RRDStorageManager.store: Unknown exception caught
" +
+ logger.fatal("RRDStorageManager.store: Unknown exception
caught " +
"while creating new file: " + fileName + "
Exception: " +
e.getMessage());
@@ -243,7 +265,7 @@
}
if (!(file.exists()))
- log.info("RRDStorageManager.store: Could not create new rrd
file: " + fileName);
+ logger.info("RRDStorageManager.store: Could not create new
rrd file: " + fileName);
}
this.updateRRDFile(dataSet);
@@ -397,7 +419,7 @@
} catch (RrdException se) {
- log.error("RRDStorageManager.rrdFetch: "
+ logger.error("RRDStorageManager.rrdFetch: "
+ "Cannot retrieve data from rrdjtool library: "
+ se.getMessage());
throw new SystemException(
@@ -408,7 +430,7 @@
} catch (UnsatisfiedLinkError ule) {
- log.error("RRDStorageManager.rrdFetch: "
+ logger.error("RRDStorageManager.rrdFetch: "
+ "Cannot connect with rrdjtool native library: "
+ ule.getMessage());
throw new SystemException(
@@ -478,7 +500,7 @@
String command = cmd.toString();
- log.debug("RRDStorageManager.fetchRRDData: command: " + command);
+ logger.debug("RRDStorageManager.fetchRRDData: command: " + command);
//Perform rrdtool command. If it fails, RrdException will be thrown.
Rrd rrd = Rrd.getInstance();
@@ -599,15 +621,15 @@
dsTypeDefault =
-
config.getProperty("service.ma.rrd.rrd_storage_manager_rrd_DS_type_default");
+
configuration.getProperty("service.ma.rrd.rrd_storage_manager_rrd_DS_type_default");
dsTypeDefault = dsTypeDefault.trim();
if (dsTypeDefault != null)
- log.debug("RRDStorageManager.createRRDFile: RRD DS Type Default
: "
+ logger.debug("RRDStorageManager.createRRDFile: RRD DS Type
Default : "
+ dsTypeDefault);
else {
- log.fatal("RRDStorageManager.createRRDFile: config read a null
property for RRD_DS_Type_Default ?");
+ logger.fatal("RRDStorageManager.createRRDFile: config read a
null property for RRD_DS_Type_Default ?");
throw new SystemException("RRDStorageManager: createRRDFile:
System configuration error. " +
"Creating a new rrd file requires reading ds
default type from config file. " +
"This information is missing");
@@ -619,13 +641,13 @@
String stepFromProperties =
-
config.getProperty("service.ma.rrd.rrd_storage_manager_rrd_step_default");
+
configuration.getProperty("service.ma.rrd.rrd_storage_manager_rrd_step_default");
step = stepFromProperties;
step = step.trim();
String rraFromProperties =
-
config.getProperty("service.ma.rrd.rrd_storage_manager_rrd_RRA_default");
+
configuration.getProperty("service.ma.rrd.rrd_storage_manager_rrd_RRA_default");
rra = rraFromProperties.split(",");
@@ -641,7 +663,7 @@
}
else {
- log.fatal("RRDStorageManager.createRRDFile: could not create rrd
file " +
+ logger.fatal("RRDStorageManager.createRRDFile: could not create
rrd file " +
"because filename information could not be found in
request");
throw new SystemException("RRDStorageManager.createRRDFile:
could not create rrd file " +
@@ -658,7 +680,7 @@
}
else {
- log.fatal("RRDStorageManager.createRRDFile: could not create rrd
file " +
+ logger.fatal("RRDStorageManager.createRRDFile: could not create
rrd file " +
"because 'step' parameter information is missing");
throw new SystemException("RRDStorageManager.createRRDFile:
could not create rrd file " +
@@ -670,7 +692,7 @@
if (ds == null || !(ds.length > 0)) {
- log.fatal("RRDStorageManager.createRRDFile: could not create rrd
file " +
+ logger.fatal("RRDStorageManager.createRRDFile: could not create
rrd file " +
"because 'data source' information is missing");
throw new SystemException("RRDStorageManager.createRRDFile:
could not create rrd file " +
@@ -690,7 +712,7 @@
if (rra == null || !(rra.length > 0)) {
- log.fatal("RRDStorageManager.createRRDFile: could not create rrd
file " +
+ logger.fatal("RRDStorageManager.createRRDFile: could not create
rrd file " +
"because 'RRA (Round Robin Archive)' information is
missing");
throw new SystemException("RRDStorageManager.createRRDFile:
could not create rrd file " +
@@ -706,7 +728,7 @@
}
- log.info("RRDStorageManager.createRRDFile:" +
+ logger.info("RRDStorageManager.createRRDFile:" +
" Creating rrd file using command: " + command);
//System.out.println("Reached 2");
@@ -715,11 +737,11 @@
}
catch (RrdException e) {
- log.fatal("RRDStorageManager.createRRDFile: could not create rrd
file " +
+ logger.fatal("RRDStorageManager.createRRDFile: could not create
rrd file " +
"for the given file name and configured parameters. " +
"Message: " + e.getMessage());
- log.fatal("RRDStorageManager.createRRDFile: command given was: "
+ command);
+ logger.fatal("RRDStorageManager.createRRDFile: command given
was: " + command);
throw new SystemException("RRDStorageManager.createRRDFile: " +
"RRDTool could not create RRD file with the
configured parameters " +
@@ -729,11 +751,11 @@
}
catch (Exception e) {
- log.fatal("RRDStorageManager.createRRDFile: Error encountered " +
+ logger.fatal("RRDStorageManager.createRRDFile: Error encountered
" +
"while creating rrd file for the given file name and" +
"configured parameters. Message: " + e.getMessage());
- log.fatal("RRDStorageManager.createRRDFile: command given was: "
+ command);
+ logger.fatal("RRDStorageManager.createRRDFile: command given
was: " + command);
throw new SystemException("RRDStorageManager.createRRDFile:
Error encountered " +
@@ -745,7 +767,7 @@
File file = new File(fileName);
if (file.exists()) {
- log.info("RRDStorageManager.createRRDFile: New RRD file " +
+ logger.info("RRDStorageManager.createRRDFile: New RRD file " +
"has been created: " + fileName);
return true;
@@ -753,7 +775,7 @@
else {
- log.fatal("RRDStorageManager.createRRDFile: Unknown error
occurred while " +
+ logger.fatal("RRDStorageManager.createRRDFile: Unknown error
occurred while " +
"creating rrd file");
throw new SystemException("RRDStorageManager.createRRDFile: " +
@@ -812,14 +834,14 @@
if (dataCollection.size() > 1) {
- log.error("RRDStorageManager.updateRRDFile: Unknown format of
message. " +
+ logger.error("RRDStorageManager.updateRRDFile: Unknown format of
message. " +
"More than one data element found. ");
}
if (dataCollection.size() < 1) {
- log.error("RRDStorageManager.updateRRDFile: Unknown format of
message. " +
+ logger.error("RRDStorageManager.updateRRDFile: Unknown format of
message. " +
"No data element found. Updating given rrd and
datasource with an 'unknown' value");
}
@@ -842,7 +864,7 @@
if (mainDataElement == null) {
- log.error("RRDStorageManager.updateRRDFile: Unknown format of
message. " +
+ logger.error("RRDStorageManager.updateRRDFile: Unknown format of
message. " +
"Data element found but had no content. Updating given
rrd and " +
"datasource with an 'unknown' value");
@@ -876,7 +898,7 @@
(timeValueAttribute == null ||
timeValueAttribute.equals(""))
&& (timeTypeAttribute == null ||
timeTypeAttribute.equals("")) ) {
- log.error("RRDStorageManager.updateRRDFile: " +
+ logger.error("RRDStorageManager.updateRRDFile: " +
"Time value for measurement not given.
Current time value " +
"chosen by RRDtool will be used");
@@ -891,7 +913,7 @@
timeType.equalsIgnoreCase("unix time") ||
timeType.equalsIgnoreCase("unixTime"))) ) {
- log.error("RRDStorageManager.updateRRDFile:
Unknown format of message. " +
+ logger.error("RRDStorageManager.updateRRDFile:
Unknown format of message. " +
"Time format is not unix type. Time type
found in message: " + timeType +
" Only 'unix' or 'unix time' are
accepted. The given data will be stored " +
"with a current time value chosen by
RRDtool");
@@ -914,7 +936,7 @@
timeType.equalsIgnoreCase("unix time") ||
timeType.equalsIgnoreCase("unixTime"))) ) {
- log.error("RRDStorageManager.updateRRDFile:
Unknown format of message. " +
+ logger.error("RRDStorageManager.updateRRDFile:
Unknown format of message. " +
"Time format is not unix type. Time type
found in message: " + timeType +
" Only 'unix' or 'unix time' are
accepted. The given data will be stored " +
"with a current time value chosen by
RRDtool");
@@ -961,7 +983,7 @@
datumUnits.equalsIgnoreCase("octets per
second")||
datumUnits.equalsIgnoreCase("ops"))) {
- log.error("RRDStorageManager.updateRRDFile:
Unknown format of data. " +
+
logger.error("RRDStorageManager.updateRRDFile: Unknown format of data. " +
"Accepted values should have units
in either bps or octets per second." +
"Given value had its units as: " +
datumUnits + " Storing data value as unknown.");
@@ -971,7 +993,7 @@
} catch (Exception e) {
-
log.error("RRDStorageManager.updateRRDFile:Dataformat error. " +
+
logger.error("RRDStorageManager.updateRRDFile:Dataformat error. " +
" Exception occurred while understanding
value." +
" Message: " + e.getMessage() + " Given
data will be stored as unknown value");
@@ -989,7 +1011,7 @@
}
else {
- log.error("RRDStorageManager.updateRRDFile: No datum present
in the given data. " +
+ logger.error("RRDStorageManager.updateRRDFile: No datum
present in the given data. " +
"Storing value as unknown");
datumValues = "N:U";
}
@@ -1005,7 +1027,7 @@
}
else {
- log.fatal("RRDStorageManager.updateRRDFile: could not update rrd
file " +
+ logger.fatal("RRDStorageManager.updateRRDFile: could not update
rrd file " +
"because filename information could not be found in
request");
throw new SystemException("RRDStorageManager.updateRRDFile:
could not update rrd file " +
@@ -1027,7 +1049,7 @@
}
else {
- log.fatal("RRDStorageManager.updateRRDFile: could not update rrd
file " +
+ logger.fatal("RRDStorageManager.updateRRDFile: could not update
rrd file " +
"because data-source information could not be found in
request");
throw new SystemException("RRDStorageManager.updateRRDFile:
could not update rrd file " +
@@ -1043,13 +1065,13 @@
}
else {
- log.error("RRDStorageManager.updateRRDFile: Unknown data. " +
+ logger.error("RRDStorageManager.updateRRDFile: Unknown data. " +
"RRD file will be updated with uknown values as data
provided hasn't been understood");
command = command.concat(" ");
command = command.concat(defaultTimeValue2 + "U");
}
- log.debug("RRDUpdateStorageManager.updateRRDFile: Updating RRD with
values using command: " + command);
+ logger.debug("RRDUpdateStorageManager.updateRRDFile: Updating RRD
with values using command: " + command);
// concatenate the value ..if not present, 'U' will be used to
indicate that no data was present
@@ -1058,7 +1080,7 @@
}
catch (RrdException e) {
- log.fatal("RRDStorageManager.createRRDFile: could not update" +
+ logger.fatal("RRDStorageManager.createRRDFile: could not update"
+
" rrd file: " + fileName +
" and datasource: " + dataSource + " with the given
data." +
" Message: " + e.getMessage());
@@ -1071,7 +1093,7 @@
}
catch (Exception e) {
- log.fatal("RRDStorageManager.createRRDFile: could not update" +
+ logger.fatal("RRDStorageManager.createRRDFile: could not update"
+
" rrd file: " + fileName +
" and datasource: " + dataSource + " with the given
data."+
" Message: " + e.getMessage());
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -55,10 +55,10 @@
- private LoggerComponent log = null;
+ private LoggerComponent logger = null;
- private ConfigurationComponent config = null;
+ private ConfigurationComponent configuration = null;
@@ -68,16 +68,38 @@
public SQLStorageManager() throws SystemException {
- this.log = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- this.config = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_logger",
+ "SQLStorageManager.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "SQLStorageManager.constructor: "
+ + "Cannot get config component");
+
+ }
+
}
@@ -123,7 +145,7 @@
String pname = p.getParameterName();
String pvalue = p.getParameterValue();
- log.debug("SQLStorageManager.fetch: param [name, value]: ["
+ logger.debug("SQLStorageManager.fetch: param [name, value]:
["
+ pname + ", " + pvalue + "]");
if (pname.equals("startTime")) {
@@ -173,7 +195,7 @@
}
- log.debug("SQLStorageManager.fetch: number of fetched rows: "
+ logger.debug("SQLStorageManager.fetch: number of fetched
rows: "
+ resultList.size());
for (int i = 0; i < resultList.size(); i++) {
@@ -204,7 +226,7 @@
else if (column.equals("valueUnits"))
datum.setValueUnits(strValue);
else if (column.equals("timeValue"))
datum.setTimeValue(strValue);
- //log.debug("SQLStorageManager.fetch: "
+ //logger.debug("SQLStorageManager.fetch: "
// + "column: " + column + ", value: " +
strValue );
}
@@ -217,7 +239,7 @@
} catch (Exception ioex) {
- log.debug("SQLStorageManager.fetch: Unable to fetch data: "
+ logger.debug("SQLStorageManager.fetch: Unable to fetch data:
"
+ ioex.toString());
throw new RequestException(
"error.sqlma.db_connection",
@@ -306,7 +328,7 @@
// or a float
ibatisParams.put("value",
Float.parseFloat(strValue));
} catch (Exception ex) {
- //log.debug("SQLStorageManager.store: " +
ex.toString());
+ //logger.debug("SQLStorageManager.store: " +
ex.toString());
// value is a string ...
ibatisParams.put("value", strValue);
@@ -316,7 +338,7 @@
}
- //log.debug("SQLStorageManager.store: number of stored rows:
" + nr);
+ //logger.debug("SQLStorageManager.store: number of stored
rows: " + nr);
} catch (Exception ioex) {
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SimpleMetadataConfigurationStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SimpleMetadataConfigurationStorageManager.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SimpleMetadataConfigurationStorageManager.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -88,17 +88,39 @@
public SimpleMetadataConfigurationStorageManager() throws
SystemException {
- logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- configuration = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+ throw new SystemException(
+ "error.common.no_logger",
+
"SimpleMetadataConfigurationStorageManager.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+
"SimpleMetadataConfigurationStorageManager.constructor: "
+ + "Cannot get config component");
+
+ }
+
+
this.transformations = new Transformations();
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/Transformations.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/Transformations.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/Transformations.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -47,16 +47,38 @@
public Transformations() throws SystemException {
- logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- configuration = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_logger",
+ "Transformations.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "Transformations.constructor: "
+ + "Cannot get config component");
+
+ }
+
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/UtilizationQuery.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/UtilizationQuery.java
2006-07-05 23:00:21 UTC (rev 1387)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/UtilizationQuery.java
2006-07-06 09:05:14 UTC (rev 1388)
@@ -47,16 +47,38 @@
public UtilizationQuery() throws SystemException {
- logger = (LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.LOGGER);
+ try {
- configuration = (ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent(ComponentNames.CONFIG);
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_logger",
+ "UtilizationQuery.constructor: "
+ + "Cannot get logger component");
+
+ }
+
+ try {
+
+ this.configuration = (ConfigurationComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.CONFIG);
+
+ } catch (SystemException e) {
+
+ throw new SystemException(
+ "error.common.no_configuration",
+ "UtilizationQuery.constructor: "
+ + "Cannot get config component");
+
+ }
+
}
- r1388 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: register rrdType storageManager, svnlog, 07/06/2006
Archive powered by MHonArc 2.6.16.