Skip to Content.
Sympa Menu

perfsonar-dev - [GEANT/SA2/ps-java-services] r5585 - trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice

Subject: perfsonar development work

List archive

[GEANT/SA2/ps-java-services] r5585 - trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice


Chronological Thread 
  • From:
  • To:
  • Subject: [GEANT/SA2/ps-java-services] r5585 - trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice
  • Date: Wed, 7 Apr 2010 14:44:56 +0100

Author: psnc.trzaszczka
Date: 2010-04-07 14:44:56 +0100 (Wed, 07 Apr 2010)
New Revision: 5585

Modified:

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
Log:
DiscoveryRequest processing improved -PSSERVICES-479

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
2010-04-07 13:15:34 UTC (rev 5584)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
2010-04-07 13:44:56 UTC (rev 5585)
@@ -15,6 +15,7 @@
public class DiscoveryQueryGenerator {

private Element discoverySubject = null;
+ public static final String nmtbUri =
"http://ogf.org/schema/network/topology/base/20070828/";;
private boolean extracted = false;
private HashSet<String> ipAddresses = new HashSet<String>();
private HashSet<String> domains = new HashSet<String>();
@@ -44,35 +45,43 @@

for (Element e : discoverySubject.getChildren()) {
String elementName = e.getName();
- if (elementName.equals("address")) {
- addIpAddress(e);
+ String namespaceUri=e.getNamespaceUri();
+
+ if (namespaceUri.equals(nmtbUri)) {
+ if (elementName.equals("address")) {
+ addIpAddress(e);

- } else if (elementName.equals("domain")) {
- addDomain(e);
+ } else if
(elementName.equals("domain")) {
+ addDomain(e);

- } else if (elementName.equals("eventType")) {
- addEventType(e);
+ } else if
(elementName.equals("eventType")) {
+ addEventType(e);

- } else if (elementName.equals("parameters")) {
+ } else if
(elementName.equals("parameters")) {

- Collection<Element> params =
e.getChildren("parameter");
- if (params != null) {
- for (Element p : params) {
+ Collection<Element> params =
e.getChildren("parameter");
+ if (params != null) {
+ for (Element p :
params) {

- String name =
p.getAttribute("name");
- String value =
p.getText();
+ String name =
p.getAttribute("name");
+ String value
= p.getText();

- if (value != null) {
- value =
value.trim();
- if
("keyword".equals(name)) {
-
keywords.add(value);
- } else if
("eventType".equals(name)) {
-
eventTypes.add(value);
+ if (value !=
null) {
+ value
= value.trim();
+ if
("keyword".equals(name)) {
+
keywords.add(value);
+ }
else if ("eventType".equals(name)) {
+
eventTypes.add(value);
+ }
}
}
+
}
-
+ }else{
+ throw new
PerfSONARException("error.ls.query","Unsupported element :"+elementName);
}
+ }else{
+ throw new
PerfSONARException("error.ls.query","Unsupported namespace :"+namespaceUri);
}
}
}
@@ -128,7 +137,7 @@
// add for expression
q.append("for $d in
/nmwg:store[@type='LSStore']/nmwg:data
\n");
if (!ipAddresses.isEmpty() || !domains.isEmpty() ||
!keywords.isEmpty()
- || !!eventTypes.isEmpty()) {
+ || !eventTypes.isEmpty()) {

// generate query conditions
q.append("where \n");



  • [GEANT/SA2/ps-java-services] r5585 - trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice, svn-noreply, 04/07/2010

Archive powered by MHonArc 2.6.16.

Top of Page