Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2781 - branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus

Subject: perfsonar development work

List archive

perfsonar: r2781 - branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2781 - branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus
  • Date: Thu, 6 Sep 2007 15:05:25 -0400

Author: aaron
Date: 2007-09-06 15:05:24 -0400 (Thu, 06 Sep 2007)
New Revision: 2781

Modified:

branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/TopologyRequest.java
Log:
Changes to the Link Status plugin to handle the new topology schema.



Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
2007-09-06 12:26:35 UTC (rev 2780)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
2007-09-06 19:05:24 UTC (rev 2781)
@@ -217,7 +217,7 @@

//Construct the XQuery
strBuf.append(" declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\";\n";);
- strBuf.append(" declare namespace
nmtopo=\"http://ogf.org/schema/network/topology/base/20070707/\";\n";);
+ strBuf.append(" declare namespace
nmtopo=\"http://ogf.org/schema/network/topology/base/20070828/\";\n";);
strBuf.append(" for $data in
/nmwg:store/nmwg:data\n");
strBuf.append(" let $metadata_id :=
$data/@metadataIdRef\n");
strBuf.append(" where
$data//*:link[@id=\""
+ link.getId() + "\"] and
$data//nmwg:eventType[text()=\"http://ggf.org/ns/nmwg/characteristic/link/status/20070809\"]\n";);
@@ -232,4 +232,4 @@
strBuf.append("</nmwg:message>\n");
return strBuf.toString();
}
-}
\ No newline at end of file
+}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/TopologyRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/TopologyRequest.java
2007-09-06 12:26:35 UTC (rev 2780)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/TopologyRequest.java
2007-09-06 19:05:24 UTC (rev 2781)
@@ -183,13 +183,27 @@
else
{
Element
elementRemoteLinkId = getChildByLocalName(elementLink, "remoteLinkId");
-
if(elementRemoteLinkId == null) continue;
+ String linkId = "";

- String linkId =
elementRemoteLinkId.getText();
- String portId =
linkId.substring(0, linkId.lastIndexOf(':'));
+
if(elementRemoteLinkId != null) {
+ linkId =
elementRemoteLinkId.getText();
+ } else {
+
ArrayList<Element> relations = getChildrenByLocalName(elementLink,
"relation");
+ for(int q =
0; q < relations.size(); q++) {
+
Element relation = relations.get(q);
+ if
(relation.getAttribute("type").getValue().equals("sibling")) {
+
Element idRef = getChildByLocalName(relation, "idRef");
+
linkId = idRef.getText();
+ }
+ }
+ }

-
linkInfoHolder.portAId = port.getId();
-
linkInfoHolder.portBId = portId;
+ if
(linkId.compareTo("") != 0) {
+ String portId
= linkId.substring(0, linkId.lastIndexOf(':'));
+
+
linkInfoHolder.portAId = port.getId();
+
linkInfoHolder.portBId = portId;
+ }
}

linkInfoHolders.add(linkInfoHolder);
}
@@ -272,7 +286,9 @@
{
int colon = id.lastIndexOf(':');
if(colon == -1) return decodeUri(id);
- return decodeUri(id.substring(colon + 1));
+ String last_field = id.substring(colon + 1);
+ int equals = last_field.indexOf('=');
+ return decodeUri(last_field.substring(equals + 1));
}

private String decodeUri(String uri)
@@ -350,7 +366,8 @@
}
catch(Exception e)
{
- System.out.println("TopologyRequest.makeRequest\n" +
e);
+ System.out.println("Parsing of resulting request
failed: \n" + e );
+ System.out.println("Document returned: \"" + strDoc +
"\"");
}
return null;
}
@@ -381,4 +398,4 @@
public String name;
public ArrayList<String> linkIds;
}
-}
\ No newline at end of file
+}



  • perfsonar: r2781 - branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus, svnlog, 09/06/2007

Archive powered by MHonArc 2.6.16.

Top of Page