Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3615 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: flowsa flowsa/components test/ls

Subject: perfsonar development work

List archive

perfsonar: r3615 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: flowsa flowsa/components test/ls


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3615 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: flowsa flowsa/components test/ls
  • Date: Fri, 4 Apr 2008 08:42:02 -0400

Author: michael.bischoff
Date: 2008-04-04 08:42:01 -0400 (Fri, 04 Apr 2008)
New Revision: 3615

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Exporter.java
Removed:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Router.java
Modified:

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RouterPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/BusyAwareComponent.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQuery.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/ServiceQuery.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/Test.java
Log:
Refactored: renamed router -> exporter
Created Metadata test to test parsing of metadata for flowsama
added comments moved XML helper methods to utility class

Copied:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Exporter.java (from
rev 3595,
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Router.java)

Deleted: branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Router.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RouterPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RouterPanel.java
2008-04-04 12:35:16 UTC (rev 3614)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RouterPanel.java
2008-04-04 12:42:01 UTC (rev 3615)
@@ -15,7 +15,7 @@

import org.jdesktop.layout.GroupLayout;
import org.perfsonar.perfsonarui.flowsa.FlowsaMAUserData;
-import org.perfsonar.perfsonarui.flowsa.Router;
+import org.perfsonar.perfsonarui.flowsa.Exporter;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.ui.panels.CheckListModel;
import org.perfsonar.perfsonarui.ui.panels.CheckListSelectionListener;
@@ -53,12 +53,12 @@
}

