perfsonar-dev - perfsonar: r2483 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma playground plugins
Subject: perfsonar development work
List archive
perfsonar: r2483 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma playground plugins
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2483 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma playground plugins
- Date: Sun, 1 Jul 2007 08:56:53 -0400
Author: nina
Date: 2007-07-01 08:56:52 -0400 (Sun, 01 Jul 2007)
New Revision: 2483
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
Log:
Code cleanup - remove println statements
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
2007-07-01 12:53:08 UTC (rev 2482)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
2007-07-01 12:56:52 UTC (rev 2483)
@@ -21,7 +21,11 @@
package org.perfsonar.perfsonarui.ma;
import org.jdom.Namespace;
+import org.perfsonar.perfsonarui.AbstractMARequest;
+import org.perfsonar.perfsonarui.AbstractUserData;
+import org.perfsonar.perfsonarui.PSLogger;
import org.perfsonar.perfsonarui.plugins.ITimeValueResponse;
+import org.perfsonar.perfsonarui.plugins.IUserData;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -29,10 +33,12 @@
public class MARequestPerfsonar2_0 extends MARequest_NMWG2_Netutil {
public static String schemaID = "http://schemas.perfsonar.net/2.0";
protected static String URI_nmwgr =
"http://ggf.org/ns/nmwg/result/2.0/";
+
protected Namespace nmwgr = null;
public MARequestPerfsonar2_0() {
super();
+ logger = new PSLogger(MARequestPerfsonar2_0.class);
}
@Override
protected String getSelectEventType() {
@@ -54,10 +60,11 @@
protected synchronized void processData(Node data, UserData userData) {
//result code
NodeList datum =
((org.w3c.dom.Element)data).getElementsByTagNameNS(URI_nmwgr,"datum");
+
if (datum.getLength()>0)
for (int i=0; i < datum.getLength();i++) {
org.w3c.dom.Element d =
(org.w3c.dom.Element)datum.item(i);
- System.out.println(d.getTextContent());
+ logger.warn(">>\t" + userData.getId() + '\t'+
userData.getHostname(AbstractUserData.ID_RESPONSE) + '\t' +
d.getTextContent());
}
else
super.processData(data, userData);
@@ -69,7 +76,7 @@
if (datum.getLength()>0)
for (int i=0; i < datum.getLength();i++) {
org.w3c.dom.Element d =
(org.w3c.dom.Element)datum.item(i);
- System.out.println(d.getTextContent());
+ logger.warn(">>\t" + userData.getId() + '\t'+
userData.getHostname(AbstractUserData.ID_RESPONSE) + '\t' +
d.getTextContent());
}
else
super.processData(data, userData, timeValueResponse);
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
2007-07-01 12:53:08 UTC (rev 2482)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
2007-07-01 12:56:52 UTC (rev 2483)
@@ -680,7 +680,7 @@
//String timeValue = d.getAttribute(UserData.C_TIMEVALUE);
String value = d.getAttribute(UserData.C_VALUE);
- //System.out.println(value);
+
if ("bps".equals(d.getAttribute("valueUnits"))) multiplier =
1;
else multiplier = 8;
Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2007-07-01 12:53:08 UTC (rev 2482)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2007-07-01 12:56:52 UTC (rev 2483)
@@ -353,8 +353,10 @@
@Override
public void setResponse(String name, String value) {
+ /*
if ("eventType".equals(name))
System.out.println(name + "\t" + value);
+ */
if (name.equals(C_DIRECTION)) {
setDirection(value);
}
@@ -493,8 +495,10 @@
@Override
public void setQuery(String name, String value) {
+ /*
if ("eventType".equals(name))
System.out.println(name + "\t" + value);
+ */
if (C_DIRECTION.equals(name)) setDirection(value);
else super.setQuery(name, value);
}
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequest.java
2007-07-01 12:53:08 UTC (rev 2482)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequest.java
2007-07-01 12:56:52 UTC (rev 2483)
@@ -25,7 +25,7 @@
package org.perfsonar.perfsonarui.playground;
import java.io.IOException;
-import java.io.StringBufferInputStream;
+import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilder;
@@ -38,6 +38,7 @@
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MetaDataList;
import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
@@ -75,7 +76,7 @@
DocumentBuilder builder = factory.newDocumentBuilder();
if (o instanceof Document) return (Document)o;
else try {
- return builder.parse(new
StringBufferInputStream(o.toString()));
+ return builder.parse(new InputSource(new
StringReader(o.toString())));
} catch (Exception x) {
uData.setResponse(AbstractUserData.DOCUMENT_RESPONSE,
x.toString());
throw new Exception(x);
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
2007-07-01 12:53:08 UTC (rev 2482)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
2007-07-01 12:56:52 UTC (rev 2483)
@@ -109,11 +109,11 @@
try {
return readEndpoints(new
FileInputStream(file));
} catch (Exception x) {
- logger.error(x);
+ logger.error(x.getMessage());
try {
return readEndpoints(new
URL("http://perfsonar.acad.bg/MA.conf"));
} catch (Exception ex) {
- logger.error(ex);
+ logger.error(ex.getMessage());
try {
return readEndpoints();
} catch (Exception exx) {
@@ -172,7 +172,7 @@
list.add(endpoint);
endpoint.addObserver(this);
}
- //else System.out.println(endpoint.getRequestType()
+ " not supported");
+
}
}
reader.close();
- perfsonar: r2483 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma playground plugins, svnlog, 07/01/2007
Archive powered by MHonArc 2.6.16.