Skip to Content.
Sympa Menu

perfsonar-dev - r1888 - trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService

Subject: perfsonar development work

List archive

r1888 - trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService


Chronological Thread 
  • From:
  • To:
  • Subject: r1888 - trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService
  • Date: Mon, 8 Jan 2007 05:27:33 -0500

Author: mac
Date: 2007-01-08 05:27:32 -0500 (Mon, 08 Jan 2007)
New Revision: 1888

Modified:

trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService/LSRegisterRequestGenerator.java
Log:
LS Registration Component: Bug fix.
New error codes if service.r.access_point, service.r.service_type,
service.r.service_name are not present in service.properties.
The service.r.service_description setting is optional - if not present in
service.properties file, the <psservice:serviceDescription> tag in the
request won't be created.

Modified:
trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService/LSRegisterRequestGenerator.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService/LSRegisterRequestGenerator.java
2007-01-08 10:20:31 UTC (rev 1887)
+++
trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService/LSRegisterRequestGenerator.java
2007-01-08 10:27:32 UTC (rev 1888)
@@ -72,27 +72,52 @@

Service service = new Service();
service.setId("serviceParameters");
-
- //subject.setChild(service); //INCORRECT!
subject.addChild(service);

+ //access point -- mandatory
+ String
accessPointString=(String)commonParameters.get("access_point");
+ if (accessPointString==null) throw new SystemException(
+ "error.lsregistrator.no_accesspoint",
+ "AccessPoint parameter was not found. Registration failed");
+ if ("".equals(accessPointString)) throw new SystemException(
+ "error.lsregistrator.no_accesspoint",
+ "AccessPoint parameter was empty. Registration failed");
AccessPoint ap = new AccessPoint();
-
- ap.setAccessPoint((String)commonParameters.get("access_point"));
+ ap.setAccessPoint(accessPointString);
service.setAccessPoint(ap);

+ //service name -- mandatory
+ String
serviceNameString=(String)commonParameters.get("service_name");
+ if (serviceNameString==null) throw new SystemException(
+ "error.lsregistrator.no_servicename",
+ "ServiceName parameter was not found. Registration failed");
+ if ("".equals(serviceNameString)) throw new SystemException(
+ "error.lsregistrator.no_servicename",
+ "ServiceName parameter was empty. Registration failed");

ServiceName sn = new ServiceName();
- sn.setServiceName((String)commonParameters.get("service_name"));
+ sn.setServiceName(serviceNameString);
service.setServiceName(sn);

+ //service type -- mandatory
+ String
serviceTypeString=(String)commonParameters.get("service_type");
+ if (serviceTypeString==null) throw new SystemException(
+ "error.lsregistrator.no_servicetype",
+ "ServiceType parameter was not found. Registration failed");
+ if ("".equals(serviceTypeString)) throw new SystemException(
+ "error.lsregistrator.no_servicename",
+ "ServiceType parameter was empty. Registration failed");

ServiceType st = new ServiceType();
- st.setServiceType((String)commonParameters.get("service_type"));
+ st.setServiceType(serviceTypeString);
service.setServiceType(st);

- ServiceDescription sd = new ServiceDescription();
-
sd.setServiceDescription((String)commonParameters.get("service_description"));
- service.setServiceDescription(sd);
-
+ //service description -- optional
+ String
serviceDescString=(String)commonParameters.get("service_description");
+ if (serviceDescString==null) {
+ ServiceDescription sd = new ServiceDescription();
+ sd.setServiceDescription(serviceDescString);
+ service.setServiceDescription(sd);
+ }
+
//data fields

System.out.println("LSRegisterRequestGenerator: ");



  • r1888 - trunk/perfsonar/src/org/perfsonar/client/commons/requests/lookupService, svnlog, 01/08/2007

Archive powered by MHonArc 2.6.16.

Top of Page