perfsonar-dev - LS Registration Modifications
Subject: perfsonar development work
List archive
- From:
- To: "" <>
- Cc: Loukik Kudarimoti <>, Roman Lapacz <>, Maciej Glowiak <>
- Subject: LS Registration Modifications
- Date: Tue, 07 Nov 2006 01:10:02 -0200
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.
- 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.