Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4651 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . flowsa linkstatus ls

Subject: perfsonar development work

List archive

perfsonar: r4651 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . flowsa linkstatus ls


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4651 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . flowsa linkstatus ls
  • Date: Wed, 22 Oct 2008 09:06:34 -0400

Author: michael.bischoff
Date: 2008-10-22 09:06:34 -0400 (Wed, 22 Oct 2008)
New Revision: 4651

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/PerfsonarSchema.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowsaMATab.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSEndpointsPanel.java
Log:
- Organised imports
- removed some use of deprecated api

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
2008-10-22 09:48:59 UTC (rev 4650)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
2008-10-22 13:06:34 UTC (rev 4651)
@@ -28,7 +28,6 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
-import java.util.Iterator;
import java.util.Observable;
import java.util.TimeZone;


Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
2008-10-22 09:48:59 UTC (rev 4650)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
2008-10-22 13:06:34 UTC (rev 4651)
@@ -82,7 +82,7 @@
}


- public PSLogger(Class classInst) {
+ public PSLogger(Class<?> classInst) {
this.logger = this;
//stackLength = DEFAULT_STACK_LENGTH;
this.classname = classInst.getName();
@@ -93,7 +93,7 @@
* uses the java.net.URLClassLoader. */
//if (false) throw new ClassNotFoundException(); // NOPMD

- log4jLogger = org.apache.log4j.Category.getInstance( classname );
+ log4jLogger = org.apache.log4j.Logger.getLogger( classname );
/*
} catch (ClassNotFoundException e) {
tostdout = true;

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/PerfsonarSchema.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/PerfsonarSchema.java
2008-10-22 09:48:59 UTC (rev 4650)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/PerfsonarSchema.java
2008-10-22 13:06:34 UTC (rev 4651)
@@ -41,10 +41,10 @@

protected static Hashtable<String,String> eventTypes2schema = null;
/**
- * @deprecated , will become protected. Use
{@link
#getInstance("your_schema")};
+ * Use
{@link
#getInstance("your_schema")};
* @param schema
*/
- public PerfsonarSchema(String schema) {
+ protected PerfsonarSchema(String schema) {
this.schema = schema.trim();
}
public String getSchema() {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowsaMATab.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowsaMATab.java
2008-10-22 09:48:59 UTC (rev 4650)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowsaMATab.java
2008-10-22 13:06:34 UTC (rev 4651)
@@ -126,15 +126,6 @@
};
}

- /**
- * Set's a new endpoint
- * @param endpoint
- */
- protected void setEndpoint(MAEndpoint endpoint) {
- getUserData().setQuery(FlowsaMAUserData.ROUTERS, "N/A");
- getUserData().setEndpoint(endpoint);
- }
-
/* (non-Javadoc)
* @see
org.perfsonar.perfsonarui.plugins.IPerfsonarTab#createMainComponent(java.awt.Component)
*/
@@ -209,6 +200,38 @@
return "FlowSA";
}

+ @Override
+ public synchronized SmartMARequest getRequest() {
+ return super.getRequest();
+ }
+
+ @Override
+ public void clear() {
+ dataList.clear();
+ searchList.clear();
+ searchText.clear();
+ getUserData().setDefaults();
+ }
+
+ @Override
+ public PerfsonarRequestAction createDataRequestAction() {
+ FlowsaMAResponse processor = new FlowsaMAResponse(getUserData());
+ return new
AbstractSetupDataRequestAction(request,processor,userData,"Query",null,defaultGroupQuery)
{
+ private static final long serialVersionUID = 1L;
+ @Override
+ public void done(Object result) { /* unused */}
+ };
+ }
+
+ /**
+ * Set's a new endpoint
+ * @param endpoint
+ */
+ protected void setEndpoint(MAEndpoint endpoint) {
+ getUserData().setQuery(FlowsaMAUserData.ROUTERS, "N/A");
+ getUserData().setEndpoint(endpoint);
+ }
+
/* (non-Javadoc)
* @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createSmartRequest()
*/
@@ -229,16 +252,6 @@
protected PerfsonarRequestAction createMetadataRequestAction() {
return null;
}
-
- @Override
- public PerfsonarRequestAction createDataRequestAction() {
- FlowsaMAResponse processor = new FlowsaMAResponse(getUserData());
- return new
AbstractSetupDataRequestAction(request,processor,userData,"Query",null,defaultGroupQuery)
{
- private static final long serialVersionUID = 1L;
- @Override
- public void done(Object result) { /* unused */}
- };
- }

/**
* Creates a new options Panel
@@ -277,16 +290,4 @@
return null;
}

- @Override
- public synchronized SmartMARequest getRequest() {
- return super.getRequest();
- }
-
- @Override
- public void clear() {
- dataList.clear();
- searchList.clear();
- searchText.clear();
- getUserData().setDefaults();
- }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
2008-10-22 09:48:59 UTC (rev 4650)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
2008-10-22 13:06:34 UTC (rev 4651)
@@ -9,20 +9,24 @@

package org.perfsonar.perfsonarui.linkstatus;

-import java.util.*;
-import java.io.*;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;

-import org.perfsonar.perfsonarui.*;
-import org.perfsonar.perfsonarui.plugins.*;
-import org.perfsonar.perfsonarui.ui.*;
-import org.perfsonar.perfsonarui.ui.actions.*;
-import org.perfsonar.perfsonarui.ui.panels.*;
-import org.perfsonar.perfsonarui.ma.*;
-import org.perfsonar.perfsonarui.playground.*;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.perfsonar.perfsonarui.AbstractUserData;
+import org.perfsonar.perfsonarui.PerfsonarSchema;
+import org.perfsonar.perfsonarui.UserDataResponseListener;
+import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
+import org.perfsonar.perfsonarui.plugins.IUserData;
+import org.perfsonar.perfsonarui.plugins.MAEndpoint;
+import org.perfsonar.perfsonarui.plugins.MAEndpointList;

-import org.jdom.*;
-import org.jdom.input.*;
-
/**
Sends a request to one or more status services about the
{@link
Status} of the

{@link
Link}s in the
{@link
Topology}. The results are returned in the form of
@@ -145,7 +149,7 @@
MAEndpoint statusEndpoint = new MAEndpoint();

statusEndpoint.setEndpoint(elementAccessPoint.getText());

statusEndpoint.setTitle(elementServiceDescription.getText());
- statusEndpoint.setSchema(new
PerfsonarSchema("status"));
+
statusEndpoint.setSchema(PerfsonarSchema.getInstance("status"));

statusEndpointMap.put(link, statusEndpoint);
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSEndpointsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSEndpointsPanel.java
2008-10-22 09:48:59 UTC (rev 4650)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSEndpointsPanel.java
2008-10-22 13:06:34 UTC (rev 4651)
@@ -13,6 +13,7 @@
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -27,6 +28,8 @@
import javax.swing.JSeparator;
import javax.swing.JTable;
import javax.swing.JTextField;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.CaretListener;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;
@@ -79,6 +82,7 @@
private Entry[] view = new Entry[0];
private Set<Entry> values = new HashSet<Entry>();
private List<TableModelListener> listeners = new
CopyOnWriteArrayList<TableModelListener>();
+ private String currentFilter;

public void addTableModelListener(TableModelListener l) {
listeners.add(l);
@@ -147,12 +151,27 @@
for(Service value : result) {
values.add(new Entry(value));
}
- view = values.toArray(new Entry[values.size()]);
- fireTableChanged();
+ filter(currentFilter);
}

public void filter(String value) {
- //TODO
+ this.currentFilter = value;
+
+ if(currentFilter == null || currentFilter.equals(""))
{
+ view = values.toArray(new
Entry[values.size()]);
+ } else {
+ this.currentFilter =
currentFilter.toLowerCase();
+ Set<Entry> set = new HashSet<Entry>(values);
+ for(Iterator<Entry> i = set.iterator();
i.hasNext();) {
+ Entry entry = i.next();
+
if(entry.service.getDescription().toLowerCase().contains(currentFilter)) {
+ continue;
+ }
+ i.remove();
+ }
+ view = set.toArray(new Entry[set.size()]);
+ }
+ fireTableChanged();
}
}

@@ -190,9 +209,14 @@
return layout;
}
protected JComponent createToolBar(LsEndpointsModel model) {
- JPanel panel = new JPanel(null);
- JLabel label = new JLabel("Filter:");
- JTextField filterField = new JTextField();
+ final JPanel panel = new JPanel(null);
+ final JLabel label = new JLabel("Filter:");
+ final JTextField filterField = new JTextField();
+ filterField.addCaretListener(new CaretListener() {
+ public void caretUpdate(CaretEvent e) {
+ myModel.filter(filterField.getText());
+ }
+ });
JSeparator separator = new JSeparator(VERTICAL);
JButton button = new JButton(new DiscoveryAction());




  • perfsonar: r4651 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . flowsa linkstatus ls, svnlog, 10/22/2008

Archive powered by MHonArc 2.6.16.

Top of Page