perfsonar-dev - Re: [pS-dev] perfsonar: r3422 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service: base/registration measurementArchive/register
Subject: perfsonar development work
List archive
Re: [pS-dev] perfsonar: r3422 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service: base/registration measurementArchive/register
Chronological Thread
- From: Guilherme Fernandes <>
- To:
- Subject: Re: [pS-dev] perfsonar: r3422 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service: base/registration measurementArchive/register
- Date: Thu, 28 Feb 2008 14:20:52 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=CHaLhN8mWGQuKCIDneAztT7X3EAzoBY3YUulrq6fr8+h+FEqkA5mOBIbbsBUULzDqB36FGhHpveRTYY6n0P6PKDRTF6oOMNuZu6Gg91g5B59pSvLDLCcQ4RU9BdzaBX/oPCidi90P+/JJf4+/JAN1PRTEL1LzORG1NapY67FAyY=
Very good! I forgot to think about this when we did the changes, we were doing the file update using perl scripts.
Guilherme
wrote:
Author: roman
Date: 2008-02-28 07:35:00 -0500 (Thu, 28 Feb 2008)
New Revision: 3422
Added:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/InformationExistDbXmlrpcServiceContent.java
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
Log:
Now MA service can take metadatas for LS register requests not only from metadata xml file but also from xml database. The latter option is very important when metadata configuration in xml db is updated while the service is already running.
Added:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/InformationExistDbXmlrpcServiceContent.java
Property changes on:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/InformationExistDbXmlrpcServiceContent.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2008-02-27 15:13:25 UTC (rev 3421)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2008-02-28 12:35:00 UTC (rev 3422)
@@ -6,6 +6,7 @@
import org.ggf.ns.nmwg.base.v2_0.Message;
+
import org.perfsonar.base.auxiliary.AuxiliaryComponent;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
@@ -13,9 +14,12 @@
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.auxiliary.components.simplescheduler.Scheduler;
import
org.perfsonar.base.auxiliary.components.simplescheduler.SchedulerAction;
+
import org.perfsonar.base.exceptions.PerfSONARException;
+
import org.perfsonar.service.base.registration.GenericServiceLSRegistrator;
import
org.perfsonar.service.base.registration.InformationXMLFileServiceContent;
+import
org.perfsonar.service.base.registration.InformationExistDbXmlrpcServiceContent;
import org.perfsonar.service.base.registration.PropertiesServiceDescription;
import org.perfsonar.service.base.registration.ServiceLSRegistrator;
@@ -42,8 +46,10 @@
private static final String MA_CONFIG_FILE = "service.ma.conf_file";
+ private static final String MA_CONFIG_STORE="service.ma.conf_file.store_type"; //"xmldb" or "file"
+
// -------------------------------------------- class fields
@@ -114,21 +120,45 @@
try {
- String maRRDConfigFile = - configuration.getProperty(LSRegistrationComponent.MA_CONFIG_FILE);
-
String lsURL = configuration.getProperty(
"service.r.ls_url");
-
logger.debug("LSRegistrationComponent.runAction: "
- + "register to LS [" + lsURL + "] with file "
- + "[" + maRRDConfigFile + "]");
+ + "register to LS: " + lsURL);
- ServiceLSRegistrator registrator =
- new GenericServiceLSRegistrator(
- new PropertiesServiceDescription(),
- new InformationXMLFileServiceContent(maRRDConfigFile));
+ String metadataConfigStore = "";
+ try {
+ metadataConfigStore =
+
configuration.getProperty(LSRegistrationComponent.MA_CONFIG_STORE);
+ } catch (PerfSONARException ex) {}
+
+ ServiceLSRegistrator registrator = null;
+
+ if (metadataConfigStore.equals("file")) {
+
+ String maRRDConfigFile = + configuration.getProperty(LSRegistrationComponent.MA_CONFIG_FILE);
+
+ logger.debug("LSRegistrationComponent.runAction: "
+ + "metadata config file to register to LS: "
+ + maRRDConfigFile);
+
+ registrator = new GenericServiceLSRegistrator(
+ new PropertiesServiceDescription(),
+ new
InformationXMLFileServiceContent(maRRDConfigFile));
+
+ } else {
+
+ registrator = new GenericServiceLSRegistrator(
+ new PropertiesServiceDescription(),
+ new InformationExistDbXmlrpcServiceContent());
+
+ logger.debug("LSRegistrationComponent.runAction: "
+ + "metadata configuration taken from xml database");
+ }
+
+
+
registrator.initRegistrator();
responseMessage = registrator.register(lsURL);
- perfsonar: r3422 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service: base/registration measurementArchive/register, svnlog, 02/28/2008
- Re: [pS-dev] perfsonar: r3422 - in trunk/perfsonar_base/src/main/java/org/perfsonar/service: base/registration measurementArchive/register, Guilherme Fernandes, 02/28/2008
Archive powered by MHonArc 2.6.16.