perfsonar-dev - perfsonar: r3884 - branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r3884 - branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl
- Date: Tue, 27 May 2008 12:19:42 -0400
Author: verena
Date: 2008-05-27 12:19:42 -0400 (Tue, 27 May 2008)
New Revision: 3884
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTL-Request-template.xml
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
Log:
Changed BWCTLRequest.java and BWCTL-Request-template.xml to
represent current iperf/bwctl schema. New BWCTL MP services
are implementing these, which made the change necessary.
Old services should be updated.
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTL-Request-template.xml
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTL-Request-template.xml
2008-05-27 15:47:37 UTC (rev 3883)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTL-Request-template.xml
2008-05-27 16:19:42 UTC (rev 3884)
@@ -1,29 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<nmwg:message type="SetupDataRequest"
- id="datarq2-1"
- xmlns="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"
-
xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"
+ id="bwctl-request"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"
xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/"
- xmlns:select="http://ggf.org/ns/nmwg/ops/select/2.0/"
+ xmlns:bwctl="http://ggf.org/ns/nmwg/tools/bwctl/2.0/"
+ xmlns:iperf="http://ggf.org/ns/nmwg/tools/iperf/2.0/"
xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/">
- <nmwg:metadata id="meta1">
- <perfsonar:subject id="subj1">
+ <nmwg:metadata id="bwctl-metadata">
+ <bwctl:subject id="bwctl-subject">
+ <nmwgt:endPoint type="ipv4" value="131.188.81.12"/>
+ </bwctl:subject>
+
+ <nmwg:eventType>http://ggf.org/ns/nmwg/tools/bwctl/2.0/</nmwg:eventType>
+ <bwctl:parameters id="bwctl-parameters">
+ </bwctl:parameters>
+ </nmwg:metadata>
+
+ <nmwg:metadata id="iperf-metadata">
+ <iperf:subject id="iperf-subject" metadataIdRef="bwctl-metadata">
<nmwgt:endPointPair>
<nmwgt:src type="ipv4" value="131.188.81.61"/>
- <nmwgt:dst type="ipv4" value="131.188.81.21"/>
+ <nmwgt:dst type="ipv4" value="131.188.81.12"/>
</nmwgt:endPointPair>
- </perfsonar:subject>
-
- <nmwg:eventType>bwctl</nmwg:eventType>
- <nmwg:parameters id="param1">
- </nmwg:parameters>
+ </iperf:subject>
+ <iperf:parameters id="iperf-parameters">
+ </iperf:parameters>
+ <nmwg:eventType>http://ggf.org/ns/nmwg/tools/iperf/2.0/</nmwg:eventType>
</nmwg:metadata>
<!-- triggers to indicate head of chains -->
- <nmwg:data id="1" metadataIdRef="meta1"/>
+ <nmwg:data id="1" metadataIdRef="iperf-metadata"/>
</nmwg:message>
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
2008-05-27 15:47:37 UTC (rev 3883)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
2008-05-27 16:19:42 UTC (rev 3884)
@@ -27,6 +27,13 @@
public static final String REQUEST_TYPE = "bwctl";
public static final String XML_TEMPLATE =
"org/perfsonar/perfsonarui/bwctl/BWCTL-Request-template.xml";
+/*
+ protected static String[][] URI_nmwgt =
{{"nmwgt","http://ggf.org/ns/nmwg/topology/2.0/"}};
+ protected static String[][] URI_nmwg =
{{"nmwg","http://ggf.org/ns/nmwg/base/2.0/"}};
+ protected static String[][] URI_nmwgm =
{{"nmwgm","http://ggf.org/ns/nmwg/time/2.0/"}};
+ protected static String[][] URI_bwctl =
{{"bwctl","http://ggf.org/ns/nmwg/tools/bwctl/2.0/"}};
+ protected static String[][] URI_iperf =
{{"iperf","http://ggf.org/ns/nmwg/tools/iperf/2.0/"}};
+*/
private BWCTLMainComponent mainComponent;
public BWCTLRequest(BWCTLMainComponent pane) {
@@ -85,13 +92,13 @@
mainComponent.getAddressType(), request, "dst");
protocol = mainComponent.getProtocol();
- setQueryParameter("protocol", protocol, request);
+ setQueryParameter("protocol", protocol, "iperf", request);
if (protocol.equals("TCP"))
{
parameter = mainComponent.windowSize.getText();
if (! parameter.equals(""))
{
- setQueryParameter("windowSize", parameter,
+ setQueryParameter("windowSize", parameter,
"iperf",
request);
}
}
@@ -101,14 +108,14 @@
parameter = mainComponent.bufferSize.getText();
if (! parameter.equals(""))
{
- setQueryParameter("bufferSize", parameter,
+ setQueryParameter("bufferSize", parameter,
"iperf",
request);
}
parameter = mainComponent.bandwidth.getText();
if (! parameter.equals(""))
{
- setQueryParameter("bandwidth", parameter,
+ setQueryParameter("bandwidth", parameter,
"iperf",
request);
}
}
@@ -116,19 +123,19 @@
parameter = mainComponent.duration.getText();
if (! parameter.equals(""))
{
- setQueryParameter("duration", parameter, request);
+ setQueryParameter("duration", parameter, "bwctl",
request);
}
parameter = mainComponent.interval.getText();
if (! parameter.equals(""))
{
- setQueryParameter("interval", parameter, request);
+ setQueryParameter("interval", parameter, "iperf",
request);
}
parameter = mainComponent.tos.getText();
if (! parameter.equals(""))
{
- setQueryParameter("TOS", parameter, request);
+ setQueryParameter("TOS", parameter, "iperf", request);
}
/* Login/Password are joined together, always send both
@@ -137,10 +144,11 @@
parameter = mainComponent.login.getText();
if (! parameter.equals(""))
{
- setQueryParameter("login", parameter, request);
- setQueryParameter("password", new
String(mainComponent.password.getPassword()), request);
+ setQueryParameter("login", parameter, "bwctl",
request);
+ setQueryParameter("password", new
String(mainComponent.password.getPassword()), "bwctl", request);
}
-
+ mainComponent.requestfield.setText("");
+ mainComponent.requestfield.setText(dumpXML(request));
return request;
}
@@ -182,7 +190,7 @@
{
data = (Element) datas.item(i);
eventType = data.getTextContent();
- if (eventType.startsWith("failure")) break;
+ if (eventType.startsWith("error")) break;
eventType = null;
}
if (eventType != null)
@@ -198,13 +206,15 @@
String xmlId;
data = (Element) datas.item(i);
+
xmlId = data.getAttribute("id");
if ((xmlId == null) ||
- (! xmlId.equals("data_return")))
+ (!
xmlId.equals("data_return_iperf-metadata")))
{
continue;
}
-
+
+
datums = data.getElementsByTagName(
"nmwg:datum");
/* Free text response? */
@@ -242,7 +252,7 @@
for (i = 0; i < datas.getLength(); i++)
{
data = (Element) datas.item(i);
- datums = data.getElementsByTagName("nmwg:datum");
+ datums = data.getElementsByTagName("iperf:datum");
for (j = 0; j < datums.getLength(); j++)
{
datum = (Element) datums.item(j);
@@ -345,4 +355,34 @@
parameterRoot.appendChild(parameterElement);
}
+
+
+ private void setQueryParameter(String name, String value, String ns,
+ Document request)
+ {
+ NodeList nodes;
+ Element parameterRoot;
+ Element parameterElement;
+
+ String nsParameters = ns + ":parameters";
+
+ if ((name == null) || (value == null) || (request == null))
+ {
+ return;
+ }
+
+ nodes = request.getElementsByTagName(nsParameters);
+ if (nodes.getLength() != 1)
+ {
+ /* Malformed request template */
+ return;
+ }
+ parameterRoot = (Element) nodes.item(0);
+
+ parameterElement = request.createElementNS("nmwg",
"nmwg:parameter");
+ parameterElement.setAttribute("name", name);
+ parameterElement.setAttribute("value", value);
+
+ parameterRoot.appendChild(parameterElement);
+ }
}
- perfsonar: r3884 - branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl, svnlog, 05/27/2008
Archive powered by MHonArc 2.6.16.