Skip to Content.
Sympa Menu

perfsonar-dev - r1770 - trunk/perfsonar/src/org/perfsonar/service/commons/registration

Subject: perfsonar development work

List archive

r1770 - trunk/perfsonar/src/org/perfsonar/service/commons/registration


Chronological Thread 
  • From:
  • To:
  • Subject: r1770 - trunk/perfsonar/src/org/perfsonar/service/commons/registration
  • Date: Tue, 21 Nov 2006 12:53:58 -0500

Author: fernandes
Date: 2006-11-21 12:53:57 -0500 (Tue, 21 Nov 2006)
New Revision: 1770

Modified:

trunk/perfsonar/src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java

trunk/perfsonar/src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
Log:
Changes to make LS register with no registration file (using only service.r
parameters)



Modified:
trunk/perfsonar/src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java
2006-11-21 16:49:35 UTC (rev 1769)
+++
trunk/perfsonar/src/org/perfsonar/service/commons/registration/GenericServiceLSRegistrator.java
2006-11-21 17:53:57 UTC (rev 1770)
@@ -60,7 +60,6 @@

}

-
// ------------------------------------------------ Public methods


@@ -91,10 +90,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 +173,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;

Modified:
trunk/perfsonar/src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
2006-11-21 16:49:35 UTC (rev 1769)
+++
trunk/perfsonar/src/org/perfsonar/service/commons/registration/LSRegistrationComponent.java
2006-11-21 17:53:57 UTC (rev 1770)
@@ -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(), null);
+ }

- 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;

}



  • r1770 - trunk/perfsonar/src/org/perfsonar/service/commons/registration, svnlog, 11/21/2006

Archive powered by MHonArc 2.6.16.

Top of Page