perfsonar-dev - Re: LS Registration Modifications
Subject: perfsonar development work
List archive
- From: Maciej Glowiak <>
- To:
- Cc: Perfsonar Development List <>
- Subject: Re: LS Registration Modifications
- Date: Tue, 14 Nov 2006 12:52:21 +0100
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA CXBIWXMAAEU1AABFNQF8gVf5AAAAB3RJTUUH1QYQDjo6uEWvwgAAAM5JREFUGNNN0LFqAkEUheGj KRZsfATrvENgYyH4APabxwgWGUUQC99BsNDCInUq7VImbbDZ0kayxBXMuN7jvTuKVh//mZlmQKZ1 EhQ8GAVgZECspEBdWQHRjR70KlgFKkoUaCw3ijSYQ4n5HfBK4a4jDcdDQPol/80Sr9BxZOOL4Fmr Jq8VBx7eopaSPvWGOm67fqol3j1q0XNs7Nk2cs6MU6gPNzf+ZGKQX4Ek8H6rAnFZnXB2vJxJcv8g C2P+WzL4tD+Txc4KydrIkh+eAdo01QbjQ84vAAAAAElFTkSuQmCC
- Organization: Poznan Supercomputing and Networking Center
Hi Guilherme,
I am ok with the changes. I am not sure about new constructor, because in my opinion it's not necessary; you may use just null parameter, but it doesn't really matter.
If it works for you, just commit the changes.
Best regards
Maciej
wrote:
Hi Maciej,
Sorry for responding so late, I was at a conference in São Paulo without internet access. That diff was from the svn diff command, so it wouldn't work for patch. I'm anexing a diff version so that you can apply the patch (at perfsonar root directory, patch -p0)
Guilherme
Quoting Maciej Glowiak
<>:
Hi Fernandes,
How can I applied the patch you sent me? I tried just
patch < FILE
but it failed. I'd like to see them applied all together and test.
Maciej
wrote:
Hi guys,
I've made some modifications to the LS Registration process so that a service can register without having a configuration file (or a LS registration file as it is called in the generic version). The service would then only register the service.r parameters. Here are the modifications, see if everyone is ok with them (specially Maciej and Roman):
Index: src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java ===================================================================
--- src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java (revision 1721)
+++ src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java (working copy)
@@ -60,7 +60,13 @@
}
-
+ public GenericServiceLSRegistrator(
+ ServiceDescription sd) {
+
+ serviceDescription = sd;
+ serviceContent = null;
+
+ }
// ------------------------------------------------ Public methods
@@ -91,10 +97,8 @@
Message message = getLSRegisterRequestMessage();
-
String result = XMLUtils.serializeXML(message);
//TODO: to remove
- logger.debug("GenericServiceLSRegistrator: request message: "+result);
logger.debug("GenericServiceLSRegistrator: sending via Axis");
@@ -176,18 +180,24 @@
SystemException("error.common.lsregistrator.no_service_description",
"No service description");
- if (serviceContent==null) throw new
- SystemException("error.common.lsregistrator.no_service_content",
- "No service content");
-
Map commonParameters = serviceDescription.getServiceDescription();
- String[] metadata = serviceContent.getServiceContent();
LSRegisterRequestGenerator lsRegisterGenerator =
new LSRegisterRequestGenerator();
lsRegisterGenerator.setCommonParameters(commonParameters);
- lsRegisterGenerator.setMetadataElements(metadata);
-
+
+ if (serviceContent!=null) {
+
+ String[] metadata = serviceContent.getServiceContent();
+ lsRegisterGenerator.setMetadataElements(metadata);
+
+ }
+ else{
+ //String[] metadata = new String[1];
+ //metadata[0] = "<nmwg:metadata id=\"empty\" />";
+ lsRegisterGenerator.setMetadataElements(new String[0]);
+ }
+
Message message = lsRegisterGenerator.generateRequestMessage();
return message;
Index: src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
===================================================================
--- src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java (revision 1721)
+++ src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java (working copy)
@@ -127,12 +127,18 @@
logger.debug("LSRegistrationComponent.runAction: "
+ "register to LS [" + lsURL + "] with file "
+ "[" + registrationFile + "]");
+
+ ServiceLSRegistrator registrator;
+
+ if (registrationFile != null && registrationFile.length() > 0){
+ registrator = new GenericServiceLSRegistrator(
+ new PropertiesServiceDescription(),
+ new InformationXMLFileServiceContent(registrationFile));
+ }else {
+ registrator = new GenericServiceLSRegistrator(
+ new PropertiesServiceDescription());
+ }
- ServiceLSRegistrator registrator =
- new GenericServiceLSRegistrator(
- new PropertiesServiceDescription(),
- new InformationXMLFileServiceContent(registrationFile));
-
registrator.initRegistrator();
responseMessage = registrator.register(lsURL);
@@ -168,7 +174,7 @@
//get interval - parameter "component.CName.interval"
int interval = LSRegistrationComponent.DEFAULT_RUN_INTERVAL;
-
+
try {
String intervalVal = configuration.getProperty(
@@ -232,7 +238,7 @@
public void setComponentName(String name) {
-
+
componentName = name;
}
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
--
--------------------------------------------------------------------
| Maciej Glowiak Network Research and Development ||
|
Poznan Supercomputing and Networking Center ||
| (+48 61) 858 2024 http://monstera.man.poznan.pl/ ||
====================================================================
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
------------------------------------------------------------------------
diff -Naur
src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java
src/org/perfsonar/service/commons/newregistration/GenericServiceLSRegistrator.java
---
src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java
2006-11-11 09:28:20.189965912 -0200
+++
src/org/perfsonar/service/commons/newregistration/GenericServiceLSRegistrator.java
2006-11-07 00:58:23.000000000 -0200
@@ -60,7 +60,13 @@
}
- + public GenericServiceLSRegistrator(
+ ServiceDescription sd) {
+ + serviceDescription = sd; + serviceContent = null;
+ + }
// ------------------------------------------------ Public methods
@@ -91,10 +97,8 @@
Message message = getLSRegisterRequestMessage();
- String result = XMLUtils.serializeXML(message);
//TODO: to remove
- logger.debug("GenericServiceLSRegistrator: request message:
"+result);
logger.debug("GenericServiceLSRegistrator: sending via Axis");
@@ -176,18 +180,24 @@
SystemException("error.common.lsregistrator.no_service_description",
"No service description");
- if (serviceContent==null) throw new - SystemException("error.common.lsregistrator.no_service_content",
- "No service content");
- Map commonParameters = serviceDescription.getServiceDescription();
- String[] metadata = serviceContent.getServiceContent();
LSRegisterRequestGenerator lsRegisterGenerator = new LSRegisterRequestGenerator();
lsRegisterGenerator.setCommonParameters(commonParameters);
- lsRegisterGenerator.setMetadataElements(metadata);
- +
+ if (serviceContent!=null) {
+
+ String[] metadata = serviceContent.getServiceContent();
+ lsRegisterGenerator.setMetadataElements(metadata);
+
+ }
+ else{
+ //String[] metadata = new String[1];
+ //metadata[0] = "<nmwg:metadata id=\"empty\" />";
+ lsRegisterGenerator.setMetadataElements(new String[0]);
+ }
+
Message message = lsRegisterGenerator.generateRequestMessage();
return message;
diff -Naur
src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
src/org/perfsonar/service/commons/newregistration/LSRegistrationComponent.java
---
src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
2006-11-11 09:28:20.192965456 -0200
+++
src/org/perfsonar/service/commons/newregistration/LSRegistrationComponent.java
2006-11-07 01:00:14.000000000 -0200
@@ -127,11 +127,17 @@
logger.debug("LSRegistrationComponent.runAction: "
+ "register to LS [" + lsURL + "] with file "
+ "[" + registrationFile + "]");
-
- ServiceLSRegistrator registrator =
- new GenericServiceLSRegistrator(
- new PropertiesServiceDescription(),
- new InformationXMLFileServiceContent(registrationFile));
+ + ServiceLSRegistrator registrator; + + if (registrationFile != null && registrationFile.length() > 0){
+ registrator = new GenericServiceLSRegistrator( + new PropertiesServiceDescription(), + new InformationXMLFileServiceContent(registrationFile));
+ }else {
+ registrator = new GenericServiceLSRegistrator( + new PropertiesServiceDescription());
+ }
registrator.initRegistrator();
@@ -168,7 +174,7 @@
//get interval - parameter "component.CName.interval"
int interval = LSRegistrationComponent.DEFAULT_RUN_INTERVAL;
-
+
try {
String intervalVal = configuration.getProperty(
@@ -232,7 +238,7 @@
public void setComponentName(String name) {
-
+
componentName = name;
}
--
--------------------------------------------------------------------
| Maciej Glowiak Network Research and Development ||
|
Poznan Supercomputing and Networking Center ||
| (+48 61) 858 2024 http://monstera.man.poznan.pl/ ||
====================================================================
- LS Registration Modifications, fernandes, 11/06/2006
- Message not available
- Message not available
- Re: LS Registration Modifications, Maciej Glowiak, 11/14/2006
- Message not available
- Message not available
Archive powered by MHonArc 2.6.16.