perfsonar-dev - r1473 - in trunk/perfsonar/src/org/perfsonar/service: commons/storage/xmldb/exist measurementArchive/rrdType measurementArchive/sqlType measurementArchive/storageManager
Subject: perfsonar development work
List archive
r1473 - in trunk/perfsonar/src/org/perfsonar/service: commons/storage/xmldb/exist measurementArchive/rrdType measurementArchive/sqlType measurementArchive/storageManager
Chronological Thread
- From:
- To:
- Subject: r1473 - in trunk/perfsonar/src/org/perfsonar/service: commons/storage/xmldb/exist measurementArchive/rrdType measurementArchive/sqlType measurementArchive/storageManager
- Date: Thu, 20 Jul 2006 09:49:26 -0400
Author: roman
Date: 2006-07-20 09:49:25 -0400 (Thu, 20 Jul 2006)
New Revision: 1473
Modified:
trunk/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/ExistDbFactory.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
Log:
small changes
Modified:
trunk/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/ExistDbFactory.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/ExistDbFactory.java
2006-07-20 10:49:51 UTC (rev 1472)
+++
trunk/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/ExistDbFactory.java
2006-07-20 13:49:25 UTC (rev 1473)
@@ -38,7 +38,7 @@
if (type.equalsIgnoreCase(EXIST_XMLRPC)) {
- logger.debug("ExistDbFactory: Creating XML RPC Data Repository
for LS: ("
+ logger.debug("ExistDbFactory: Creating XML RPC Data Repository:
("
+ uri + ", " + username + ", " + password + ")");
dataRepository =
new ExistDbXmlrpcXmlDataRepository( uri, username, password
);
@@ -46,7 +46,7 @@
} else if (type.equalsIgnoreCase(EXIST_HTTP)) {
- logger.debug("ExistDbFactory: Creating HTTP/REST Data Repository
for LS: ("
+ logger.debug("ExistDbFactory: Creating HTTP/REST Data
Repository: ("
+ uri + ", " + username + ", " + password + ")");
dataRepository =
new ExistDbHttpXmlDataRepository( uri, username, password );
@@ -55,7 +55,7 @@
} else {
//default - HTTP
- logger.debug("ExistDbFactory: Creating HTTP/REST Data Repository
for LS: ("
+ logger.debug("ExistDbFactory: Creating default HTTP/REST Data
Repository: ("
+ uri + ", " + username + ", " + password + ")");
dataRepository =
new ExistDbHttpXmlDataRepository( uri, username, password );
@@ -77,12 +77,12 @@
if (type.equalsIgnoreCase(EXIST_XMLRPC)) {
- logger.debug("ExistDbFactory: Creating XML RPC Storage Manager
for LS");
+ logger.debug("ExistDbFactory: Creating XML RPC Storage Manager");
sm = new
org.perfsonar.service.commons.storage.xmldb.exist.xmlrpc.ExistDbXmlrpcXmlStorageManager();
} else if (type.equalsIgnoreCase(EXIST_HTTP)) {
- logger.debug("ExistDbFactory: Creating HTTP/REST Storage Manager
for LS");
+ logger.debug("ExistDbFactory: Creating HTTP/REST Storage
Manager");
sm = new
org.perfsonar.service.commons.storage.xmldb.exist.rest.ExistDbHttpXmlStorageManager();
} else {
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2006-07-20 10:49:51 UTC (rev 1472)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2006-07-20 13:49:25 UTC (rev 1473)
@@ -256,12 +256,6 @@
}
- logger.debug(
- "RRDTypeMAServiceEngine.takeAction: "
- + "Responding to request of type: "
- + actionType);
-
-
return response;
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2006-07-20 10:49:51 UTC (rev 1472)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2006-07-20 13:49:25 UTC (rev 1473)
@@ -63,10 +63,6 @@
public Message takeAction(String actionType, Message request)
throws SystemException, RequestException, DataFormatException {
- logger.debug("SQLTypeMAServiceEngine.takeAction: "
- + "Received a request of type: "
- + actionType);
-
Message response = super.takeAction(actionType, request);
return response;
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
2006-07-20 10:49:51 UTC (rev 1472)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/MetadataConfigurationStorageManager.java
2006-07-20 13:49:25 UTC (rev 1473)
@@ -18,6 +18,10 @@
import org.perfsonar.service.commons.storage.StorageManager;
import org.perfsonar.service.commons.storage.NMWGStorageManager;
+import org.perfsonar.service.commons.storage.xmldb.XmlDbDataRepository;
+import org.perfsonar.service.commons.storage.xmldb.XmlDbStorageManager;
+import org.perfsonar.service.commons.storage.xmldb.exist.ExistDbFactory;
+
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.Data;
@@ -40,10 +44,8 @@
- private StorageManager existDbXmlStorageManager = null;
-
- private static String xmldbAccess = "http";
-
+ protected StorageManager existDbXmlStorageManager = null;
+
protected LoggerComponent logger = null;
protected ConfigurationComponent configuration = null;
@@ -52,93 +54,6 @@
- // -------------------------------------- static code
-
-
-
- static {
-
-// /* ---------------------- */
-// /* Roman, */
-// /* TRY SOMETING LIKE THIS */
-// /* ---------------------- */
-//
-// import
org.perfsonar.service.commons.storage.xmldb.XmlDbDataRepository;
-// import
org.perfsonar.service.commons.storage.xmldb.XmlDbStorageManager;
-// import
org.perfsonar.service.commons.storage.xmldb.exist.ExistDbFactory;
-//
-// protected XmlDbStorageManager getStorageManager(String type)
-// throws SystemException {
-//
-// XmlDbDataRepository dataRepository =
-// ExistDbFactory.getDataRepositoryByProperties(
-// smType,
-// "service.ma.db_uri",
-// "service.ma.db_username",
-// "service.ma.db_password");
-//
-// XmlDbStorageManager storageManager =
-// ExistDbFactory.getXMLStorageManager(
-// type, dataRepository);
-// storageManager.setResultType(
-// XmlDbStorageManager.STRING_ARRAY_RESULT_TYPE);
-//
-// return storageManager;
-//
-// }
-
-
- // loading the component ExistDbXmlrpcXmlStorageManager
- // to have xml db (eXsit) access
-
- try {
-
- try{
- MetadataConfigurationStorageManager.xmldbAccess =
- ((ConfigurationComponent)
- AuxiliaryComponentManager.
- getInstance().
-
getComponent(ComponentNames.CONFIG)).
-
getProperty("component.ma.xmldb.db_access");
- } catch (Exception ex) {
- ;
- }
-
- if
(MetadataConfigurationStorageManager.xmldbAccess.equals("xmlrpc"))
- AuxiliaryComponentManager.
- getInstance().
- loadComponent(
- "ma.xmldb",
-
"org.perfsonar.service.commons.storage.xmldb.exist.xmlrpc.ExistDbXmlrpcXmlStorageManager");
- else
- AuxiliaryComponentManager.
- getInstance().
- loadComponent(
- "ma.xmldb",
-
"org.perfsonar.service.commons.storage.xmldb.exist.rest.ExistDbHttpXmlStorageManager");
-
-
- ((AuxiliaryComponent)
- AuxiliaryComponentManager.
- getInstance().
- getComponent("ma.xmldb"))
- .initComponent();
-
- ((LoggerComponent)
- AuxiliaryComponentManager.
- getInstance().
-
getComponent(ComponentNames.LOGGER)).
-
debug("MetadataConfigurationStorageManager: "
- +
"ExistDbXmlrpcXmlStorageManager component loaded");
-
- } catch (SystemException sex) {
- ;
- }
-
- }
-
-
-
// -------------------------------------- constructors
@@ -193,10 +108,7 @@
public void initStorage(Key dataRepository) throws SystemException {
- existDbXmlStorageManager = (StorageManager)
- AuxiliaryComponentManager.
- getInstance().
- getComponent("ma.xmldb");
+ this.existDbXmlStorageManager = getStorageManager();
}
@@ -393,6 +305,45 @@
+ // -------------------------------------- protected methods
+
+
+
+ protected XmlDbStorageManager getStorageManager()
+ throws SystemException {
+
+ String xmldbAccess = "http";
+
+ try {
+ xmldbAccess =
+
configuration.getProperty("component.ma.xmldb.db_access");
+ } catch (Exception ex) {
+ ;
+ }
+
+ if (xmldbAccess == null || xmldbAccess.equals(""))
+ xmldbAccess = "http";
+
+ XmlDbDataRepository dataRepository =
+ ExistDbFactory.getDataRepositoryByProperties(
+ xmldbAccess.toUpperCase(),
+ "component.ma.xmldb.db_uri",
+ "component.ma.xmldb.db_username",
+ "component.ma.xmldb.db_password");
+
+ XmlDbStorageManager storageManager =
+ ExistDbFactory.getXMLStorageManager(
+ xmldbAccess, dataRepository);
+ storageManager.setResultType(
+ XmlDbStorageManager.STRING_ARRAY_TYPE);
+
+
+ return storageManager;
+
+ }
+
+
+
// -------------------------------------- private methods
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
2006-07-20 10:49:51 UTC (rev 1472)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
2006-07-20 13:49:25 UTC (rev 1473)
@@ -148,8 +148,8 @@
String pname = p.getParameterName();
String pvalue = p.getParameterValue();
- logger.debug("SQLStorageManager.fetch: param [name, value]:
["
- + pname + ", " + pvalue + "]");
+ //logger.debug("SQLStorageManager.fetch: param [name,
value]: ["
+ // + pname + ", " + pvalue + "]");
if (pname.equals("startTime")) {
int startTime = Integer.parseInt(pvalue);
- r1473 - in trunk/perfsonar/src/org/perfsonar/service: commons/storage/xmldb/exist measurementArchive/rrdType measurementArchive/sqlType measurementArchive/storageManager, svnlog, 07/20/2006
Archive powered by MHonArc 2.6.16.