private JComponent createRouterList(final FlowsaMAUserData model) {
- final CheckListModel<Router> checkListModel = new
DefaultCheckListModel<Router>();
- checkListModel.addItem(new
Router("xsr01.asd001a.surf.net","SURFnet6 Core Router Amsterdam1"));
- checkListModel.addItem(new
Router("xsr01.asd002a.surf.net","SURFnet6 Core Router Amsterdam2"));
- checkListModel.addItem(new
Router("xsr03.asd001a.surf.net","SURFnet6 Border Router Amsterdam1"));
- checkListModel.addItem(new
Router("xsr03.asd002a.surf.net","SURFnet6 Border Router Amsterdam2"));
- final JCheckList<Router> list = new
JCheckList<Router>(checkListModel);
+ final CheckListModel<Exporter> checkListModel = new
DefaultCheckListModel<Exporter>();
+ checkListModel.addItem(new
Exporter("xsr01.asd001a.surf.net","SURFnet6 Core Router Amsterdam1"));
+ checkListModel.addItem(new
Exporter("xsr01.asd002a.surf.net","SURFnet6 Core Router Amsterdam2"));
+ checkListModel.addItem(new
Exporter("xsr03.asd001a.surf.net","SURFnet6 Border Router Amsterdam1"));
+ checkListModel.addItem(new
Exporter("xsr03.asd002a.surf.net","SURFnet6 Border Router Amsterdam2"));
+ final JCheckList<Exporter> list = new
JCheckList<Exporter>(checkListModel);
model.addObserver(new Observer() {
private String oldEndPoint;

@@ -69,20 +69,20 @@
}
oldEndPoint = newEndpoint.getEndpoint();

checkListModel.clear();
- checkListModel.addItem(new
Router("xsr01.asd001a.surf.net","SURFnet6 Core Router Amsterdam1"));
- checkListModel.addItem(new
Router("xsr01.asd002a.surf.net","SURFnet6 Core Router Amsterdam2"));
- checkListModel.addItem(new
Router("xsr03.asd001a.surf.net","SURFnet6 Border Router Amsterdam1"));
- checkListModel.addItem(new
Router("xsr03.asd002a.surf.net","SURFnet6 Border Router Amsterdam2"));
+ checkListModel.addItem(new
Exporter("xsr01.asd001a.surf.net","SURFnet6 Core Router Amsterdam1"));
+ checkListModel.addItem(new
Exporter("xsr01.asd002a.surf.net","SURFnet6 Core Router Amsterdam2"));
+ checkListModel.addItem(new
Exporter("xsr03.asd001a.surf.net","SURFnet6 Border Router Amsterdam1"));
+ checkListModel.addItem(new
Exporter("xsr03.asd002a.surf.net","SURFnet6 Border Router Amsterdam2"));
if(checkListModel.getSize() > 0) {
- Router router = list.getItem(0);
+ Exporter router = list.getItem(0);
list.checkItem(router);
}
}
});
- list.addCheckListSelectionListener(new
CheckListSelectionListener<Router>() {
- public void selectionChanged(Router changedItem) {
+ list.addCheckListSelectionListener(new
CheckListSelectionListener<Exporter>() {
+ public void selectionChanged(Exporter changedItem) {
StringBuilder builder = new StringBuilder();
- for(Router item :
checkListModel.getCheckedItems()) {
+ for(Exporter item :
checkListModel.getCheckedItems()) {
builder.append(item.getHostName());
builder.append(" ");
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/BusyAwareComponent.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/BusyAwareComponent.java
2008-04-04 12:35:16 UTC (rev 3614)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/BusyAwareComponent.java
2008-04-04 12:42:01 UTC (rev 3615)
@@ -7,6 +7,13 @@
import javax.swing.JComponent;
import javax.swing.JLayeredPane;

+/**
+ * Decorates the supplied component and allows the component to show buzy
status.
+ *
+ * @author michael.bischoff
+ *
+ * @param <E> Type of the component which this component decorates
+ */
public class BusyAwareComponent<E extends JComponent> extends JLayeredPane {

private static final long serialVersionUID = 1L;
@@ -28,9 +35,9 @@
waitingPane = new WaitingPane(alphaColor);

decoratedComponent.setBounds(0, 0, getWidth(), getHeight());
- add(decoratedComponent,new Integer(1));
+ add(decoratedComponent,Integer.valueOf(1));
waitingPane.setBounds(0, 0, getWidth(), getHeight());
- add(waitingPane,new Integer(1));
+ add(waitingPane, Integer.valueOf(1));
}

@Override

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQuery.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQuery.java
2008-04-04 12:35:16 UTC (rev 3614)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQuery.java
2008-04-04 12:42:01 UTC (rev 3615)
@@ -12,8 +12,13 @@

import org.apache.axis.message.SOAPBodyElement;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;

+/**
+ * Base class for LS queries.
+ *
+ * @author michael.bischoff
+ *
+ */
public abstract class LSQuery {

private final static String XPATH_NAMESPACE_DECLARATIONS =
@@ -63,11 +68,11 @@
for (Node element : vector) {
if (element.getNodeType() == Node.ELEMENT_NODE) {
if
(element.getNodeName().endsWith("message")) {
- Node dataNode = getNodeFrom(element,
"data");
+ Node dataNode =
XML.getNodeFrom(element, "data");
if(dataNode!=null) {
- Node datumNode =
getNodeFrom(dataNode, "datum");
+ Node datumNode =
XML.getNodeFrom(dataNode, "datum");
if(datumNode!=null) {
- return
getTextFrom(datumNode);
+ return
XML.getTextFrom(datumNode);
}
}
}
@@ -75,33 +80,5 @@
}
return null;
}
-
- protected Node getNodeFrom(Node data, String nodeName) throws
UnmarshalException {
- NodeList nodes = data.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node element = nodes.item(i);
- if (element.getNodeType() == Node.ELEMENT_NODE) {
- if (element.getNodeName().equals(nodeName) ||
element.getNodeName().endsWith(":" + nodeName) ) {
- return element;
- }
- }
- }
- return null;
- }

- protected String getTextFrom(Node node) throws UnmarshalException {
- StringBuffer buf = new StringBuffer();
- NodeList nodes = node.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node n = nodes.item(i);
-
- if (n.getNodeType() == Node.TEXT_NODE) {
- buf.append(n.getNodeValue());
- } else {
- throw new UnmarshalException("Didn't expect
anything other then a text-node.");
- // expected a text-only node!
- }
- }
- return buf.toString();
- }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/ServiceQuery.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/ServiceQuery.java
2008-04-04 12:35:16 UTC (rev 3614)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/ServiceQuery.java
2008-04-04 12:42:01 UTC (rev 3615)
@@ -63,11 +63,11 @@
for (int i = 0; i < childern.getLength(); i++) {
Node child = childern.item(i);
if(child.getNodeName().endsWith("accessPoint")) {
- address = getTextFrom(child);
+ address = XML.getTextFrom(child);
} else
if(child.getNodeName().endsWith("serviceType")) {
- type = getTextFrom(child);
+ type = XML.getTextFrom(child);
} else
if(child.getNodeName().endsWith("serviceName")) {
- name = getTextFrom(child);
+ name = XML.getTextFrom(child);
} else {
//TODO handle
}

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/Test.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/Test.java
2008-04-04 12:35:16 UTC (rev 3614)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/Test.java
2008-04-04 12:42:01 UTC (rev 3615)
@@ -7,7 +7,6 @@

import javax.swing.DefaultListModel;
import javax.swing.JButton;
-import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JOptionPane;



  • perfsonar: r3615 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: flowsa flowsa/components test/ls, svnlog, 04/04/2008

Archive powered by MHonArc 2.6.16.

Top of Page