Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4633 - in branches/perfsonarui: ant src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/bwctl src/org/perfsonar/perfsonarui/demo src/org/perfsonar/perfsonarui/flowsa src/org/perfsonar/perfsonarui/ippm src/org/perfsonar/perfsonarui/ippm/ui/actions src/org/perfsonar/perfsonarui/ippm/ui/panels src/org/perfsonar/perfsonarui/linkstatus src/org/perfsonar/perfsonarui/lookingglass src/org/perfsonar/perfsonarui/ls src/org/perfsonar/perfsonarui/ma src/org/perfsonar/perfsonarui/ma/ui/actions src/org/perfsonar/perfsonarui/ma/ui/panels src/org/perfsonar/perfsonarui/playground src/org/perfsonar/perfsonarui/plugins src/org/perfsonar/perfsonarui/test src/org/perfsonar/perfsonarui/test/ls src/org/perfsonar/perfsonarui/test/ma src/org/perfsonar/perfsonarui/test/plugins src/org/perfsonar/perfsonarui/ui src/org/perfsonar/perfsonarui/ui/actions src/org/perfsonar/perfsonarui/ui/panels

Subject: perfsonar development work

List archive

perfsonar: r4633 - in branches/perfsonarui: ant src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/bwctl src/org/perfsonar/perfsonarui/demo src/org/perfsonar/perfsonarui/flowsa src/org/perfsonar/perfsonarui/ippm src/org/perfsonar/perfsonarui/ippm/ui/actions src/org/perfsonar/perfsonarui/ippm/ui/panels src/org/perfsonar/perfsonarui/linkstatus src/org/perfsonar/perfsonarui/lookingglass src/org/perfsonar/perfsonarui/ls src/org/perfsonar/perfsonarui/ma src/org/perfsonar/perfsonarui/ma/ui/actions src/org/perfsonar/perfsonarui/ma/ui/panels src/org/perfsonar/perfsonarui/playground src/org/perfsonar/perfsonarui/plugins src/org/perfsonar/perfsonarui/test src/org/perfsonar/perfsonarui/test/ls src/org/perfsonar/perfsonarui/test/ma src/org/perfsonar/perfsonarui/test/plugins src/org/perfsonar/perfsonarui/ui src/org/perfsonar/perfsonarui/ui/actions src/org/perfsonar/perfsonarui/ui/panels


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4633 - in branches/perfsonarui: ant src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/bwctl src/org/perfsonar/perfsonarui/demo src/org/perfsonar/perfsonarui/flowsa src/org/perfsonar/perfsonarui/ippm src/org/perfsonar/perfsonarui/ippm/ui/actions src/org/perfsonar/perfsonarui/ippm/ui/panels src/org/perfsonar/perfsonarui/linkstatus src/org/perfsonar/perfsonarui/lookingglass src/org/perfsonar/perfsonarui/ls src/org/perfsonar/perfsonarui/ma src/org/perfsonar/perfsonarui/ma/ui/actions src/org/perfsonar/perfsonarui/ma/ui/panels src/org/perfsonar/perfsonarui/playground src/org/perfsonar/perfsonarui/plugins src/org/perfsonar/perfsonarui/test src/org/perfsonar/perfsonarui/test/ls src/org/perfsonar/perfsonarui/test/ma src/org/perfsonar/perfsonarui/test/plugins src/org/perfsonar/perfsonarui/ui src/org/perfsonar/perfsonarui/ui/actions src/org/perfsonar/perfsonarui/ui/panels
  • Date: Mon, 20 Oct 2008 09:46:17 -0400

Author: nina
Date: 2008-10-20 09:46:17 -0400 (Mon, 20 Oct 2008)
New Revision: 4633

Added:

branches/perfsonarui/src/org/perfsonar/perfsonarui/PSNotConfiguredTypeException.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/Metric.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/Batch.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/EventType.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/plugins/BatchTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/plugins/MAEndpointTest.java
Removed:

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MACombinedRequest.java
Modified:
branches/perfsonarui/ant/build.xml
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractUserData.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/EmptyMARequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/PSErrorCodeException.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSException.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/RequestInterruptedException.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/UnsupportedTypeException.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/RTTRequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson2.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson3.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson4.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/AbstractSetupDataRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMPerfsonarModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMRequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/actions/IPPMMetadataKeyRequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/panels/IPPMResponseChartPanel.java

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

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

branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGRequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGSetupDataRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/MetadataKeyRequestAction.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSQueryMetadata.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/Lookup.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UpdateListResponseListener.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/MASetupDataRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SearchByIPAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRefreshActionAll.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRetrieveAllAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetricsOptionPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IPerfsonarRequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IUserData.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpoint.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MetaDataList.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/UnsupportedSchemaException.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/MARequest_NMWG2_Test.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/SmartMARequestTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/UserDataTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/GlobalLSTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSDiscoveryTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQueryMetadataTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/TracerouteTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/EchoAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/MetadataRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/MAEndpointsPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/ResponseChartPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/UserDataDetailsPane.java
Log:
Implementation of multiple metrics support.

Major changes in API!

- IUserData can be assigned more than one MAEndpoint. This is useful when
retrieving data for the same node (e.g. IP) from multiple
services/eventtypes
- IUserData.getEndpoint() doesn not exist anymore.
- It is replaced by Iterable<MAEndpoint> IUserData.getEndpoints() , which
allows to iterate over multiple endpoints, assigned to the IUserData
- IUserData.setEndpoint() is deprecated and might be removed in future. The
current behavior is to clear the list of endpoints and add one single
MAEndpoint
- IUserData.addEndpoint() is a new method, allowing to add multiple endpoints

- IPerfsonarRequest has an additional function,
public void makeRequest(MAEndpoint endpoint, IUserData uData, String
messageType, IPerfsonarResponse response, boolean runInThread) ;
The default implementation of the existing version of makeRequest
public void makeRequest(IUserData uData, String messageType,
IPerfsonarResponse response, boolean runInThread) ;
is to iterate over data.getEndpoints() and to call the new
makeRequest(endpoint, data,...) method.

The default implementation class AbstractMARequest implements these two
methods and usually it is sufficient for the descendant classes to implement
only createRequest method, which constructs the XML message. Overriding
makeRequest might broke sending messages in threads and authentication
support.



Modified: branches/perfsonarui/ant/build.xml
===================================================================
--- branches/perfsonarui/ant/build.xml 2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/ant/build.xml 2008-10-20 13:46:17 UTC (rev 4633)
@@ -22,7 +22,7 @@
-->
<project basedir="../" default="all" name="perfsonar">

- <property name="version" value="0.13" />
+ <property name="version" value="0.14" />
<!-- compile options -->
<property name="build.sysclasspath" value="ignore" />
<property name="build.compiler" value="modern" />

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -24,6 +24,7 @@
import java.beans.PropertyChangeSupport;
import java.io.StringReader;
import java.io.StringWriter;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
@@ -86,7 +87,22 @@
protected Call call;

protected SOAPBodyElement requestMessage;
- protected IUserData query;
+ protected MAEndpoint active_endpoint;
+
+ public MAEndpoint getActive_endpoint() {
+ return active_endpoint;
+ }
+ public void setActive_endpoint(MAEndpoint active_endpoint) throws
ServiceException, MalformedURLException {
+ this.active_endpoint = active_endpoint;
+ if (call == null) {
+ call = (Call)service.createCall();
+ }
+ call.setTargetEndpointAddress(new
URL(active_endpoint.getEndpoint()));
+ call.setOperationName(new QName(URI_SOAP,"submit"));
+
+ }
+
+ protected IUserData query;
protected MetaDataList queries;

protected int timeout = 300000;
@@ -236,23 +252,29 @@
return null;
}
/**
+ * Runs requests for all endpoints associated with IUserData
sequentially.
+ */
+ public void makeRequest(IUserData uData, String messageType,
IPerfsonarResponse response, boolean runInThread) {
+ if (runInThread)
+ logger.warn("Running requests sequentially");
+ for (MAEndpoint e: uData.getEndpoints())
+ makeRequest(e, uData, messageType, response, false);
+ }
+ /**
* See
{@link
IPerfsonarRequest#makeRequest(IUserData, String, IPerfsonarResponse,
boolean)}.
*/
- public void makeRequest(IUserData uData, String messageType,
IPerfsonarResponse response, boolean runInThread) {
+ public void makeRequest(MAEndpoint endpoint, IUserData uData,
+ String messageType, IPerfsonarResponse response,
boolean runInThread) {
+
try {
addPropertyChangeListener(response);
fireAxisCallInitiated(uData);
- if (call == null) {
- call = (Call)service.createCall();
-
- }
+
if (uData == null)
throw new Exception("IUserData not assigned - null");
- if (uData.getEndpoint() == null)
- throw new Exception("Endpoint not assigned - null");

- //Call call = (Call)service.createCall();
- call.setTargetEndpointAddress(new
URL(uData.getEndpoint().getEndpoint()));
- call.setOperationName(new QName(URI_SOAP,"submit"));
+ if (endpoint == null)
+ throw new Exception("Endpoint not assigned - null");
+ setActive_endpoint(endpoint);

Document request = createRequest(uData,messageType);
// build a SOAPBodyElement from the document
@@ -261,7 +283,7 @@
query = uData;
queries = null;
if (runInThread) {
- Thread t = new
Thread(this,uData.getEndpoint().getTitle());
+ Thread t = new Thread(this,endpoint.getTitle());
t.start();
} else run();
} catch (Exception x) {
@@ -278,13 +300,10 @@

addPropertyChangeListener(response);
fireAxisCallInitiated(queryList.get(0));
- if (call == null) {
- call = (Call)service.createCall();
-
- }
- //Call call = (Call)service.createCall();
- call.setTargetEndpointAddress(new
URL(endpoint.getEndpoint()));
- call.setOperationName(new QName(URI_SOAP,"submit"));
+ if (endpoint == null)
+ throw new Exception("Endpoint not assigned - null");
+
+ setActive_endpoint(endpoint);

Document request =
createRequest(endpoint,queryList,messageType);

@@ -295,7 +314,7 @@
queries = queryList;

if (runInThread) {
- Thread t = new
Thread(this,query.getEndpoint().getEndpoint());
+ Thread t = new Thread(this,endpoint.toString());
t.start();
} else run();
} catch (Exception x) {
@@ -314,7 +333,7 @@
// call on the end point
Object resultObject = null;
try{
- logger.debug("Sending request to\t" +
query.getEndpoint());
+ logger.debug("Sending request to\t" +
getActive_endpoint());
logger.debug(requestMessage);
//call.setTimeout(new Integer(1800000)); //30 min

@@ -399,7 +418,7 @@
public synchronized void interrupt() {
setInterrupted(true);
setTimeout(0);
- fireAxisCallException(query, new
RequestInterruptedException(query,"Request interrupted"));
+ fireAxisCallException(query, new
RequestInterruptedException(getActive_endpoint(),"Request interrupted"));
PropertyChangeListener[] listeners =
propertyChangeSupport.getPropertyChangeListeners();
for (int i=0; i < listeners.length; i++)
removePropertyChangeListener(listeners[i]);
@@ -450,11 +469,9 @@
Node eventType =
metadata.getElementsByTagNameNS(NMWG2,"eventType").item(0);
if (eventType != null) {
String event = eventType.getFirstChild().getNodeValue();
- if (event.startsWith("error.")) {
+ if (event.startsWith("error.") ||
event.startsWith("warning.")) {
if (exception == null) {
- MAEndpoint endpoint = null;
- if (userData != null) endpoint =
userData.getEndpoint();
- exception = new
PSErrorCodeException(endpoint,null,null);
+ exception = new
PSErrorCodeException(getActive_endpoint(),null,null);
}
exception.setErrorCode(event);
logger.error(event);
@@ -467,11 +484,7 @@
org.w3c.dom.Element d =
(org.w3c.dom.Element)datum.item(i);
String description = d.getTextContent();
if (exception == null) {
- MAEndpoint endpoint = null;
- if (userData != null) endpoint =
userData.getEndpoint();
- if (exception == null)
- exception = new
PSErrorCodeException(endpoint,null,null);
- exception.setMaEndpoint(endpoint);
+ exception = new
PSErrorCodeException(getActive_endpoint(),null,null);
}
exception.setErrordescription(description);
//logger.warn(">>\t" + userData.getId() + '\t'+
userData.getHostname(AbstractUserData.ID_RESPONSE) + '\t' +
d.getTextContent());

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractUserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractUserData.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractUserData.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -27,6 +27,7 @@

import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
+import org.perfsonar.perfsonarui.plugins.MAEndpointList;
import org.w3c.dom.Document;

/**
@@ -47,12 +48,12 @@
public static String START_TIME = "Start time";
public static String END_TIME = "End time";
public static String RESOLUTION = "Resolution";
- public static String DOMAIN = "Domain";
public static String DOCUMENT_RESPONSE = "DOCUMENT_RESPONSE";
public static String DOCUMENT_QUERY = "DOCUMENT_QUERY";

public QueryResponse qr;
- protected MAEndpoint maData = null;
+ //protected MAEndpoint maData = null;
+ protected MAEndpointList endpoints;
protected String startTimeKey = START_TIME;
protected String endTimeKey = END_TIME;
protected int num = -1;
@@ -66,7 +67,7 @@
*/
public AbstractUserData() {
super();
- maData = null;//new MAEndpoint("Service address not
assigned,,,,,");
+ endpoints = new MAEndpointList(false);
qr = new QueryResponse();
}
/**
@@ -87,30 +88,52 @@
qr.clearResponse();
}
/**
+ *
+ */
+ public Iterable<MAEndpoint> getEndpoints() {
+ return endpoints;
+ }
+ /**
* return
{@link
MAEndpoint} of the query.
+ * @deprecated use
{@link
#getEndpoints()}
*/
public MAEndpoint getEndpoint() {
- return maData;
+ if (endpoints.size() == 0)
+ return null;
+ else return endpoints.get(0);
}
+
/**
+ * Clears the list of endpoints and adds the argument as the only
element
* See
{@link
IUserData#setEndpoint(MAEndpoint)}
*/
public void setEndpoint(MAEndpoint endpoint) {
- if (endpoint==null) maData =null;
- else {
- if (maData == null)
- maData = new MAEndpoint("Service address not assigned,,,,,");
+ endpoints.clear();
+ addEndpoint(endpoint);
+ }
+ /**
+ * Adds an endpoint.
+ */
+ public void addEndpoint(MAEndpoint endpoint) {
+ if (endpoint!=null) {
+ MAEndpoint maData = new MAEndpoint("Service address not
assigned,,,,,");
maData.setTitle(endpoint.getTitle());
maData.setEndpoint(endpoint.getEndpoint());
maData.setSchema(endpoint.getSchema());
maData.setAuthRealm(endpoint.getAuthRealm());
- maData.setEvent(endpoint.getEvent(0),0);
- maData.setEvent(endpoint.getEvent(1),1);
-
- }
- setChanged();
- notifyObservers(maData);
+ maData.setEvent(endpoint.getEvent());
+ endpoints.add(maData);
+ setChanged();
+ notifyObservers(maData);
+ } else {
+ setChanged();
+ notifyObservers(endpoint);
+ }
}
+ public void removeEndpoint(MAEndpoint endpoint) {
+ endpoints.remove(endpoint);
+
+ }
public void setResponse(Document document) {
if (document == null) qr.putResponse(DOCUMENT_RESPONSE,
NULL_DATA);
else qr.putResponse(DOCUMENT_RESPONSE, document);
@@ -139,9 +162,19 @@
return qr.getQuery(name);
}
public String getResponse(String name) {
- if (DOMAIN.equals(name)) return getEndpoint().getTitle();
+ if (DOMAIN.equals(name)) return getDomain();
return qr.getResponse(name);
}
+ public String getDomain() {
+ Iterable<MAEndpoint> endpoints = getEndpoints();
+ if (endpoints == null) return "Unknown";
+ ArrayList<String> b = new ArrayList<String>();
+ for (MAEndpoint e : endpoints) {
+ if (b.indexOf(e.getTitle())==-1)
+ b.add(e.getTitle());
+ }
+ return b.toString();
+ }
public void put(int index, Object key,Object value) {
qr.put(index,key,value);
setChanged();
@@ -181,7 +214,11 @@
public void assign(IUserData userData) {
if (userData instanceof AbstractUserData)
qr.assign(((AbstractUserData)userData).qr);
- setEndpoint(userData.getEndpoint());
+ if (endpoints == null)
+ endpoints = new MAEndpointList();
+ else endpoints.clear();
+ for (MAEndpoint e : userData.getEndpoints())
+ endpoints.add(e);
setChanged();
notifyObservers();
}
@@ -222,7 +259,7 @@
public void lastWeek() {
lastSeconds(7*24*60*60);
}
- public int compareTo(Object arg0) {
+ public int compareTo(IUserData arg0) {
return 1;
}


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/EmptyMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/EmptyMARequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/EmptyMARequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -44,7 +44,7 @@
// call on the end point
Object resultObject = null;
try{
- logger.debug("Sending request to\t" +
query.getEndpoint());
+ logger.debug("Sending request for\t" +
query.toString());
logger.debug(requestMessage);
call.setTimeout(new Integer(timeout)); //30 min
//resultObject = call.invoke(new Object[] {requestMessage});

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSErrorCodeException.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSErrorCodeException.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSErrorCodeException.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -24,7 +24,6 @@

package org.perfsonar.perfsonarui;

-import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;

public class PSErrorCodeException extends PSException {
@@ -34,10 +33,12 @@
private static final long serialVersionUID = -4537628096178665708L;
protected String errorCode="";
protected String errordescription="";
-
+
+ /*
public PSErrorCodeException(IUserData query, String errorCode, String
errorDescription) {
this(query.getEndpoint(),errorCode,errorDescription);
}
+ */
public PSErrorCodeException(MAEndpoint maEndpoint, String errorCode,
String errorDescription) {
super(maEndpoint);
setErrorCode(errorCode);

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/PSException.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/PSException.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/PSException.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -52,16 +52,14 @@

}

- /**
- * @param message
- */
+ /*
public PSException(IUserData query,String message) {
super(message);
if (query != null) this.maEndpoint = query.getEndpoint();
else this.maEndpoint = null;

}
-
+ */
/**
* @param cause
*/

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSNotConfiguredTypeException.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/RequestInterruptedException.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/RequestInterruptedException.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/RequestInterruptedException.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -47,11 +47,11 @@
public RequestInterruptedException(MAEndpoint maEndpoint, String
message) {
super(maEndpoint, message);
}
-
+/*
public RequestInterruptedException(IUserData query, String message) {
super(query, message);
}
-
+*/
public RequestInterruptedException(MAEndpoint maEndpoint, Throwable
cause) {
this(maEndpoint, message, cause);
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -28,10 +28,12 @@
import org.perfsonar.perfsonarui.aa.AACertificate;
import org.perfsonar.perfsonarui.aa.IAACapable;
import org.perfsonar.perfsonarui.aa.ICredentialsListener;
+import org.perfsonar.perfsonarui.plugins.Batch;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
import org.perfsonar.perfsonarui.plugins.IPerfsonarResponse;
import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
+import org.perfsonar.perfsonarui.plugins.MAEndpointList;
import org.perfsonar.perfsonarui.plugins.MetaDataList;
import org.perfsonar.perfsonarui.ui.panels.BusyIdleEvent;
import org.w3c.dom.Document;
@@ -211,7 +213,7 @@
public abstract IPerfsonarRequest createMARequest(MAEndpoint
endpoint) throws PSException;

public IPerfsonarRequest getMARequest(MAEndpoint endpoint) throws
PSException {
- try {
+
if (endpoint == null)
throw new PSException("Service not
assigned!");
PerfsonarRequestsPool pool =
requestsPool.get(endpoint.getSchema());
@@ -219,12 +221,18 @@
pool = new PerfsonarRequestsPool();
requestsPool.put(endpoint.getSchema(),pool);
}
- IPerfsonarRequest request = pool.getRequest();
+ IPerfsonarRequest request = null;
+ try {
+ request = pool.getRequest();
+ } catch (Exception x) {
+ throw new PSException(endpoint,x);
+ }
//IPerfsonarRequest request =
requestsPool[endpoint.getSchemaIndex()].getRequest();
if (request == null) {
+
IPerfsonarRequest newRequest =
createMARequest(endpoint);
if (newRequest == null) {
- throw new Exception("Can't create request for
"+endpoint);
+ throw new PSException("Can't create request for
"+endpoint);
}
if (newRequest instanceof IAACapable) {
((IAACapable)newRequest).setAAEnabled(isAAEnabled());
@@ -233,7 +241,11 @@
}
newRequest.setTimeout(timeout);
pool.addConnection(newRequest);
- request = pool.getRequest();
+ try {
+ request = pool.getRequest();
+ } catch (Exception x) {
+ throw new PSException(endpoint,x);
+ }

};
if (request != null) {
@@ -246,23 +258,47 @@
}
return request;

- } catch (Exception x) {
- throw new PSException(endpoint,x);
- }
+
}
+
@Override
+ public void makeRequest(MAEndpoint endpoint, IUserData uData, String
messageType, IPerfsonarResponse response, boolean runInThread){
+ try {
+ //in order to clear the status bar if an error had occurred on
the previous requests
+ firePropertyChange(new
BusyIdleEvent(this,BusyIdleEvent.PROPERTY_CLEAR,
+ null,messageType
+ ));
+ IPerfsonarRequest mr = getMARequest(endpoint);
+ if (mr != null) {
+ mr.makeRequest(endpoint,uData,
messageType, response, parallel & runInThread);
+ } else
+ fireAxisCallException(uData,new
Exception("Request not created "+endpoint));
+ } catch (PSNotConfiguredTypeException x) {
+ x.printStackTrace();
+ } catch (Exception x) {
+ fireAxisCallException(uData,x);
+ }
+ }
+ @Override
public void makeRequest(IUserData uData, String messageType,
IPerfsonarResponse response, boolean runInThread){
try {
//in order to clear the status bar if an error had occurred on
the previous requests
firePropertyChange(new
BusyIdleEvent(this,BusyIdleEvent.PROPERTY_CLEAR,
null,messageType
));
- IPerfsonarRequest mr =
getMARequest(uData.getEndpoint());
- if (mr != null) {
+
+ Iterable<MAEndpoint> endpoints = uData.getEndpoints();
+ for (MAEndpoint e : endpoints)
+ try {
+ IPerfsonarRequest mr =
getMARequest(e);
+ if (mr != null) {
+ mr.makeRequest(e,uData,
messageType, response, parallel & runInThread);
+ } else
+
fireAxisCallException(uData,new Exception("Request not created "+e));
+ } catch (PSNotConfiguredTypeException x) {
+ x.printStackTrace();
+ }

- mr.makeRequest(uData, messageType, response,
parallel & runInThread);
- } else
- fireAxisCallException(uData,new
Exception("Request not created "+uData.getEndpoint()));
} catch (Exception x) {
fireAxisCallException(uData,x);
}
@@ -281,56 +317,24 @@
//Makes different nodes for each endpoint, in order to create
aggregated requests
for (int i=0; i < queryList.size();i++) {
queryList.get(i).setResponse(IUserData.C_STATUS,
AbstractUserData.NULL_DATA);
- PSLogger.threadlog("--\t"+queryList.get(i).getEndpoint());
}

- List<MetaDataList> queries = new ArrayList<MetaDataList>();
- Hashtable<String,MetaDataList> list = new
Hashtable<String,MetaDataList>();
- for (int i=0; i < queryList.size();i++) {
- IUserData data = (IUserData) queryList.get(i);
- MAEndpoint e = data.getEndpoint();
-
- if (e == null) continue;
-
- MetaDataList d = (MetaDataList)list.get(e.toString());
- if (d == null) {
- d = new MetaDataList(null);
- list.put(e.toString(),d);
- }
- d.add(data);
- if (d.size() >= maxDataEntries) {
- queries.add(d);
- list.remove(e.toString());
- }
- }
-
+ List<Batch<MetaDataList>> queries =
Batch.createBatch(queryList, maxDataEntries);
+
for (int i=0; i < queries.size(); i++) {
- MetaDataList d = queries.get(i);
+ Batch<MetaDataList> d = queries.get(i);
try {
- IPerfsonarRequest mr =
getMARequest(d.get(0).getEndpoint());
+ IPerfsonarRequest mr = getMARequest(d.getEndpoint());
if (mr != null)
-
mr.makeRequest(d.get(0).getEndpoint(), d, messageType, response, parallel &
runInThread);
+ mr.makeRequest(d.getEndpoint(),
d.getData(), messageType, response, parallel & runInThread);
+ } catch (PSNotConfiguredTypeException x) {
+ x.printStackTrace();
} catch (PSException x) {
- fireAxisCallException(d, x);
+ fireAxisCallException(d.getData(), x);
}

}
-
-
- Enumeration keys = list.keys();
- while (keys.hasMoreElements()) {
- MetaDataList d = list.get(keys.nextElement());
- try {
- IPerfsonarRequest mr =
getMARequest(d.get(0).getEndpoint());
- if (mr != null)
-
mr.makeRequest(d.get(0).getEndpoint(), d, messageType, response, parallel &
runInThread);
-
- } catch (PSException x) {
- fireAxisCallException(d, x);
- }
- }
-
-
+
} catch (Exception x) {
logger.error(x);
fireAxisCallException(queryList,x);
@@ -493,3 +497,6 @@
this.credentialsListener = credentialsListener;
}
}
+
+
+

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/UnsupportedTypeException.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/UnsupportedTypeException.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/UnsupportedTypeException.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -29,7 +29,6 @@

package org.perfsonar.perfsonarui;

-import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;

public class UnsupportedTypeException extends PSException {
@@ -47,10 +46,6 @@
super(maEndpoint, message);
}

- public UnsupportedTypeException(IUserData query, String message) {
- super(query, message);
- }
-
public UnsupportedTypeException(MAEndpoint maEndpoint, Throwable cause) {
super(maEndpoint, cause);
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/RTTRequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/RTTRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/RTTRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -71,8 +71,11 @@
messageType);
}
}
-
- public void makeRequest(IUserData uData, String messageType,
IPerfsonarResponse response, boolean runInThread) {
+
+
+ @Override
+ public void makeRequest(MAEndpoint endpoint, IUserData uData,
+ String messageType, IPerfsonarResponse response,
boolean runInThread) {
try {
forward.setSourceName(mainComponent.getSourceName());

forward.setDestinationName(mainComponent.getDestinationName());
@@ -82,12 +85,13 @@
if (callFwd == null) {
callFwd = (Call)service.createCall();
}
- callFwd.setTargetEndpointAddress(new
URL(uData.getEndpoint().getEndpoint()));
+
+ callFwd.setTargetEndpointAddress(new
URL(endpoint.getEndpoint()));
callFwd.setOperationName(new QName(URI_SOAP,"submit"));
if (callBck == null) {
callBck = (Call)service.createCall();
}
- callBck.setTargetEndpointAddress(new
URL(uData.getEndpoint().getEndpoint()));
+ callBck.setTargetEndpointAddress(new
URL(endpoint.getEndpoint()));
callBck.setOperationName(new QName(URI_SOAP,"submit"));

Document requestForward =
createRequest(forward,messageType);
@@ -97,7 +101,7 @@

queries = null;
if (runInThread) {
- Thread t = new
Thread(this,uData.getEndpoint().getTitle());
+ Thread t = new Thread(this,endpoint.getTitle());
t.start();
} else run();


Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson2.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson2.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson2.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -83,7 +83,8 @@
long now = System.currentTimeMillis()/1000;
data.setTime(now,now - 3*60*60); //Last 3 hours

- System.out.println("Service\t"+data.getEndpoint());
+ for (MAEndpoint e: data.getEndpoints())
+ System.out.println("Service\t"+e);
System.out.println("Interface
Address\t"+data.getQuery("ifAddress"));
System.out.println("Start time\t"+data.getStartTime());
System.out.println("End time\t"+data.getEndTime());

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson3.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson3.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson3.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -99,7 +99,8 @@
// Sent Metadatakeyrequest to GEANT2 MA RRD looking for
interface 62.40.124.109
smartRequest.makeRequest(data1,
IPerfsonarRequest.MA_MetadataKeyRequest, response_listener, false);
//print number of interfaces data retrieved
- System.out.println(all_interfaces.size() + " interface(s)
retrieved from \n" + data1.getEndpoint().getEndpoint() );
+ for (MAEndpoint e: data1.getEndpoints())
+ System.out.println(all_interfaces.size() + "
interface(s) retrieved from \n" + e );
System.out.println("\nQuery results:");
//print some data for the first (and only one) interface
IUserData result = all_interfaces.get(0);
@@ -120,9 +121,16 @@
data2.setEndpoint(new
MAEndpoint("ISTF-Java,http://selena.acad.bg:8080/axis/services/MeasurementArchiveService,NMWG2v2_netutil,\"\",utilization,utilization";));
data2.setQuery(UserData.C_IFADDRESS, "");
smartRequest.makeRequest(data2,
IPerfsonarRequest.MA_MetadataKeyRequest, response_listener, false);
+
+ System.out.print("Interfaces retrieved from ");
+ for (MAEndpoint e: data1.getEndpoints())
+ System.out.print(e.getTitle());
+ System.out.print(" and ");
+ for (MAEndpoint e: data2.getEndpoints())
+ System.out.print(e.getTitle());
+
+ System.out.println(": " + all_interfaces.size());

- System.out.println("Interfaces retrieved from " +
data1.getEndpoint().getTitle() + " and " +
- data2.getEndpoint().getTitle() + ": " +
all_interfaces.size());
System.out.println(all_interfaces);

}

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson4.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson4.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/Lesson4.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -141,7 +141,8 @@
//now send the request
lesson4.smartRequest.makeRequest(interfaces.get(0),
IPerfsonarRequest.MA_SetupDataRequest, new
TimeValueResponseListener(response), false);

- System.out.println(interfaces.get(0).getEndpoint());
+ for (MAEndpoint e: interfaces.get(0).getEndpoints())
+ System.out.println(e);
System.out.println("\nQuery results:");
System.out.println(response);


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/AbstractSetupDataRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/AbstractSetupDataRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/AbstractSetupDataRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -89,7 +89,7 @@

String caption = userData.toString();
try {
- request.fireStatusMessage("Sending request to " +
userData.getEndpoint() + " for " + caption);
+ request.fireStatusMessage("Sending request for " + caption);
prepareQuery(userData);
request.makeRequest(userData,
IPerfsonarRequest.MA_SetupDataRequest, responseProcessor, false);
if (request instanceof SmartMARequest) ((SmartMARequest)
request).isReady();

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMPerfsonarModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMPerfsonarModel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMPerfsonarModel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -156,7 +156,7 @@
public void retrieveEndpointPairs(MAEndpoint mae) throws Exception {
if (mae.isEnabled()) {
userData.setEndpoint(mae);
- request.fireStatusMessage("Retrieving
metadata from " + userData.getEndpoint());
+ request.fireStatusMessage("Retrieving
metadata from " + mae);
MetadataListResponseListener listener = new
MetadataListResponseListener(dataList) {
@Override
public synchronized void
callException(PerfsonarResponseEvent e) {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMRequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/IPPMRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -447,7 +447,7 @@
if (status.equals("error.ma.data")) {
String description = processNode(data) + "\nPossible
cause: No measurements for the selected date. \nTry to select different
date.";
responseListener.callException(new
PerfsonarResponseEvent(null,udata,
- new
PSErrorCodeException(udata,status,description)));
+ new
PSErrorCodeException(getActive_endpoint(),status,description)));
}
}
NodeList values =
data.getElementsByTagNameNS("http://ggf.org/ns/tools/hades/aggregated";,
IPPMUserData.NMWG_DATUM);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/actions/IPPMMetadataKeyRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/actions/IPPMMetadataKeyRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/actions/IPPMMetadataKeyRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -100,12 +100,12 @@
boolean ok = false;
for (int i=0; i < endpoints.size();i++) {
if (isInterrupted()) break;
- MAEndpoint mae = endpoints.get(i);
+ final MAEndpoint mae = endpoints.get(i);
if (mae.isEnabled()) {
ok = true;

dataList.setNotificationEnabled(false);
userData.setEndpoint(mae);
- request.fireStatusMessage("Retrieving
metadata from " + userData.getEndpoint());
+ request.fireStatusMessage("Retrieving
metadata from " + mae);
try {
MetadataListResponseListener
listener = new MetadataListResponseListener(dataList) {
@Override
@@ -113,7 +113,7 @@

super.callException(e);

getDataList().clear();
logger.error(e.getException());
-
handleException(e.getException(),userData.getEndpoint());
+
handleException(e.getException(),mae);

getDataList().setSelectedItem(null);

//request.removePropertyChangeListener(this);
}
@@ -134,7 +134,7 @@
}

};
- request.makeRequest(
userData, IPerfsonarRequest.MA_MetadataKeyRequest, listener, false);
+ request.makeRequest(mae,
userData, IPerfsonarRequest.MA_MetadataKeyRequest, listener, false);
mae.setStatus("OK");

mae.setStatusExplanation("OK");
mae.setAlive(true );

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/panels/IPPMResponseChartPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/panels/IPPMResponseChartPanel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ippm/ui/panels/IPPMResponseChartPanel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -31,6 +31,7 @@
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.NumberTickUnit;
import org.jfree.chart.plot.CombinedDomainXYPlot;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYItemRenderer;
@@ -47,7 +48,7 @@
* @author Nina Jeliazkova

* <b>Modified</b> 2006-3-7
*/
-public class IPPMResponseChartPanel extends ResponseChartPanel {
+public class IPPMResponseChartPanel extends
ResponseChartPanel<PerfsonarTimeSeries> {
protected XYPlot[] plots = null;

protected Hashtable<String,Integer> lookup;
@@ -133,8 +134,12 @@
} else if (IPPMRequest.measurements[m][i].startsWith("min")) {
colorLookup.put(IPPMRequest.measurements[m][i],
ChartColor.LIGHT_BLUE);
} else if (IPPMRequest.measurements[m][i].equals("owd")) {
+ bitAxis.setTickUnit(new NumberTickUnit(2));
+ bitAxis.setAutoTickUnitSelection(false);
colorLookup.put(IPPMRequest.measurements[m][i], Color.BLACK);
} else if (IPPMRequest.measurements[m][i].equals("ipdv")) {
+ bitAxis.setTickUnit(new NumberTickUnit(1));
+ bitAxis.setAutoTickUnitSelection(false);
colorLookup.put(IPPMRequest.measurements[m][i],
Color.black);
} else if (IPPMRequest.measurements[m][i].startsWith("loss")) {
colorLookup.put(IPPMRequest.measurements[m][i], Color.BLACK);
@@ -188,7 +193,7 @@
* @see
org.perfsonar.perfsonarui.ui.panels.ResponseChartPanel#createChart(java.util.Hashtable)
*/
@Override
- protected JFreeChart createChart(IPerfsonarTab psModel,Hashtable
datasets) {
+ protected JFreeChart createChart(IPerfsonarTab
psModel,Hashtable<String,PerfsonarTimeSeries> datasets) {
preparePlots();

CombinedDomainXYPlot plot = new
CombinedDomainXYPlot(dateAxis);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/LookupServiceRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -188,7 +188,7 @@
request.setTimeout(10000);
userData.setEndpoint(endpoint);
userData.setQuery(AbstractUserData.DOCUMENT_QUERY,
getLookupServiceRequest());
- request.makeRequest(userData,
IPerfsonarRequest.MA_MetadataKeyRequest, new
UserDataResponseListener(userData) {}, false);
+ request.makeRequest(endpoint,userData,
IPerfsonarRequest.MA_MetadataKeyRequest, new
UserDataResponseListener(userData) {}, false);
String strDoc =
userData.getResponse(AbstractUserData.DOCUMENT_RESPONSE);

try

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/StatusRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/StatusRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/linkstatus/StatusRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -257,7 +257,7 @@
request.setTimeout(10000);
userData.setEndpoint(endpoint);
userData.setQuery(AbstractUserData.DOCUMENT_QUERY,
getStatusRequest(links));
- request.makeRequest(userData,
IPerfsonarRequest.MA_MetadataKeyRequest, new
UserDataResponseListener(userData) {}, false);
+ request.makeRequest(endpoint,userData,
IPerfsonarRequest.MA_MetadataKeyRequest, new
UserDataResponseListener(userData) {}, false);
String strDoc =
userData.getResponse(AbstractUserData.DOCUMENT_RESPONSE);

try

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -228,7 +228,7 @@
// call on the end point
Object resultObject = null;
try {
- logger.debug("Sending request to\t" + query.getEndpoint());
+ logger.debug("Sending request to\t" + getActive_endpoint());
//logger.debug(requestMessage);
//call.setTimeout(new Integer(1800000)); //30 min


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGSetupDataRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGSetupDataRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/LGSetupDataRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -123,7 +123,7 @@
//parent.addCurrentDeviceToDevicesList();
userData.setEndpoint(mae);
//System.out.println("Sending request " + (i+1) + " to " +
userData.getEndpoint());
- request.fireStatusMessage("Sending request to " +
userData.getEndpoint());
+ request.fireStatusMessage("Sending request to " + mp);

try {
MetadataListResponseListener listener = new
MetadataListResponseListener(dataList) {
@@ -136,7 +136,7 @@

getDataList().clear();
logger.error(e.getException());
- handleException(e.getException(),
userData.getEndpoint());
+ handleException(e.getException(), mp);
e.getException().printStackTrace();
getDataList().setSelectedItem(null);
//request.removePropertyChangeListener(this);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/MetadataKeyRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/MetadataKeyRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/lookingglass/MetadataKeyRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -79,7 +79,7 @@

boolean ok = false;

- MAEndpoint mae = (MAEndpoint)
parent.getWebserviceComboBox().getSelectedItem();
+ final MAEndpoint mae = (MAEndpoint)
parent.getWebserviceComboBox().getSelectedItem();
//System.out.println("Endpoint : " + mae.getTitle());
//if (mae.isEnabled()){

@@ -99,7 +99,7 @@

getDataList().clear();
logger.error(e.getException());
- handleException(e.getException(),
userData.getEndpoint());
+ handleException(e.getException(), mae);
getDataList().setSelectedItem(null);
//request.removePropertyChangeListener(this);
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSQueryMetadata.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSQueryMetadata.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/LSQueryMetadata.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -238,7 +238,7 @@
}

//TODO support for multiple events!
- String namespace =
endpoint.getEvent(0) + '/';
+ String namespace =
endpoint.getEvent(0).toString() + '/';

NodeList metadata =
((Element)topo.item(i)).getElementsByTagNameNS(AbstractMARequest.NMWG2,AbstractMARequest.E_METADATA);
for (int j=0; j <
metadata.getLength(); j++)

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/Lookup.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/Lookup.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ls/Lookup.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -9,6 +9,7 @@
import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.MetadataListResponseListener;
import org.perfsonar.perfsonarui.PerfsonarSchema;
+import org.perfsonar.perfsonarui.plugins.Batch;
import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MAEndpointList;
@@ -45,8 +46,27 @@
//this is blocking call, runs the query in a separate thread
MetaDataList xqueryResult = futureResult.get();

+ List<Batch<MetaDataList>> batch =
Batch.createBatch(xqueryResult, Integer.MAX_VALUE);
+ IPerfsonarSchema hls_schema =
PerfsonarSchema.getInstance("hls");
+ for (Batch<MetaDataList> b: batch) {
+ MAEndpoint hls = b.getEndpoint();
+ if (hls == null) continue;
+ if (hls_schema.equals(hls.getSchema())) {
+ MetaDataList d = b.getData();
+ XQueryParams xparams = new XQueryParams();
+ xparams.setEventType(eventType);
+ xparams.setMetadata(d);
+
+ LSQueryMetadata metadata =
createMetadataQuery(hls, xparams);
+
+ Future<MetaDataList> query =
metadata.getResults(metadata.listener);
+ d = query.get();
+
+ }
+ }
+
+ /*
Hashtable<MAEndpoint, MetaDataList> endpoints = new
Hashtable<MAEndpoint, MetaDataList>();
- IPerfsonarSchema hls_schema =
PerfsonarSchema.getInstance("hls");
for (int i=0; i < xqueryResult.size();i++) {
xqueryResult.get(i).makeQueryFromResponse();
MAEndpoint hls = xqueryResult.get(i).getEndpoint();
@@ -75,14 +95,19 @@
Future<MetaDataList> query =
metadata.getResults(metadata.listener);
d = query.get();
}
+ */
IPerfsonarSchema hls = PerfsonarSchema.getInstance("hls");
for (int i=0; i < list.size();i++) {
- MAEndpoint e = list.get(i).getEndpoint();
- if (e == null) continue;
- if (hls.equals(e.getSchema())) {
- list.get(i).setEndpoint(null);
- list.get(i).setResponse(IUserData.C_STATUS,
e.toString());
+ ArrayList<MAEndpoint> toremove = new
ArrayList<MAEndpoint>();
+ for (MAEndpoint e: list.get(i).getEndpoints()) {
+ if (e == null) continue;
+ if (hls.equals(e.getSchema())) {
+ toremove.add(e);
+
list.get(i).setResponse(IUserData.C_STATUS, e.toString());
+ }
}
+ for (MAEndpoint e: toremove)
+ list.get(i).removeEndpoint(e);
}
return list;
}

Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MACombinedRequest.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -1,5 +1,5 @@
/*
-Copyright perfsonar.acad.bg (C) 2005-2007
+Copyright perfsonar.acad.bg (C) 2005-2008
Contact:


This program is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Vector;
import java.util.regex.Pattern;
@@ -35,6 +36,7 @@
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.PSException;
+import org.perfsonar.perfsonarui.PSNotConfiguredTypeException;
import org.perfsonar.perfsonarui.PerfsonarSchema;
import org.perfsonar.perfsonarui.SmartMARequest;
import org.perfsonar.perfsonarui.TracerouteShell;
@@ -106,7 +108,7 @@
protected TracerouteShell tracerouteShell;
protected TracerouteAction traceAction;

- protected String currentEventType =
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0";;
+ protected ArrayList<Metric> metrics;

public TracerouteAction getTraceAction() {
return traceAction;
@@ -121,6 +123,11 @@

public MAPerfsonarModel(MAEndpointList endpoints) {
super(endpoints);
+ metrics = new ArrayList<Metric>();
+
metrics.add(Metric.getInstance(MARequest_NMWG2.NS_UTILIZATION_2_0,"Utilisation","org.perfsonar.perfsonarui.ma.MARequestPerfsonar2_0",0));
+
metrics.add(Metric.getInstance(MARequest_NMWG2.NS_ERRORS_2_0,"Input
Errors","org.perfsonar.perfsonarui.ma.MARequest_Errors",1));
+
metrics.add(Metric.getInstance(MARequest_NMWG2.NS_DISCARDS_2_0,"Output
Drops","org.perfsonar.perfsonarui.ma.MARequest_Discards",2));
+ Collections.sort(metrics);
tracerouteShell = new TracerouteShell();


@@ -202,29 +209,16 @@
else if (schema.equals("perfsonar")) return new MARequest();
else if (schema.equals(IPPMRequest.requestType)) return new
IPPMRequest();
else if
(schema.equals(MARequestPerfsonar2_0.schemaID)) {
- endpoint.setEvent(getCurrentEventType(), 0);
- endpoint.setEvent(getCurrentEventType(), 1);
- /* array depends on the options
- return new MACombinedRequest(
- new IPerfsonarRequest[] {
- new MARequestPerfsonar2_0(),
- new MARequest_Errors(),
- new MARequest_Discards()
- }
- );
- */
-
- if
("http://ggf.org/ns/nmwg/characteristic/utilization/2.0".equals(getCurrentEventType()))
- return new MARequestPerfsonar2_0();
- if
("http://ggf.org/ns/nmwg/characteristic/discards/2.0".equals(getCurrentEventType()))
- return new MARequest_Discards();
- if
("http://ggf.org/ns/nmwg/characteristic/errors/2.0".equals(getCurrentEventType()))
- return new MARequest_Errors();
- if
("http://ggf.org/ns/nmwg/characteristic/packets/unicast/2.0/".equals(getCurrentEventType()))
- return new MAUnicastPackets();
- if
("http://ggf.org/ns/nmwg/characteristic/packets/nonunicast/2.0/".equals(getCurrentEventType()))
- return new MANonunicastPackets();
-
+
+ for (Metric m: metrics) {
+ if
(m.getEvent().equals(endpoint.getEvent()))
+ if (m.isEnabled()) {
+ return
m.createRequest();
+ }
+ else
+ throw new
PSNotConfiguredTypeException(endpoint,m.getEvent());
+ }
+
}
throw new UnsupportedTypeException(endpoint);
}
@@ -240,8 +234,10 @@
ifDataset.addSeries("outbound",new
InterfaceUtilizationSeries("outbound",false));
ifDataset.addSeries("Eps",new PerfsonarTimeSeries("Input errors"));
ifDataset.addSeries("Dps",new PerfsonarTimeSeries("Output drops"));
+ /*
ifDataset.addSeries("Unicast packets",new
PerfsonarTimeSeries("Unicast packets"));
ifDataset.addSeries("Non-unicast packets",new
PerfsonarTimeSeries("Non-unicast packets"));
+ */
return ifDataset;
}
public List<IPerfsonarSchema> getSupportedRequests() {
@@ -372,7 +368,7 @@
tp.addTimeAction((ITimeSetAction)metadataRequestAction);


- return new JComponent[]{tp,new RequestOptionsPanel(this),new
MetricsOptionPanel(this)};
+ return new JComponent[]{tp,new RequestOptionsPanel(this),new
MetricsOptionPanel(metrics)};
}
@Override
public JComponent[] createDetailsComponent(Component parentComponent)
{
@@ -413,10 +409,5 @@
public int getOrder() {
return 2;
}
- public synchronized String getCurrentEventType() {
- return currentEventType;
- }
- public synchronized void setCurrentEventType(String currentEventType) {
- this.currentEventType = currentEventType;
- }
+
}

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -254,9 +254,11 @@
//ParamUnitsElem.setAttribute("name", "valueUnits");
ParamElem.addContent(ParamUnitsElem);
*/
- if
(!userData.getCharacteristic(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

- MetElem.addContent(new Element("characteristic",
nmwg).setText(userData.getCharacteristic(AbstractUserData.ID_QUERY).toString()));
- }
+ //if
(!userData.getCharacteristic(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

+ MetElem.addContent(new Element("characteristic", nmwg).setText(
+ getActive_endpoint().getEvent().toString()
+ ));
+ //}

return MetElem;
}
@@ -275,9 +277,14 @@

MetElem.addContent(SubjElem);
SubjElem.addContent(NmwgtElem);
+ MetElem.addContent(new Element("characteristic", nmwg).setText(
+ getActive_endpoint().getEvent().toString()
+ ));
+ /*
if
(!userData.getCharacteristic(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

MetElem.addContent(new Element("characteristic",
perfsonar).setText(userData.getCharacteristic(AbstractUserData.ID_QUERY).toString()));
}
+ */

return MetElem;
}
@@ -413,7 +420,7 @@

for (int i=0; i < nodelist.getLength();i++) {
UserData userData = new UserData();
- userData.setEndpoint(queryData.getEndpoint());
+ userData.setEndpoint(getActive_endpoint());
NodeList children = nodelist.item(i).getChildNodes();
for (int j=0; j < children.getLength();j++) {
Node node = children.item(j);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -54,7 +54,7 @@
}
@Override
protected String getSupportedEventType() {
- return
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0";;
+ return MARequest_NMWG2.NS_UTILIZATION_2_0;
}
public String getRequestType() {
return schemaID;
@@ -131,14 +131,8 @@
Node eventType =
((org.w3c.dom.Element)metadata).getElementsByTagNameNS(URI_nmwg[nmwg_version],"eventType").item(0);
if (eventType != null) {
String event = eventType.getFirstChild().getNodeValue();
- if (!event.startsWith("error.")) {
- if (userData.getEndpoint() != null) {
- if (userData.isInput())
- userData.getEndpoint().setEvent(event,0);
- else if (userData.isOutput())
- userData.getEndpoint().setEvent(event,1);
- else userData.getEndpoint().setEvent(event,-1); //both
- }
+ if (!event.startsWith("error.") &&
!event.startsWith("warning.")) {
+ getActive_endpoint().setEvent(event);
}
}


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -29,6 +29,7 @@

package org.perfsonar.perfsonarui.ma;

+import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.PSCountsDatum;
import org.perfsonar.perfsonarui.plugins.PSDiscardsDatum;

@@ -53,7 +54,7 @@
return new PSDiscardsDatum();

}
- protected int[] getDirections() {
- return new int[]{UserData.DIRECTION_OUTPUT};
+ protected UserData.DIRECTION[] getDirections() {
+ return new UserData.DIRECTION[]{UserData.DIRECTION.OUT};
}
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -53,8 +53,8 @@
}

@Override
- protected int[] getDirections() {
- return new int[]{UserData.DIRECTION_INPUT};
+ protected UserData.DIRECTION[] getDirections() {
+ return new UserData.DIRECTION[]{UserData.DIRECTION.IN};
}
protected synchronized void setAverage(UserData userData,PSCountsDatum
datum, double average ) {
userData.setResponse(datum.getType(), Double.toString(average));

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_NMWG2.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -27,10 +27,10 @@
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.MetadataListResponseListener;
import org.perfsonar.perfsonarui.NMWGHelper;
-import org.perfsonar.perfsonarui.PSErrorCodeException;
import org.perfsonar.perfsonarui.TimeValueResponseListener;
import org.perfsonar.perfsonarui.UserDataResponseListener;
import org.perfsonar.perfsonarui.aa.AAPerfsonarRequest;
+import org.perfsonar.perfsonarui.ma.UserData.DIRECTION;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
import org.perfsonar.perfsonarui.plugins.IPerfsonarResponse;
import org.perfsonar.perfsonarui.plugins.ITimeValueResponse;
@@ -47,6 +47,10 @@
*
*/
public class MARequest_NMWG2 extends AAPerfsonarRequest {
+ public static String
NS_UTILIZATION_2_0="http://ggf.org/ns/nmwg/characteristic/utilization/2.0";;
+ public static String
NS_ERRORS_2_0="http://ggf.org/ns/nmwg/characteristic/errors/2.0";;
+ public static String
NS_DISCARDS_2_0="http://ggf.org/ns/nmwg/characteristic/discards/2.0";;
+
protected static String[] URI_nmwgt = {
"",
"http://ggf.org/ns/nmwg/topology/";,
@@ -56,9 +60,9 @@
protected static String[][] URI_perfsonar = {
{"perfsonar","http://ggf.org/ns/nmwg/tools/org/perfsonar/"},
{"perfsonar","http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"},
- {"netutil","http://ggf.org/ns/nmwg/characteristic/utilization/2.0/"},
- {"errors","http://ggf.org/ns/nmwg/characteristic/errors/2.0/"},
- {"discards","http://ggf.org/ns/nmwg/characteristic/discards/2.0/"},
+ {"netutil",NS_UTILIZATION_2_0+"/"},
+ {"errors",NS_ERRORS_2_0+"/"},
+ {"discards",NS_DISCARDS_2_0+"/"},

{"nonunicast","http://ggf.org/ns/nmwg/characteristic/packets/nonunicast/2.0/"},

{"unicast","http://ggf.org/ns/nmwg/characteristic/packets/unicast/2.0/"},
{"snmp","http://ggf.org/ns/nmwg/tools/snmp/2.0/"},
@@ -133,8 +137,8 @@
}


- protected int[] getDirections() {
- return new int[] {UserData.DIRECTION_INPUT,UserData.DIRECTION_OUTPUT};
+ protected UserData.DIRECTION[] getDirections() {
+ return new UserData.DIRECTION[]
{UserData.DIRECTION.IN,UserData.DIRECTION.OUT};
}

/**
@@ -151,11 +155,11 @@
MesgElem.addNamespaceDeclaration(perfsonar);
MesgElem.addNamespaceDeclaration(select);

- if (userData.direction == UserData.DIRECTION_UNKNOWN) {
- int[] directions = getDirections();
+ //if (userData.direction == UserData.DIRECTION.UNKNOWN) {
+ UserData.DIRECTION[] directions = getDirections();
for (int i=0; i < directions.length;i++) {
- userData.setDirection(directions[i]);
- createSetupDataMetaData(userData,
MesgElem,UserData.C_DIRECTIONS[i]);
+ //userData.setDirection(directions[i]);
+ createSetupDataMetaData(userData,
directions[i],MesgElem,directions[i].toString());
}
/*
userData.setDirection(UserData.DIRECTION_INPUT);
@@ -163,8 +167,8 @@
userData.setDirection(UserData.DIRECTION_OUTPUT);
createSetupDataMetaData(userData,
MesgElem,UserData.C_DIRECTION_OUT);
*/
- userData.setDirection(UserData.DIRECTION_UNKNOWN);
- } else createSetupDataMetaData(userData,
MesgElem,userData.getQuery(UserData.C_DIRECTION));
+ userData.setDirection(UserData.DIRECTION.UNKNOWN);
+ //} else createSetupDataMetaData(userData,
MesgElem,userData.getQuery(UserData.C_DIRECTION));

return createDocumentFromElement(MesgElem);
}
@@ -188,11 +192,11 @@

for (int i=0; i < dataList.size();i++) {
UserData userData = (UserData)dataList.get(i);
- if (userData.direction == UserData.DIRECTION_UNKNOWN) {
- int[] directions = getDirections();
+ //if (userData.direction == UserData.DIRECTION.UNKNOWN) {
+ UserData.DIRECTION[] directions = getDirections();
for (int d=0; d < directions.length;d++) {
- userData.setDirection(directions[d]);
- createSetupDataMetaData(userData,
MesgElem,Integer.toString(i)+UserData.C_DIRECTIONS[d]);
+ //userData.setDirection(directions[d]);
+ createSetupDataMetaData(userData,
directions[d],MesgElem,Integer.toString(i)+ directions[d].toString());

}
/*
userData.setDirection(UserData.DIRECTION_INPUT);
@@ -200,15 +204,15 @@
userData.setDirection(UserData.DIRECTION_OUTPUT);
createSetupDataMetaData(userData,
MesgElem,Integer.toString(i)+UserData.C_DIRECTION_OUT);
*/
- userData.setDirection(UserData.DIRECTION_UNKNOWN);
- } else createSetupDataMetaData(userData,
MesgElem,Integer.toString(i)+userData.getQuery(UserData.C_DIRECTION));
+ userData.setDirection(UserData.DIRECTION.UNKNOWN);
+ //} else createSetupDataMetaData(userData,
MesgElem,Integer.toString(i)+userData.getQuery(UserData.C_DIRECTION));
}
return createDocumentFromElement(MesgElem);
}

- protected Element createSetupDataMetaData(UserData userData, Element
MesgElem, String id) {
+ protected Element createSetupDataMetaData(UserData userData, DIRECTION
direction, Element MesgElem, String id) {
String metadataID1 = "meta_"+id ;//+
Long.toString(System.currentTimeMillis());
- Element MetElem = createMetadataSection(userData,metadataID1);
+ Element MetElem =
createMetadataSection(userData,direction,metadataID1);
MesgElem.addContent(MetElem);

String metadataID2 = "m_param_"+id
;//+Long.toString(System.currentTimeMillis());
@@ -223,7 +227,7 @@

}

- public Element createMetadataSection(UserData userData, String
metadataID){
+ public Element createMetadataSection(UserData userData,
UserData.DIRECTION direction, String metadataID){

Element MetElem = new Element(E_METADATA,nmwg);

@@ -249,13 +253,6 @@
NmwgtElem.addContent(IfNameElem);
}

- //Element IfDescrElem = new Element("ifDescription", "nmwgt",
"http://ggf.org/ns/nmwg/topology/";);
- //IfDescrElem.setText(" Link to JAnet-Ukerna (Pr:Telecity Id:1)");
- //NmwgtElem.addContent(IfDescrElem);
- /*
- if
((!userData.getIpVersion(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA))
&&
-
(!userData.getifAddress(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA))){
- */
if
(!userData.getifAddress(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA))
{
Element IfAddrElem = new Element(E_IFADDRESS, nmwgt);

@@ -265,33 +262,12 @@

IfAddrElem.setText(userData.getifAddress(AbstractUserData.ID_QUERY));
NmwgtElem.addContent(IfAddrElem);
}
-
- //Element IfIndexElem = new Element("ifIndex", "nmwgt",
"http://ggf.org/ns/nmwg/topology/";);
- //IfIndexElem.setText("0");
- //NmwgtElem.addContent(IfIndexElem);
-
- //Element TypeElem = new Element("type", "nmwgt",
"http://ggf.org/ns/nmwg/topology/";);
- //TypeElem.setText("type");
- //NmwgtElem.addContent(TypeElem);

-
- if (userData.isInput()) {
+ if (direction != DIRECTION.UNKNOWN) {
Element DirectElem = new Element(E_IFDIRECTION, nmwgt);
- DirectElem.setText(E_IFDIRECTION_IN);
+ DirectElem.setText(direction.toString());
NmwgtElem.addContent(DirectElem);
- } else if (userData.isOutput()) {
- Element DirectElem = new Element(E_IFDIRECTION, nmwgt);
- DirectElem.setText(E_IFDIRECTION_OUT);
- NmwgtElem.addContent(DirectElem);
- } // otherwise unspecified
-
- //Element IndexElem = new Element("Index", "nmwgt",
"http://ggf.org/ns/nmwg/topology/";);
- //IndexElem.setText("0");
- //NmwgtElem.addContent(IndexElem);
-
- //Element AuthRealmElem = new Element("authRealm", "nmwgt",
"http://ggf.org/ns/nmwg/topology/";);
- //AuthRealmElem.setText("GEANT");
- //NmwgtElem.addContent(AuthRealmElem);
+ }

if
(!userData.getClassOfService(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

Element COSElem = new Element("classOfService", nmwgt);
@@ -303,28 +279,8 @@
MetElem.addContent(SubjElem);
SubjElem.addContent(NmwgtElem);

- /*
- Element ParamElem = new Element("parameters", "perfsonar",
"http://perfsonar.org/ns/perfsonar/";);
- ParamElem.setAttribute("id", "paramid1");
- MetElem.addContent(ParamElem);
+ MetElem.addContent(new Element(IUserData.C_EVENTTYPE,
nmwg).setText(getSupportedEventType()));

- Element ParamIntElem = new Element("parameter", "perfsonar",
"http://perfsonar.org/ns/perfsonar/";);
- ParamIntElem.setAttribute("value", "60");
- ParamIntElem.setAttribute("name", "interval");
- ParamElem.addContent(ParamIntElem);
-
- Element ParamUnitsElem = new Element("parameter", "perfsonar",
"http://perfsonar.org/ns/perfsonar/";);
- ParamUnitsElem.setAttribute("value", "traffic_in");
- //ParamUnitsElem.setAttribute("name", "valueUnits");
- ParamElem.addContent(ParamUnitsElem);
- */
- /*
- if
(!userData.getCharacteristic(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

- MetElem.addContent(new Element("eventType",
nmwg).setText(userData.getCharacteristic(AbstractUserData.ID_QUERY).toString()));
- } else
- */
- MetElem.addContent(new Element("eventType",
nmwg).setText(getSupportedEventType()));
-
return MetElem;
}
protected String getSupportedEventType() {
@@ -353,6 +309,8 @@

MetElem.addContent(SubjElem);
SubjElem.addContent(NmwgtElem);
+ MetElem.addContent(new Element(IUserData.C_EVENTTYPE,
nmwg).setText(getSupportedEventType()));
+ /*
if
(!userData.getCharacteristic(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

MetElem.addContent(new Element("eventType", nmwg).setText(
@@ -360,7 +318,7 @@
);
} else
MetElem.addContent(new Element("eventType",
nmwg).setText(getSupportedEventType()));
-
+ */
return MetElem;
} catch (Exception x) {
x.printStackTrace();
@@ -399,7 +357,7 @@

MetElem.addContent(SubjElem);
SubjElem.addContent(NmwgtElem);
- //PIONIER MA Java implementation needs eventType tag ; others
work happily without it ...
+ /*
if
(!userData.getCharacteristic(AbstractUserData.ID_QUERY).equals(AbstractUserData.NULL_DATA)){

MetElem.addContent(new Element("eventType", nmwg).setText(
@@ -407,7 +365,9 @@
);
} else
MetElem.addContent(new Element("eventType",
nmwg).setText("utilization"));
-
+ */
+ MetElem.addContent(new Element(IUserData.C_EVENTTYPE,
nmwg).setText(getSupportedEventType()));
+
return MetElem;
}

@@ -571,7 +531,7 @@
public void process(org.w3c.dom.Element data,
ArrayList<org.w3c.dom.Element> metadataChain) throws Exception {
UserData myData = new UserData();

myData.setResponse(IUserData.C_DATAID,data.getAttribute(getId()));
- myData.setEndpoint(queryData.getEndpoint());
+ myData.setEndpoint(getActive_endpoint());

Iterator<org.w3c.dom.Element> i = metadataChain.iterator();
while (i.hasNext()) {
@@ -580,6 +540,7 @@

myData.setResponse(IUserData.C_METADATAID,metadata.getAttribute(getId()));
}
responseListener.addUserData(myData);
+
processDataKey(data, myData);
processDataParameters(data, myData);
}
@@ -720,11 +681,7 @@
Node eventType =
((org.w3c.dom.Element)metadata).getElementsByTagNameNS(URI_nmwg[nmwg_version],"eventType").item(0);
if (eventType != null) {
String event = eventType.getFirstChild().getNodeValue();
- if (userData.isInput())
- userData.getEndpoint().setEvent(event,0);
- else if (userData.isOutput())
- userData.getEndpoint().setEvent(event,1);
- else userData.getEndpoint().setEvent(event,-1); //both
+ getActive_endpoint().setEvent(event);
}
}
protected void processDataKey(Node data, IUserData userData) {

Added: branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/Metric.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties
2008-10-20 13:46:17 UTC (rev 4633)
@@ -7,4 +7,5 @@
msg_select_interface=Select interface
action_trace=Traceroute & search
action_file_help=A file with a list of IP addresses is expected. Reads the
file content and inserts it into the search panel at the left.
-msg_radar_help=Spider plot view is an alternative display of the interfaces
utilization to give a complete overview of the network.
\ No newline at end of file
+msg_radar_help=Spider plot view is an alternative display of the interfaces
utilization to give a complete overview of the network.
+msg_metric_selection=Metric selection
\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UpdateListResponseListener.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UpdateListResponseListener.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UpdateListResponseListener.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -1,5 +1,5 @@
/*
-Copyright perfsonar.acad.bg (C) 2005-2007
+Copyright perfsonar.acad.bg (C) 2005-2008
Contact:


This program is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@
import org.perfsonar.perfsonarui.MetadataListResponseListener;
import org.perfsonar.perfsonarui.ma.ui.actions.SearchByIPAction;
import org.perfsonar.perfsonarui.plugins.IUserData;
+import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MetaDataList;

/**
@@ -33,19 +34,22 @@

public UpdateListResponseListener(MetaDataList dataList) {
super(dataList);
- // TODO Auto-generated constructor stub
}
@Override
public void addUserData(IUserData data) {

String ifaddress = data.getResponse(UserData.C_IFADDRESS);
+
for (int i=0; i < dataList.size();i++) {
if
(ifaddress.equals(dataList.get(i).getResponse(UserData.C_IFADDRESS))) {
data.setNum(i+1);
- dataList.set(i, data);
+ for (MAEndpoint e:
dataList.get(i).getEndpoints())
+ data.addEndpoint(e);
+ dataList.get(i).assign(data);
break;
}
}
+
}

}

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -23,6 +23,7 @@
import java.util.Date;
import java.util.TimeZone;

+import org.omg.CORBA.UNKNOWN;
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.plugins.IUserData;
@@ -37,11 +38,6 @@
public class UserData extends AbstractUserData {

public final static String C_DIRECTION="direction";
- public final static String[] C_DIRECTIONS={"in","out"};
- /*
- public final static String C_DIRECTION_IN="in";
- public final static String C_DIRECTION_OUT="out";
- */
public final static String C_IFDESCRIPTION = "ifDescription";
public final static String C_CAPACITY="capacity";
public final static String C_TIMEVALUE="timeValue";
@@ -54,7 +50,7 @@

//protected String[][] data = null;

- protected int direction = 0;
+ protected DIRECTION direction = DIRECTION.IN;

protected double[] utilization = new double[2];
protected double[] ifmbits = new double[2];
@@ -63,10 +59,58 @@
protected static int DATA_ROWS=18;

//public static int ID_NAME=0;
- public static final int DIRECTION_INPUT=0;
- public static final int DIRECTION_OUTPUT=1;
- public static final int DIRECTION_UNKNOWN=-1;
+ public enum DIRECTION {
+
+ IN {
+ @Override
+ public String toString() {
+ return "in";
+ }
+ @Override
+ public int toIndex() {
+ return 0;
+ }
+ @Override
+ public String getType() {
+ return "inbound";
+ }
+ },
+ OUT {
+ @Override
+ public String toString() {
+ return "out";
+ }
+ @Override
+ public int toIndex() {
+ return 1;
+ }
+ @Override
+ public String getType() {
+ return "outbound";
+ }
+
+ },
+ UNKNOWN {
+ @Override
+ public String toString() {
+ return NULL_DATA;
+ }
+ @Override
+ public int toIndex() {
+ return -1;
+ }
+ @Override
+ public String getType() {
+ return "Unknown";
+ }

+ };
+ public abstract String toString();
+ public abstract int toIndex();
+ public abstract String getType();
+
+ }
+
public static final int INDEX_IPVERSION = 0;
public static final int INDEX_HOSTNAME = 1;
public static final int INDEX_IFADDRESS = 2;
@@ -152,7 +196,7 @@
if (init) {
long timeNow =
Calendar.getInstance(TimeZone.getDefault()).getTimeInMillis()/1000 - 10*60;
setQuery(names[INDEX_IPVERSION],"ipv4");
- direction = 0;
+ direction = DIRECTION.IN;
setQuery(names[INDEX_EVENTTYPE],"utilization");

setTime(timeNow-24*60*60, 24*60*60);
@@ -255,13 +299,15 @@
return data[INDEX_DIRECTION][index];
}
*/
+ /*
public String getCharacteristic(int index) {
if (index ==ID_QUERY)
- return getEndpoint().getEvent(direction);
+ return getEndpoint().getEvent(direction.toIndex());
else
return get(index,names[INDEX_EVENTTYPE]).toString();

}
+ */
public String getClassOfService(int index) {
return get(index,names[INDEX_CLASSOFSERVICE]).toString();
}
@@ -298,11 +344,13 @@
setChanged();
notifyObservers();
}
+ /*
public void setCharacteristic(String value) {
setQuery(names[INDEX_EVENTTYPE],value);
setChanged();
notifyObservers();
}
+ */

public String getResolution(int index) {
return get(index,names[INDEX_RESOLUTION]).toString();
@@ -330,12 +378,12 @@
int indexBits = INDEX_IFBITS_IN;
int indexUtilization = INDEX_IFUTILIZATION_IN;
switch (direction) {
- case 0: {
+ case IN: {
indexBits = INDEX_IFBITS_IN;
indexUtilization = INDEX_IFUTILIZATION_IN;
break;
}
- case 1: {
+ case OUT: {
indexBits = INDEX_IFBITS_OUT;
indexUtilization = INDEX_IFUTILIZATION_OUT;
break;
@@ -347,7 +395,7 @@
}


- if (direction>=0) ifmbits[direction] = M1*multiplier*bits; //MBits
+ if (direction != DIRECTION.UNKNOWN) ifmbits[direction.toIndex()]
= M1*multiplier*bits; //MBits

setResponse(names[indexBits],Long.toString(Math.round(bits*multiplier)));
//bits

double c = 0;
@@ -430,14 +478,11 @@
} else return false;
}
@Override
- public int compareTo(Object arg0) {
- //return 1;
+ public int compareTo(IUserData arg0) {

if (arg0 instanceof UserData) {
UserData o = (UserData) arg0;
- int r =
getEndpoint().toString().compareTo(o.getEndpoint().toString());
- if (r == 0) {
- r =
getHostname(ID_RESPONSE).compareTo(o.getHostname(ID_RESPONSE));
+ int r =
getHostname(ID_RESPONSE).compareTo(o.getHostname(ID_RESPONSE));
if (r == 0) {
r =
getifAddress(ID_RESPONSE).compareTo(o.getifAddress(ID_RESPONSE));
if (r == 0) {
@@ -447,7 +492,7 @@

}
}
- }
+
return r;
} else return -1;

@@ -456,9 +501,7 @@
@Override
public String toString() {
StringBuffer b = new StringBuffer();
- //b.append(getHostname(ID_RESPONSE));b.append('\t');
- MAEndpoint e = getEndpoint();
- if (e != null) b.append(e.getTitle());
+ b.append(getDomain());
b.append(' ');
b.append(getifAddress(ID_RESPONSE));b.append(' ');
b.append(getIfName(ID_RESPONSE));b.append(' ');
@@ -480,9 +523,10 @@

return b.toString();
}
+
public void assign(UserData userData) {
super.assign((IUserData)userData);
- setSchema(userData.getSchema());
+ // setSchema(userData.getSchema());
}
public String getName(int index) {
return names[index];
@@ -494,48 +538,51 @@
return getResponse(names[index]);
}
public synchronized boolean isInput() {
- return direction==DIRECTION_INPUT;
+ return direction==DIRECTION.IN;
}
public synchronized String getType() {
- switch( direction) {
- case 0: return "inbound";
- case 1: return "outbound";
- default: return NULL_DATA;
- }
+ return direction.getType();
}
- public synchronized void setDirection(int input) {
+ public synchronized void setDirection(DIRECTION input) {
this.direction = input;
setChanged();
notifyObservers();
}

public synchronized void setDirection(String input) {
- if (input.equals(C_DIRECTIONS[DIRECTION_INPUT]))
setDirection(DIRECTION_INPUT);
- else if (input.equals(C_DIRECTIONS[DIRECTION_OUTPUT]))
setDirection(DIRECTION_OUTPUT);
- else setDirection(DIRECTION_UNKNOWN);
+ try {
+ setDirection(DIRECTION.valueOf(input.toUpperCase()));
+ } catch (Exception x) {
+ setDirection(DIRECTION.UNKNOWN);
+ }
+
}

@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);
}

public synchronized boolean isOutput() {
- return direction==DIRECTION_OUTPUT;
+ return direction==DIRECTION.OUT;
}
+ /*
public synchronized IPerfsonarSchema getSchema() {
- return maData.getSchema();
+ MAEndpoint e = getEndpoint();
+ if (e != null)
+ return getEndpoint().getSchema();
+ else
+ return null;
}
public synchronized void setSchema(IPerfsonarSchema schema) {
- maData.setSchema(schema);
+ MAEndpoint e = getEndpoint();
+ if (e != null)
+ e.setSchema(schema);
setChanged();
- notifyObservers(maData);
+ notifyObservers(e);
}
+ */


@Override

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -88,7 +88,7 @@
break;
}
case UserData.INDEX_DOMAIN : {
- r = ((UserData)
o1).getEndpoint().getTitle().compareTo(((UserData)
o2).getEndpoint().getTitle());
+ r = ((UserData) o1).getDomain().compareTo(((UserData)
o2).getDomain());
break;
}
case UserData.INDEX_INERRORS : {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/MASetupDataRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/MASetupDataRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/MASetupDataRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -56,6 +56,6 @@
@Override
public void prepareQuery(IUserData userData) {
super.prepareQuery(userData);
- ((UserData)userData).setDirection(UserData.DIRECTION_UNKNOWN);
+ ((UserData)userData).setDirection(UserData.DIRECTION.UNKNOWN);
}
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SearchByIPAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SearchByIPAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SearchByIPAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -132,27 +132,31 @@
return null;
}
} else {
-
+ MetaDataList searchList =
getSearchList(searchText);
//the old way of looking through the endpoints
+ for (int e=0; e < searchList.size();e++)
+ searchList.get(e).setEndpoint(null);
+
for (int i=0; i < endpoints.size();i++) {
- if (isInterrupted()) break;
- MAEndpoint mae = endpoints.get(i);
+ MAEndpoint mae = endpoints.get(i);
if (mae.isEnabled()) {
- MetaDataList searchList =
getSearchList(searchText);
-
request.fireStatusMessage("Sending request to "+ mae);
- try {
-
//request.makeSearchRequest(searchData,dataList);
-
- for (int e=0; e <
searchList.size();e++)
-
searchList.get(e).setEndpoint(mae);
-
- request.makeRequest(mae,searchList,
IPerfsonarRequest.MA_MetadataKeyRequest, new
UpdateListResponseListener(dataList), true);
-
- } catch (Exception x) {
- logger.error(x);
- }
- }
- }
+ if
(mae.getSupportedEventTypes().size()>0)
+ for (int j=0; j <
mae.getSupportedEventTypes().size();j++)
+ try {
+ MAEndpoint
clone = (MAEndpoint) mae.clone();
+
clone.setEvent(mae.getSupportedEventTypes().get(j));
+ for
(int e=0; e < searchList.size();e++)
+
searchList.get(e).addEndpoint(clone);

+ } catch (Exception x)
{
+
x.printStackTrace();
+ }
+ else
+ for (int e=0; e <
searchList.size();e++)
+
searchList.get(e).addEndpoint(mae);
+ }
+ }
+ request.makeRequest(null,searchList,
IPerfsonarRequest.MA_MetadataKeyRequest, new
UpdateListResponseListener(dataList), true);
+

if (request instanceof SmartMARequest)
((SmartMARequest) request).isReady();
@@ -165,8 +169,8 @@
dataList.get(i).makeQueryFromResponse();
dataList.get(i).lastSeconds(timeInterval);
UserData data = (UserData)dataList.get(i);
- data.setDirection(UserData.DIRECTION_UNKNOWN);

-
PSLogger.threadlog(getClass().getName()+"\t"+dataList.get(i).getEndpoint());
+ data.setDirection(UserData.DIRECTION.UNKNOWN);

+
PSLogger.threadlog(getClass().getName()+"\t"+dataList.get(i));
}
request.fireStatusMessage("Data retrieved from " +
dataList.size() + " interfaces.");
if (!isInterrupted()) {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRefreshActionAll.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRefreshActionAll.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRefreshActionAll.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -81,7 +81,7 @@
for (int i=0; i < dataList.size();i++) {
UserData data = (UserData)dataList.get(i);
data.makeQueryFromResponse();
- data.setDirection(UserData.DIRECTION_UNKNOWN);
+ data.setDirection(UserData.DIRECTION.UNKNOWN);
}
request.makeRequest(null, dataList,
IPerfsonarRequest.MA_SetupDataRequest,
new TimeValueListResponseListener(dataList), true);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRetrieveAllAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRetrieveAllAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/actions/SetupDataRetrieveAllAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -81,10 +81,22 @@
if (mae.isEnabled()) {
userData.setEndpoint(mae);

- request.fireStatusMessage("Retrieving
metadata from " + userData.getEndpoint());
+ request.fireStatusMessage("Retrieving
metadata from " + mae);
try {

//request.makeKeyRequest(userData,dataList);
- request.makeRequest(
userData, IPerfsonarRequest.MA_MetadataRetrieveRequest, new
MetadataListResponseListener(dataList), false);
+ if
(mae.getSupportedEventTypes().size()>1) {
+ for (int j=0; j <
mae.getSupportedEventTypes().size();j++)
+ try {
+ MAEndpoint
clone = (MAEndpoint) mae.clone();
+
clone.setEvent(mae.getSupportedEventTypes().get(j));
+
userData.addEndpoint(clone);
+ } catch (Exception x)
{
+
x.printStackTrace();
+ }
+ request.makeRequest(userData,
IPerfsonarRequest.MA_MetadataRetrieveRequest, new
MetadataListResponseListener(dataList), false);
+ }
+ else
+
request.makeRequest(mae, userData,
IPerfsonarRequest.MA_MetadataRetrieveRequest, new
MetadataListResponseListener(dataList), false);

} catch (Exception x) {
logger.error(x);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -1,5 +1,5 @@
/*
-Copyright perfsonar.acad.bg (C) 2005-2007
+Copyright perfsonar.acad.bg (C) 2005-2008
Contact:


This program is free software; you can redistribute it and/or
@@ -26,9 +26,17 @@
import java.awt.LayoutManager;
import java.text.SimpleDateFormat;
import java.util.Hashtable;
+import java.util.Locale;
import java.util.ResourceBundle;
import java.util.TimeZone;

+import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JTable;
+import javax.swing.table.AbstractTableModel;
+
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
@@ -52,12 +60,13 @@
* @author Nina Jeliazkova
*
*/
-public class MAResponseChartPanel extends ResponseChartPanel /* implements
ChangeListener */{
+public class MAResponseChartPanel extends
ResponseChartPanel<PerfsonarTimeSeries> /* implements ChangeListener */{
/**
*
*/
private static final long serialVersionUID = -8314602929727850428L;
-
+ protected XYItemRenderer renderer[][];
+
public MAResponseChartPanel(IPerfsonarTab psModel,
PerfsonarTimeSeriesDataset ifDataset) {
super(psModel, ifDataset);
@@ -101,7 +110,7 @@
* @return A sample chart.
*/
@Override
- protected JFreeChart createChart(IPerfsonarTab psModel,Hashtable
datasets) {
+ protected JFreeChart createChart(IPerfsonarTab
psModel,Hashtable<String,PerfsonarTimeSeries> datasets) {
ResourceBundle rb = psModel.getResourceBundle();
bitAxis = new
NumberAxis(rb.getString(MAResourceKeys.msg_utilization_mbs)) {
/**
@@ -142,26 +151,30 @@
dateAxis.setDateFormatOverride(new SimpleDateFormat("d MMM yy
HH:mm"));


- plot = new
XYPlot(((PerfsonarTimeSeries)datasets.get("outbound")), dateAxis, bitAxis,
null);
- XYItemRenderer renderer = new
XYLineAndShapeRenderer(true,false);
- renderer.setSeriesPaint(0,MAPerfsonarModel.outSeriesColor[1]);
- ((XYPlot)plot).setRenderer(0,renderer);
-
+ plot = new XYPlot((datasets.get("outbound")), dateAxis,
bitAxis, null);
+ renderer = new XYItemRenderer[3][2];
+ renderer[0][1] = new XYLineAndShapeRenderer(true,false);
+
renderer[0][1].setSeriesPaint(0,MAPerfsonarModel.outSeriesColor[1]);
+ renderer[0][1].setSeriesVisible(0,true);
+ ((XYPlot)plot).setRenderer(0,renderer[0][1]);

-
((XYPlot)plot).setDataset(1,((PerfsonarTimeSeries)datasets.get("inbound")));
- renderer = new XYAreaRenderer2();
- renderer.setSeriesPaint(0,MAPerfsonarModel.inSeriesColor[1]);
- ((XYPlot)plot).setRenderer(1,renderer);
+ ((XYPlot)plot).setDataset(1,datasets.get("inbound"));
+ renderer[0][0] = new XYAreaRenderer2();
+ renderer[0][0].setSeriesVisible(0,true);
+
renderer[0][0].setSeriesPaint(0,MAPerfsonarModel.inSeriesColor[1]);
+ ((XYPlot)plot).setRenderer(1,renderer[0][0]);

-
((XYPlot)plot).setDataset(2,((PerfsonarTimeSeries)datasets.get("Eps")));
- renderer = new XYStepRenderer();
- renderer.setSeriesPaint(0,Color.red);
- ((XYPlot)plot).setRenderer(2,renderer);
+ ((XYPlot)plot).setDataset(2,datasets.get("Eps"));
+ renderer[1][0] = new XYStepRenderer();
+ renderer[1][0].setSeriesPaint(0,Color.red);
+ renderer[1][0].setSeriesVisible(0,true);
+ ((XYPlot)plot).setRenderer(2,renderer[1][0]);

-
((XYPlot)plot).setDataset(3,((PerfsonarTimeSeries)datasets.get("Dps")));
- renderer = new XYStepRenderer();
- renderer.setSeriesPaint(0,Color.black);
- ((XYPlot)plot).setRenderer(3,renderer);
+ ((XYPlot)plot).setDataset(3,datasets.get("Dps"));
+ renderer[2][1] = new XYStepRenderer();
+ renderer[2][1].setSeriesPaint(0,Color.black);
+ renderer[2][1].setSeriesVisible(0,true);
+ ((XYPlot)plot).setRenderer(3,renderer[2][1]);

((XYPlot)plot).setRangeAxis(1, countAxis);
((XYPlot)plot).mapDatasetToRangeAxis(2, 1);
@@ -173,5 +186,129 @@
plot, false);
return result;
}
+
+ @Override
+ protected void configurePopup(JPopupMenu popup) {
+ popup.addSeparator();
+ ResourceBundle b =
ResourceBundle.getBundle("org.perfsonar.perfsonarui.ma.ResourceBundle",Locale.getDefault());
+ final String msg = b.getString("msg_metric_selection");
+ AbstractAction a = new AbstractAction(msg) {
+ private static final long serialVersionUID =
-7760099321248755441L;

+ public void
actionPerformed(java.awt.event.ActionEvent arg0) {
+ try {
+ JTable table = new JTable(new
MetricSelectionTableModel());
+ table.setShowGrid(false);
+ table.setShowHorizontalLines(false);
+ table.setShowVerticalLines(false);
+ table.setCellSelectionEnabled(false);
+ table.setRowSelectionAllowed(false);
+ table.setColumnSelectionAllowed(false);
+
table.getTableHeader().setReorderingAllowed(false);
+
table.getTableHeader().setResizingAllowed(false);
+ JPanel pane = new JPanel(new BorderLayout());
+ pane.setLayout(new BorderLayout()); // unless
already there
+ pane.add(table, BorderLayout.CENTER);
+ pane.add(table.getTableHeader(),
BorderLayout.NORTH);
+ table.setBackground(pane.getBackground());
+ table.setGridColor(pane.getBackground());
+ JOptionPane.showMessageDialog(
+ chartPanel,
+ pane,
+ msg,
+ JOptionPane.PLAIN_MESSAGE
+ );
+ } catch (Exception x) {
+ showHelp("N/A");
+ }
+
+ };
+ };
+
+ popup.add(a);
+ super.configurePopup(popup);
+ }
+
+
+ class MetricSelectionTableModel extends AbstractTableModel {
+ /**
+ *
+ */
+ private static final long serialVersionUID =
-3848462841862460488L;
+ protected final int nrows = 3;
+ protected final int ncols = 3;
+ protected final String[] columnHeaders= new String[]
{"Metric","In","Out"};
+ protected final String[] rowHeaders= new String[]
{"Utilisation","Errors","Drops"};
+
+ public MetricSelectionTableModel() {
+ super();
+ for (int i=0; i < renderer.length;i++) {
+ for (int j=0; j < renderer[i].length;j++) {
+ if (renderer[i][j]!=null)
+
System.out.print(renderer[i][j].getSeriesVisible(0));
+ System.out.print('\t');
+ }
+ System.out.print('\n');
+ }
+ }
+ protected final String[][] enabled = new String[][] {
+ {"inbound","outbound"},
+ {"Eps",null},
+ {null,"Dps"},
+ };
+
+ public int getColumnCount() {
+ return ncols;
+ }
+
+ public int getRowCount() {
+ return nrows;
+ }
+
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ if (columnIndex == 0)
+ return rowHeaders[rowIndex];
+ else {
+ String key = enabled[rowIndex][columnIndex-1];
+ if (key == null) return Boolean.FALSE;
+ else {
+ if (renderer[rowIndex][columnIndex-1]
== null)
+ return Boolean.FALSE;
+ else
+ return
renderer[rowIndex][columnIndex-1].getSeriesVisible(0);
+ }
+ }
+ }
+ @Override
+ public void setValueAt(Object value, int rowIndex, int
columnIndex) {
+ if (columnIndex == 0)
+ return;
+ else {
+ String key = enabled[rowIndex][columnIndex-1];
+ if (key == null) return;
+ else {
+ if (renderer[rowIndex][columnIndex-1]
== null)
+ return;
+ else
+
renderer[rowIndex][columnIndex-1].setSeriesVisible(0,(Boolean)value);
+ }
+ }
+ }
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return columnIndex>0;
+ }
+ @Override
+ public String getColumnName(int column) {
+ return columnHeaders[column];
+ }
+ @Override
+ public Class<?> getColumnClass(int columnIndex) {
+ if (columnIndex==0) return String.class;
+ else return Boolean.class;
+
+ }
+
+ }
}
+

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -19,6 +19,7 @@
*/
package org.perfsonar.perfsonarui.ma.ui.panels;

+import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;

@@ -27,6 +28,7 @@
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.ma.UserData;
import org.perfsonar.perfsonarui.plugins.IUserData;
+import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MetaDataList;
/**
*
@@ -90,9 +92,20 @@
case 9: {return
data.getResponse(UserData.names[UserData.INDEX_IFBITS_OUT]);}
case 10: {return
data.getResponse(UserData.names[UserData.INDEX_INERRORS]);}
case 11: {return
data.getResponse(UserData.names[UserData.INDEX_OUTDISCARDS]);}
- case 12: {if (data.getEndpoint()==null)
+ case 12: {
+ Iterable<MAEndpoint> endpoints =
data.getEndpoints();
+ if (endpoints==null)
return AbstractUserData.NULL_DATA;
- else return data.getEndpoint().getTitle();
+ else {
+ if (endpoints == null) return
"Unknown";
+ ArrayList<String> b = new
ArrayList<String>();
+ for (MAEndpoint e :
endpoints) {
+ if
(b.indexOf(e.getTitle())==-1)
+
b.add(e.getTitle());
+ }
+ return b.toString();
+ //return
data.getEndpoint().getTitle() + " [" + data.getEndpoints().size() + "]";
+ }
}
case 13: {
return data.getResponse(IUserData.C_STATUS);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetricsOptionPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetricsOptionPanel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetricsOptionPanel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -29,61 +29,73 @@

package org.perfsonar.perfsonarui.ma.ui.panels;

+import java.awt.ItemSelectable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.ArrayList;

import javax.swing.BoxLayout;
-import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
import javax.swing.JPanel;
-import javax.swing.JRadioButton;

import org.perfsonar.perfsonarui.ma.MAPerfsonarModel;
+import org.perfsonar.perfsonarui.ma.MARequest_NMWG2;
+import org.perfsonar.perfsonarui.ma.Metric;

-public class MetricsOptionPanel extends JPanel implements ActionListener {
- protected MAPerfsonarModel model;
+public class MetricsOptionPanel extends JPanel implements ItemListener {
+ protected ArrayList<Metric> metrics;
+ protected JCheckBox[] box;
/**
*
*/
private static final long serialVersionUID = -3044215507776120200L;
- //protected String currentEventType;
- protected String[][] metrics = {
-
{"Utilization","http://ggf.org/ns/nmwg/characteristic/utilization/2.0"},
- {"Input
errors","http://ggf.org/ns/nmwg/characteristic/errors/2.0"},
- {"Output
drops","http://ggf.org/ns/nmwg/characteristic/discards/2.0"}
/*
{"Non-unicast
packets","http://ggf.org/ns/nmwg/characteristic/packets/nonunicast/2.0/"},
{"Unicast
packets","http://ggf.org/ns/nmwg/characteristic/packets/unicast/2.0/"}
*/
- };

- public MetricsOptionPanel(MAPerfsonarModel model) {
+ public MetricsOptionPanel(ArrayList<Metric> metrics) {
super();
- this.model = model;
+ this.metrics = metrics;
addWidgets();

}

protected void addWidgets() {
setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
- ButtonGroup g = new ButtonGroup();
-
- for (int i=0; i < metrics.length;i++) {
- JRadioButton b = new JRadioButton(metrics[i][0]);
- b.setActionCommand(metrics[i][1]);
- b.addActionListener(this);
- b.setSelected(metrics[i][1].equals(model.getCurrentEventType()));
- g.add(b);
- add(b);
+ box = new JCheckBox[metrics.size()];
+ for (int i=0; i < metrics.size();i++) {
+ box[i] = new JCheckBox(metrics.get(i).toString());
+ box[i].addItemListener(this);
+ box[i].setSelected(metrics.get(i).isEnabled());
+ add(box[i]);
}

}
public String toString() {
- return "Metrics";
+ return "Metric selection";
}
- public void actionPerformed(ActionEvent arg0) {

- model.setCurrentEventType(arg0.getActionCommand());
-
+ public void itemStateChanged(ItemEvent e) {
+ ItemSelectable source = e.getItemSelectable();
+
+ for (int i=0; i < metrics.size();i++)
+ if (source == box[i]) {
+ switch (e.getStateChange()) {
+ case ItemEvent.DESELECTED: {
+ metrics.get(i).setEnabled(false);
+ return;
+ }
+ case ItemEvent.SELECTED: {
+ metrics.get(i).setEnabled(true);
+ return;
+ }
+ default: {
+ return;
+ }
+ }
+ }
}
-
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -44,6 +44,7 @@
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
import org.perfsonar.perfsonarui.plugins.IUserData;
+import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.ui.PluginMainPanel;
import org.perfsonar.perfsonarui.ui.panels.TextPanel;

@@ -57,7 +58,18 @@
protected TextPanel query;
protected TextPanel response;
protected JFormattedTextField urlField;
+ protected MAEndpoint active_endpoint;

+ public MAEndpoint getActive_endpoint() {
+ return active_endpoint;
+ }
+ public void setActive_endpoint(MAEndpoint active_endpoint) {
+ if (active_endpoint != null)
+ urlField.setText(active_endpoint.getEndpoint());
+ else
+ urlField.setText("");
+ this.active_endpoint = active_endpoint;
+ }
/**
*
*/
@@ -101,7 +113,11 @@
JToolBar t = new JToolBar();
t.setFloatable(false);
t.add(new JLabel("Service address"));
- urlField = new JFormattedTextField(data.getEndpoint().getEndpoint());
+ urlField = new JFormattedTextField();
+ for (MAEndpoint e: data.getEndpoints()) {
+ setActive_endpoint(e);
+ break;
+ }
urlField.addFocusListener(this);
t.add(urlField);
add(t,BorderLayout.NORTH);
@@ -122,7 +138,11 @@
} else if (AbstractUserData.DOCUMENT_RESPONSE.equals(arg1)) {

response.getTextArea().setText(data.getResponse(AbstractUserData.DOCUMENT_RESPONSE));
} else
- urlField.setText(((IUserData)
arg0).getEndpoint().getEndpoint());
+ for (MAEndpoint e: data.getEndpoints()) {
+ setActive_endpoint(e);
+ break;
+ }
+
}

}
@@ -164,7 +184,8 @@
*/
public void focusLost(FocusEvent arg0) {
if (arg0.getSource() == urlField) {
-
model.getUserData().getEndpoint().setEndpoint(urlField.getText());
+ active_endpoint.setEndpoint(urlField.getText());
+ model.getUserData().setEndpoint(active_endpoint);
}

}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -78,7 +78,7 @@
/*
* Status bar is listening for events fired from
request
*/
- request.fireStatusMessage("Sending request to " +
userData.getEndpoint() + " for " + userData.toString());
+ request.fireStatusMessage("Sending request for " +
userData.toString());

boolean runInThread = false;
request.makeRequest(

Added: branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/Batch.java

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/EventType.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IPerfsonarRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IPerfsonarRequest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IPerfsonarRequest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -88,7 +88,17 @@
* @param runInThread True if spans a new thread for the request. False
for synchronous call.
*/
public void makeRequest(IUserData uData, String messageType,
IPerfsonarResponse response, boolean runInThread) ;
+
/**
+ *
+ * @param endpoint overrides
{@link
IUserData#getEndpoint()}
+ * @param uData The
{@link
IUserData} containing all information to generate the XML message.
+ * @param messageType
+ * @param response
+ * @param runInThread True if spans a new thread for the request. False
for synchronous call.
+ */
+ public void makeRequest(MAEndpoint endpoint, IUserData uData, String
messageType, IPerfsonarResponse response, boolean runInThread) ;
+ /**
* Aggregated request for
{@link
MetaDataList}
* @param endpoint The
{@link
MAEndpoint} to query
* @param queryList the data to generate the request
@@ -228,4 +238,5 @@
//public int isReady();
public void interrupt();

+
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IUserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IUserData.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/IUserData.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -29,7 +29,7 @@
* @author nina
*
*/
-public interface IUserData extends Comparable, Serializable {
+public interface IUserData extends Comparable<IUserData>, Serializable {
public final static String C_HOSTNAME="hostName";
public final static String C_IFNAME = "ifName";
public final static String C_IFADDRESS = "ifAddress";
@@ -43,6 +43,7 @@
public final static String C_STATUS="STATUS";
public final static String C_EVENTTYPE="eventType";

+ public static String DOMAIN = "Domain";
/**
* Clears both query and response data.
*
@@ -58,17 +59,35 @@
*
*/
public void clearResponse();
+
+ public Iterable<MAEndpoint> getEndpoints();
+
+ //public MAEndpointList getEndpoints();
+
+
/**
*
* @return endpoint
{@link
MAEndpoint}
*/
- public MAEndpoint getEndpoint();
+ //public MAEndpoint getEndpoint();
/**
* Sets the endpoint for this query. Generally, this endpoint is used
to identify the service to be queried.
* @param endpoint
*/
public void setEndpoint(MAEndpoint endpoint) ;
+
/**
+ * add an endpoint
+ * @param endpoint
+ */
+ public void addEndpoint(MAEndpoint endpoint) ;
+
+ /**
+ * remove endpoint
+ * @param endpoint
+ */
+ public void removeEndpoint(MAEndpoint endpoint) ;
+ /**
* Sets a response name/value pair. Example:
* <pre>
* setResponse("ifAddress","194.141.0.1");

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpoint.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpoint.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpoint.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -19,6 +19,8 @@
*/
package org.perfsonar.perfsonarui.plugins;

+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Observable;

import org.apache.axis.AxisFault;
@@ -43,15 +45,7 @@
*
* @author Nina Jeliazkova

<b>Modified</b> 2005-12-10
*/
-/*
-serviceName perfSONAR PIONIER RRD MA
-accessPoint
http://rrdma.perfsonar.pionier.net.pl:8080/geant2-java-rrd-ma/services/MeasurementArchiveService
-serviceType ma
-serviceDescription perfSONAR PIONIER RRD MA
-serviceVersion 3.0
-organization PIONIER
-contactEmail

-*/
+
public class MAEndpoint extends Observable implements Comparable<MAEndpoint>
{
protected boolean enabled = true;
//organisation
@@ -70,7 +64,13 @@
protected String serviceName = "";
//
protected String authRealm = "";
- protected String[] event = {"utilization","utilization"};
+ protected int event = -1;
+ protected ArrayList<String> supportedEventTypes = null;
+
+ public ArrayList<String> getSupportedEventTypes() {
+ return supportedEventTypes;
+ }
+
protected IPerfsonarSchema type;


@@ -97,6 +97,7 @@
public MAEndpoint() {
super();
type = PerfsonarSchema.getInstance("Unknown");
+ supportedEventTypes = new ArrayList<String>();
}
public void clear() {
setTitle("");
@@ -118,17 +119,14 @@
if (result.length > 2) {
result[2] = result[2].trim();
type = PerfsonarSchema.getInstance(result[2]);
- /*
- for (int i = 0; i < versions.length; i++)
- if (result[2].equals(versions[i])) {
- schema = i;
- break;
- }
- */
if (result.length > 3)
setAuthRealm(result[3]);
- if (result.length > 4) setEvent(result[4],0);
- if (result.length > 5) setEvent(result[5],1);
- }
+
+ for (int i=4;i < result.length;i++)
+ if
(supportedEventTypes.indexOf(result[i])==-1)
+
supportedEventTypes.add(EventType.getInstance(result[i]));
+ Collections.sort(supportedEventTypes);
+ if (result.length > 4)
+ setEvent(result[4]);
}
}
}

@@ -195,9 +193,14 @@
b.append(',');
b.append(authRealm);
b.append(',');
- b.append(event[0]);
- b.append(',');
- b.append(event[1]);
+ b.append(getEvent());
+
+ for (int i=0; i < supportedEventTypes.size();i++) {
+ if (i != event) {
+ b.append(',');
+ b.append(supportedEventTypes.get(i));
+ }
+ }
return b.toString();
}
public static String status2String(Object o, String lineDelimiter) {
@@ -271,15 +274,45 @@
public synchronized void setAuthRealm(String authRealm) {
this.authRealm = authRealm;
}
+ /**
+ *
+ * @param input ignored
+ * @return
+ * @deprecated use
{@link
#getEvent()};
+ */
public synchronized String getEvent(int input) {
- if (input>=0) return event[input]; else return
AbstractUserData.NULL_DATA;
+ return getEvent();
}
+ public synchronized String getEvent() {
+ if ((event >= supportedEventTypes.size()) || (event < 0))
+ return EventType.getInstance(AbstractUserData.NULL_DATA);
+ else
+ return supportedEventTypes.get(event);
+ }
+ /**
+ *
+ * @param event
+ * @param input ignored
+ * @deprecated Use
{@link
#setEvent(String)}
+ */
public synchronized void setEvent(String event, int input) {
- if (input>=0) this.event[input]=event; else {
- this.event[0] = event.trim();
- this.event[1] = event.trim();
- }
+ setEvent(event);
}
+ public synchronized void setEvent(String event) {
+ if (event == null)
+ this.event = -1;
+ else if (AbstractUserData.NULL_DATA.equals(event))
+ this.event = -1;
+ else {
+ this.event =
supportedEventTypes.indexOf(EventType.getInstance(event.trim()));
+ if (this.event < 0) {
+ supportedEventTypes.add(event);
+ Collections.sort(supportedEventTypes);
+ this.event =
supportedEventTypes.indexOf(EventType.getInstance(event.trim()));
+ }
+ }
+ }
+
/*
public boolean isStatusOK() {
return statusOK;
@@ -321,9 +354,12 @@
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
- else if (obj instanceof MAEndpoint)
- return ((MAEndpoint)obj).getEndpoint().equals(getEndpoint());
- else return false;
+ else if (obj instanceof MAEndpoint) {
+ MAEndpoint other = ((MAEndpoint)obj);
+ return other.getEndpoint().equals(getEndpoint())
+ && other.getSchema().equals(getSchema())
+ && other.getEvent().equals(getEvent());
+ } else return false;
}
public int compareTo(MAEndpoint arg0) {
if (arg0 == null) return -1;
@@ -347,4 +383,18 @@
public void setServiceVersion(String serviceVersion) {
this.serviceVersion = serviceVersion;
}
+
+ public int hashCode() {
+ int hash = 7;
+ int var_code = (null == endpoint ? 0 : endpoint.hashCode());
+ hash = 31 * hash + var_code;
+ var_code = (null == getSchema() ? 0 :
getSchema().toString().hashCode());
+ hash = 31 * hash + var_code;
+ var_code = (null == getEvent() ? 0 : getEvent().hashCode());

+ return hash;
+ }
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return new MAEndpoint(toString());
+ }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MAEndpointList.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -27,10 +27,11 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
-import java.util.Vector;

import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.PSLogger;
@@ -42,11 +43,11 @@
* @author Nina Jeliazkova

* <b>Modified</b> 2005-12-10
*/
-public class MAEndpointList extends Observable implements Observer{
+public class MAEndpointList extends Observable implements Observer,
Iterable<MAEndpoint>{
public static PSLogger logger = new PSLogger(MAEndpointList.class);
protected String origin = "N/A";
protected List<IPerfsonarSchema> supported = null;
- protected Vector<MAEndpoint> list;
+ protected List<MAEndpoint> list;
protected boolean multipleEndpoints = true;
/**
*
@@ -56,7 +57,7 @@
}
public MAEndpointList(boolean multiple) {
super();
- list = new Vector<MAEndpoint>();
+ list = new ArrayList<MAEndpoint>();
setMultipleEndpoints(multiple);
}
/**
@@ -203,11 +204,24 @@
* @param endpoint
*/
public void add(MAEndpoint endpoint) {
- list.add(endpoint);
- endpoint.addObserver(this);
+ if (!list.contains(endpoint)) {
+ list.add(endpoint);
+ endpoint.addObserver(this);
+ }
setChanged();
notifyObservers(endpoint);
}
+ public MAEndpoint remove(MAEndpoint o) {
+ if (list.remove(o)) {
+ if (o instanceof Observable)
+ ((Observable)o).deleteObserver(this);
+ setChanged();
+ notifyObservers(o);
+ return o;
+ } else
+ return null;
+
+ }
/**
* Removes item from the list.
* @param index
@@ -296,5 +310,8 @@
*/
return mae;
}
-
+ public Iterator<MAEndpoint> iterator() {
+ return list.iterator();
+ }
+
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MetaDataList.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MetaDataList.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/MetaDataList.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -85,7 +85,8 @@
*/
}
public void add(IUserData userData) {
- if (list.indexOf(userData) == -1) {
+ int index = list.indexOf(userData);
+ if (index == -1) {
list.add(userData);

if (userData.getNum()<0)
@@ -97,6 +98,10 @@
setChanged();
notifyObservers(userData);
*/
+ } else {
+ IUserData oldData = list.get(index);
+ for (MAEndpoint e: userData.getEndpoints())
+ oldData.addEndpoint(e);
}
}
public IUserData get(int index) {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/UnsupportedSchemaException.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/UnsupportedSchemaException.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/UnsupportedSchemaException.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -48,14 +48,6 @@
}

/**
- * @param message
- */
- public UnsupportedSchemaException(IUserData query,String message) {
- super(query,message);
-
- }
-
- /**
* @param cause
*/
public UnsupportedSchemaException(MAEndpoint maEndpoint,Throwable cause)
{

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/MARequest_NMWG2_Test.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/MARequest_NMWG2_Test.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/MARequest_NMWG2_Test.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -114,7 +114,7 @@
for (int i=0;i < 10;i++) {
//for (int i=0;i < nodes.size();i++) {
list.get(i).makeQueryFromResponse();
- list.getUserData(i).setDirection(UserData.DIRECTION_UNKNOWN);
+ list.getUserData(i).setDirection(UserData.DIRECTION.UNKNOWN);
newList.add(list.get(i));
}
newList.setTimeInterval(120*60);//2 hours
@@ -123,7 +123,7 @@


//ResponseData responseData = new ResponseData();
-
r.makeRequest(queryData.getEndpoint(),newList,IPerfsonarRequest.MA_SetupDataRequest,
+ r.makeRequest(endpoint,newList,IPerfsonarRequest.MA_SetupDataRequest,
new TimeValueListResponseListener(newList),false);

}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/SmartMARequestTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/SmartMARequestTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/SmartMARequestTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -119,12 +119,12 @@
assertEquals("Gi0/0",
ud.getResponse(UserData.C_IFNAME));
ResponseData response = new ResponseData();
//ud.setQuery(UserData.C_DIRECTION, "out");
-
ud.setDirection(UserData.C_DIRECTIONS[UserData.DIRECTION_OUTPUT]);
+ ud.setDirection(UserData.DIRECTION.OUT);


//smartRequest.makeRequest(ud, response);
ud.makeQueryFromResponse();
-
ud.setDirection(UserData.C_DIRECTIONS[UserData.DIRECTION_OUTPUT]);
+ ud.setDirection(UserData.DIRECTION.OUT);
long time = System.currentTimeMillis()/1000 -
60*24;
ud.setTime(time,60*24);
smartRequest.makeRequest( ud,
IPerfsonarRequest.MA_SetupDataRequest, new
TimeValueResponseListener(response), false);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/UserDataTest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/test/UserDataTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/test/UserDataTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -26,6 +26,7 @@

import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.ma.UserData;
+import org.perfsonar.perfsonarui.ma.UserData.DIRECTION;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;

public class UserDataTest extends TestCase {
@@ -186,20 +187,25 @@
*/
public void testGetEndpoint() {
UserData u = new UserData();
- MAEndpoint ma = u.getEndpoint();
- assertNotNull(ma);
- assertEquals("NMWG2v2",ma.getSchema());
+ for (MAEndpoint ma: u.getEndpoints()) {
+ assertNotNull(ma);
+ assertEquals("NMWG2v2",ma.getSchema());
+ }

- ma = new
MAEndpoint("ISTF-Python,http://selena.acad.bg:8090,NMWG2v2_netutil,\"\",utilization,utilization";);
- u.setEndpoint(ma);
- assertEquals("NMWG2v2_netutil",ma.getSchema());
+ u.setEndpoint(
+ new
MAEndpoint("ISTF-Python,http://selena.acad.bg:8090,NMWG2v2_netutil,\"\",utilization,utilization";)
+ );
+ for (MAEndpoint ma: u.getEndpoints()) {
+ assertNotNull(ma);
+
assertEquals("NMWG2v2_netutil",ma.getSchema().getSchema());
+ }

}


/*
* Test method for
'org.perfsonar.perfsonarui.UserData.setCharacteristic(String)'
- */
+
public void testSetCharacteristic() {
UserData data = new UserData();
String v = "utilization";
@@ -207,9 +213,9 @@


assertEquals(v,data.getCharacteristic(AbstractUserData.ID_QUERY));
}
+*/


-
/*
* Test method for
'org.perfsonar.perfsonarui.UserData.makeQueryFromResponse()'
*/
@@ -248,7 +254,7 @@
*/
public void testSetOctets() {
UserData u = new UserData();
-
u.setResponse(UserData.C_DIRECTIONS[UserData.DIRECTION_INPUT], "in");
+ u.setResponse(UserData.C_DIRECTION,
UserData.DIRECTION.IN.toString());
u.setResponse(UserData.C_CAPACITY, "10000");
u.setOctets(5000);
System.out.println(u.getMBitsInInt());
@@ -290,12 +296,21 @@
u.setResponse(UserData.C_IFDESCRIPTION, "nina.acad.bg");

assertEquals("nina.acad.bg",u.getIfDescr(AbstractUserData.ID_RESPONSE));

- u.setResponse(UserData.C_DIRECTION,
UserData.C_DIRECTIONS[UserData.DIRECTION_INPUT]);
+
u.setResponse(UserData.C_DIRECTION,UserData.DIRECTION.IN.toString());
assertTrue(u.isInput());

}

+ public void testDirection() {
+ UserData u = new UserData();
+
+ u.setDirection(UserData.DIRECTION.IN);
+ assertTrue(u.isInput());

+ u.setDirection(UserData.DIRECTION.OUT);
+ assertTrue(u.isOutput());
+ }
+
/*
* Test method for 'org.perfsonar.perfsonarui.UserData.getRowCount()'
*/
@@ -343,7 +358,8 @@
*/
public void testSetInput() {
UserData u = new UserData();
- u.setResponse(UserData.C_DIRECTION,
UserData.C_DIRECTIONS[UserData.DIRECTION_INPUT]);
+
+ u.setResponse(UserData.C_DIRECTION,
UserData.DIRECTION.IN.toString());
assertTrue(u.isInput());
}


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/GlobalLSTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/GlobalLSTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/GlobalLSTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -12,10 +12,11 @@
* @author Nina Jeliazkova

*
*/
+
public class GlobalLSTest extends LSTest<LSQueryRaw> {
protected void setUp() throws Exception {
- testLS =
"http://loco4.man.poznan.pl:8080/gls/services/LookupService";;
- //testLS =
"http://sonar1.amsterdam.surfnet.nl:8080/xml-ls-home/services/LookupService";;
+ testLS =
"http://ls.perfsonar.pionier.net.pl:9990/perfSONAR_PS/services/gLS";;
+
super.setUp();
};
@Override

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSDiscoveryTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSDiscoveryTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSDiscoveryTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -14,7 +14,7 @@
public class LSDiscoveryTest extends LSTest<LSDiscoveryQuery> {
@Override
protected void setUp() throws Exception {
- testLS =
"http://loco4.man.poznan.pl:8080/gls/services/LookupService";;
+ //testLS =
"http://loco4.man.poznan.pl:8080/gls/services/LookupService";;
super.setUp();
}
@Override
@@ -51,7 +51,8 @@
for (int i=0; i < xqueryResult.size();i++) {
System.out.print(xqueryResult.get(i));
System.out.print('\t');
- System.out.println(xqueryResult.get(i).getEndpoint());
+ for (MAEndpoint e: xqueryResult.get(i).getEndpoints())
+ System.out.println(e);

}

@@ -66,8 +67,10 @@
System.out.println(interfaces);
assertEquals(2,interfaces.size());

+ for (MAEndpoint e: interfaces.get(0).getEndpoints()) {
+ assertEquals("hls",e.getSchema().toString());
+
assertEquals("http://loco4.man.poznan.pl:8080/xml-ls-home/services/LookupService",e.getEndpoint());
+ }

-
assertEquals("hls",interfaces.get(0).getEndpoint().getSchema().toString());
-
assertEquals("http://loco4.man.poznan.pl:8080/xml-ls-home/services/LookupService",interfaces.get(0).getEndpoint().getEndpoint());
}
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQueryMetadataTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQueryMetadataTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSQueryMetadataTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -21,7 +21,7 @@
public class LSQueryMetadataTest extends LSTest<LSQueryMetadata> {
@Override
protected void setUp() throws Exception {
- testLS =
"http://loco4.man.poznan.pl:8080/xml-ls-home/services/LookupService";;
+ //testLS =
"http://loco4.man.poznan.pl:8080/xml-ls-home/services/LookupService";;
super.setUp();
}
public void test() throws Exception {
@@ -83,15 +83,18 @@
assertNotNull(interfaces);
System.out.println(interfaces);
assertEquals(2,interfaces.size());
- assertNotNull(interfaces.get(0).getEndpoint());
- assertNotNull(interfaces.get(1).getEndpoint());
-
assertEquals("http://ggf.org/ns/nmwg/characteristic/utilization/2.0",interfaces.get(0).getEndpoint().getEvent(0));
-
assertEquals("http://schemas.perfsonar.net/2.0",interfaces.get(0).getEndpoint().getSchema().toString());

- System.out.println(interfaces.get(0).getEndpoint());
- System.out.println(interfaces.get(1).getEndpoint());
-
assertEquals(interfaces.get(0).getEndpoint(),interfaces.get(1).getEndpoint());
+ assertNotNull(interfaces.get(0).getEndpoints());
+ assertNotNull(interfaces.get(1).getEndpoints());

+ for (MAEndpoint e: interfaces.get(0).getEndpoints()) {
+
assertEquals("http://ggf.org/ns/nmwg/characteristic/utilization/2.0",e.getEvent());
+
assertEquals("http://schemas.perfsonar.net/2.0",e.getSchema().toString());
+ }
+ System.out.println(interfaces.get(0).getEndpoints());
+ System.out.println(interfaces.get(1).getEndpoints());
+
assertEquals(interfaces.get(0).getEndpoints(),interfaces.get(1).getEndpoints());

+
/*
assertEquals("PIONIER",endpoints.get(0).getTitle());

assertEquals("http://rrdma.perfsonar.pionier.net.pl:8080/geant2-java-rrd-ma/services/MeasurementArchiveService",endpoints.get(0).getEndpoint());

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSTest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/LSTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -5,12 +5,7 @@
import org.perfsonar.perfsonarui.ls.LSXQuery;

public abstract class LSTest<Q extends LSXQuery> extends TestCase {
- //protected String testLS =
"http://sonar1.amsterdam.surfnet.nl:8080/xml-ls/services/LookupService";;
- //protected String testLS =
"PIONIER-LS,http://ls.perfsonar.pionier.net.pl:8080/xml-ls/services/LookupService,ls,,ls,ls";;
- protected String testLS =
"http://uran.acad.bg:8080/xml-ls-home/services/LookupService";;
-
//http://sonar1.amsterdam.surfnet.nl:8080/xml-ls/services/LookupService
- //protected String testLS =
"BREN-LS,http://uran.acad.bg:8080/XML-LS/services/LookupService,ls,,ls,ls";;
- //protected String testLS =
"ISTF-LS,http://selena.acad.bg:8070/axis/services/LookupService,ls,,ls,ls";;
+ protected String testLS =
"http://ls.perfsonar.pionier.net.pl:8180/geant2-java-xml-ls/services/LookupService";;
protected Q query;
@Override
protected void setUp() throws Exception {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/TracerouteTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/TracerouteTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ls/TracerouteTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -72,13 +72,13 @@
LSManager.getInstance(new
URL("http://perfsonar.acad.bg/psui_beta/MA.conf";));
Lookup l = new MockLookup();
l.lookup(list);
- //System.out.println(list);
assertNotNull(list);
assertTrue(list.size()>0);
for (int i=0; i < list.size();i++) {
System.out.print(list.get(i));
System.out.print('\t');
- System.out.println(list.get(i).getEndpoint());
+ for (MAEndpoint e: list.get(i).getEndpoints())
+ System.out.println(e);

//assertEquals("http://schemas.perfsonar.net/2.0",list.get(i).getEndpoint().getSchema().toString());
}
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/ma/MARequest_ErrorsTest.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -84,7 +84,7 @@
uData.setEndpoint(e);
uData.setQuery(UserData.C_IFADDRESS, "192.168.0.202");
uData.setQuery(UserData.C_IFNAME, "eth0");
- uData.setDirection(UserData.C_DIRECTIONS[UserData.DIRECTION_INPUT]);
+ uData.setDirection(UserData.DIRECTION.IN);

assertEquals("eth0",uData.getIfName(AbstractUserData.ID_QUERY));
try {
@@ -153,7 +153,7 @@
uData.setEndpoint(e);
uData.setQuery(UserData.C_IFADDRESS, "192.168.0.202");
uData.setQuery(UserData.C_IFNAME, "eth0");
- uData.setDirection(UserData.C_DIRECTIONS[UserData.DIRECTION_INPUT]);
+ uData.setDirection(UserData.DIRECTION.IN);
uData.setStartTime(1000);
uData.setEndTime(2000);

@@ -215,7 +215,7 @@
else
uData.setQuery(UserData.C_IFADDRESS, "192.168.0.202");
uData.setQuery(UserData.C_IFNAME, "eth0");
- uData.setDirection(UserData.DIRECTION_UNKNOWN);
+ uData.setDirection(UserData.DIRECTION.UNKNOWN);
uData.setStartTime(1000);
uData.setEndTime(2000);


Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/plugins/BatchTest.java

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/plugins/MAEndpointTest.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
2008-10-20 13:11:53 UTC (rev 4632)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
2008-10-20 13:46:17 UTC (rev 4633)
@@ -2,11 +2,11 @@
Main-Class: org.perfsonar.perfsonarui.ui.PerfSonarApp
Class-Path: jars/ui/swing-layout-1.0.jar jars/axis/saaj.jar
jars/axis/axis.jar jars/axis/axis-ant.jar jars/axis/commons-discovery-0.2.jar
jars/axis/commons-logging-1.0.4.jar jars/axis/jaxrpc.jar
jars/axis/log4j-1.2.15.jar jars/axis/wsdl4j-1.5.1.jar jars/xml/activation.jar
jars/xml/mail.jar jars/xml/jdom.jar jars/ui/jcommon-1.0.10.jar
jars/ui/jfreechart-1.0.6.jar jars/l2fprod/l2fprod-common-all.jar
jars/xml/commons-cli-1.0.jar jars/dns/dnsjava-2.0.3.jar
jars/axis/codec-1.0.jar jars/axis/bcprov-jdk15-138.jar
jars/axis/edugain-1.0-RC2.jar jars/axis/javolution-3.7.jar
jars/axis/joda-time-1.4.jar jars/axis/opensaml-1.1.jar
jars/axis/opensaml-trunk-jdk-1.5.jar
jars/axis/perfsonar-base-1.0.20080924.jar jars/axis/sasl-ca-1.0.jar
jars/axis/wsdl4j-1.5.1.jar jars/axis/wss4j-1.5.3.jar
jars/axis/xmlsec-1.4.1.jar jars/axis/xmltooling-trunk-jdk-1.5.jar
jars/xalan/xalan-2.7.0.jar jars/xalan/xalan-serializer-2.7.0.jar
jars/xalan/xerces-2.9.1-xercesImpl.jar jars/xalan/xerces-2.9.1-xml-apis.ja
r jars/axis/slf4j-api-1.4.3.jar jars/axis/slf4j-simple-1.4.3.jar
jars/axis/velocity-1.5.jar jars/axis/commons-collections-3.1.jar
jars/axis/commons-lang-2.1.jar jars/axis/openws-trunk-jdk-1.5.jar
Specification-Title: perfSonar test application
-Specification-Version: 0.13
+Specification-Version: 0.14
Specification-Vendor: perfsonar.acad.bg
Package-Title: org.perfsonar.perfsonarui
-Package-Version: 0.13
+Package-Version: 0.14
Package-Vendor: acad.bg
Implementation-Title: Perfsonar UI
-Implementation-Version: 0.13
+Implementation-Version: 0.14
Implementation-Vendor:

\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/EchoAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/EchoAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/EchoAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -77,7 +77,7 @@
data.setEndpoint(e);
e.setStatus("?");
e.setStatusExplanation("?");
-
request.makeRequest(data,IPerfsonarRequest.MA_EchoRequest, new
EchoResponse(e), true);
+
request.makeRequest(e,data,IPerfsonarRequest.MA_EchoRequest, new
EchoResponse(e), true);
}

if (!isInterrupted())

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/MetadataRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/MetadataRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/MetadataRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -93,12 +93,12 @@
boolean ok = false;
for (int i=0; i < endpoints.size();i++) {
if (isInterrupted()) break;
- MAEndpoint mae = endpoints.get(i);
+ final MAEndpoint mae = endpoints.get(i);
if (mae.isEnabled()) {
ok = true;

dataList.setNotificationEnabled(false);
userData.setEndpoint(mae);
- request.fireStatusMessage("Retrieving
metadata from " + userData.getEndpoint());
+ request.fireStatusMessage("Retrieving
metadata from " + mae);
try {
MetadataListResponseListener
listener = new MetadataListResponseListener(dataList) {
@Override
@@ -106,7 +106,7 @@

super.callException(e);

getDataList().clear();
logger.error(e.getException());
-
handleException(e.getException(),userData.getEndpoint());
+
handleException(e.getException(),mae);

getDataList().setSelectedItem(null);

//request.removePropertyChangeListener(this);
}
@@ -127,7 +127,7 @@
}

};
- request.makeRequest(
userData, IPerfsonarRequest.MA_MetadataKeyRequest, listener, false);
+ request.makeRequest(
mae,userData, IPerfsonarRequest.MA_MetadataKeyRequest, listener, false);
mae.setStatus("OK");

mae.setStatusExplanation("OK");
mae.setAlive(true );

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -91,7 +91,7 @@
String caption = "";
caption = userData.toString();
try {
- request.fireStatusMessage("Sending request to " +
userData.getEndpoint() + " for " + caption);
+ request.fireStatusMessage("Sending request for " +
caption);

prepareQuery(userData);


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/MAEndpointsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/MAEndpointsPanel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/MAEndpointsPanel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -44,7 +44,10 @@

import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
+import javax.swing.ComboBoxModel;
+import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
+import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
@@ -332,8 +335,8 @@
protected JFormattedTextField field_url;
protected JFormattedTextField field_name;
protected JFormattedTextField field_schema;
- //protected JComboBox field_schema;
- protected JFormattedTextField[] field_events;
+ protected JFormattedTextField field_event;
+ protected JComboBox field_supportedevents;

public MAEndpointPanel(List<IPerfsonarSchema> supportedSchemas) {
this(supportedSchemas,null);
@@ -391,20 +394,26 @@
c.gridwidth = GridBagConstraints.REMAINDER;
add(field_schema,c);

- field_events = new JFormattedTextField[2];
- for (int i=0; i < 2; i++) {
- field_events[i] = new JFormattedTextField();
- field_events[i].addPropertyChangeListener("value",this);
- c.weightx = 0.25;
- c.gridwidth = 1;
- String s = "Event type";
- if (i==0) s += " (in)"; else s += " (out)";
- add( new JLabel(s),c);
- c.weightx = 0.75;
- c.gridwidth = 1;
- add(field_events[i],c);
- }
+ field_event = new JFormattedTextField();
+ field_event.addPropertyChangeListener("value",this);
+ c.weightx = 0.25;
+ c.gridwidth = 1;
+ String s = "Event type";
+ add( new JLabel(s),c);
+ c.weightx = 0.75;
+ c.gridwidth = 1;
+ add(field_event,c);

+ field_supportedevents = new JComboBox(new MyComboBoxModel());
+ field_supportedevents.setEditable(false);
+ c.weightx = 0.25;
+ c.gridwidth = 1;
+ s = "Supported event types";
+ add( new JLabel(s),c);
+ c.weightx = 0.75;
+ c.gridwidth = 1;
+ add(field_supportedevents,c);
+
setEndpoint(endpoint);
}
public synchronized MAEndpoint getEndpoint() {
@@ -416,8 +425,8 @@
this.endpoint.setTitle(field_name.getText());
this.endpoint.setSchema(field_schema.getText());

//this.endpoint.setSchema(field_schema.getSelectedItem().toString());
- for (int i=0; i < 2; i++)
- this.endpoint.setEvent(field_events[i].getText(), i);
+ this.endpoint.setEvent(field_event.getText());
+ //field_supportedevents.
}
this.endpoint = endpoint;
if (endpoint != null) {
@@ -425,16 +434,17 @@
field_name.setText(endpoint.getTitle());
field_schema.setText(endpoint.getSchema().getSchema());
//field_schema.setSelectedItem(endpoint.getSchema().getSchema());
- for (int i=0; i < 2; i++)
- field_events[i].setText(endpoint.getEvent(i));
+ field_event.setText(endpoint.getEvent());
+ field_supportedevents.setSelectedIndex(0);
} else {
field_url.setText("");
field_name.setText("");
//field_schema.setSelectedItem("");
field_schema.setText("");
- for (int i=0; i < 2; i++)
- field_events[i].setText("");
+ field_event.setText("");
}
+
+
}
public void propertyChange(PropertyChangeEvent evt) {
Object src = evt.getSource();
@@ -446,10 +456,9 @@
else if (src.equals(field_schema))
endpoint.setSchema(field_schema.getText());
//endpoint.setSchema(field_schema.getSelectedItem().toString());
- else if (src.equals(field_events[0]))
- endpoint.setEvent(field_events[0].getText(),0);
- else if (src.equals(field_events[1]))
- endpoint.setEvent(field_events[1].getText(),1);
+ else if (src.equals(field_event))
+ endpoint.setEvent(field_event.getText());
+

}
public void focusGained(FocusEvent e) {
@@ -457,8 +466,24 @@

}

+ class MyComboBoxModel extends DefaultComboBoxModel {
+ /**
+ *
+ */
+ private static final long serialVersionUID =
1778057398117224298L;
+ public int getSize() {
+ if (endpoint ==null) return 0;
+ return endpoint.getSupportedEventTypes().size();
+ }
+ public Object getElementAt(int index) {
+ if (endpoint ==null) return "";
+ return endpoint.getSupportedEventTypes().get(index);
+ }
+
+ }
}

+
class CopyStatusAction extends AbstractAction {
/**
*

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2007
+Copyright (C) 2005-20078

Contact:



Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/ResponseChartPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/ResponseChartPanel.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/ResponseChartPanel.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -56,7 +56,7 @@
*
* @author Nina Jeliazkova <b>Modified</b> 2005-11-28
*/
-public abstract class ResponseChartPanel extends JPanel implements Observer
, DatasetChangeListener, PropertyChangeListener {
+public abstract class ResponseChartPanel<TimeSeries> extends JPanel
implements Observer , DatasetChangeListener, PropertyChangeListener {
protected String title = ""; //Detailed interface statistics";
protected static Color gridColor = new Color(130,30,30);
protected ChartPanel chartPanel;
@@ -136,6 +136,12 @@
chartPanel.setRangeZoomable(false);

JPopupMenu popup = chartPanel.getPopupMenu();
+ configurePopup(popup);
+
+ setLayout(new BorderLayout());
+ add(chartPanel, BorderLayout.CENTER);
+ }
+ protected void configurePopup(JPopupMenu popup) {
popup.addSeparator();
AbstractAction a = new AbstractAction("Help") {
private static final long serialVersionUID =
-7760099321248755441L;
@@ -151,10 +157,7 @@
};
};

- popup.add(a);
-
- setLayout(new BorderLayout());
- add(chartPanel, BorderLayout.CENTER);
+ popup.add(a);
}
protected void showHelp(String message) {
JOptionPane.showMessageDialog(this, getWrappedHelp(message,
80),"Help",JOptionPane.INFORMATION_MESSAGE,null);
@@ -181,7 +184,7 @@
wrappedHelp.append("</body></html>");
return wrappedHelp.toString();
}
- protected abstract JFreeChart createChart(IPerfsonarTab
psModel,Hashtable datasets) ;
+ protected abstract JFreeChart createChart(IPerfsonarTab
psModel,Hashtable<String,TimeSeries> datasets) ;

/*
* (non-Javadoc)

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/UserDataDetailsPane.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/UserDataDetailsPane.java
2008-10-20 13:11:53 UTC (rev 4632)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/UserDataDetailsPane.java
2008-10-20 13:46:17 UTC (rev 4633)
@@ -34,6 +34,7 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import org.perfsonar.perfsonarui.plugins.IUserData;
+import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MetaDataList;

/**
@@ -81,7 +82,7 @@
pane.setBorder(BorderFactory.createEtchedBorder());
add(pane,BorderLayout.CENTER);
add(label,BorderLayout.NORTH);
- label.setText(userData.getEndpoint().getTitle());
+ label.setText(getEndpointsTitle((IUserData)userData));

//setBorder(BorderFactory.createTitledBorder(title));
int h = table.getModel().getRowCount()*20;
Dimension d = new Dimension(200,h+18);
@@ -108,10 +109,7 @@
this.title = title;
label = new JLabel();
label.setMinimumSize(new Dimension(Integer.MAX_VALUE,18));
- if (userData.getEndpoint() == null)
- label.setText("Unknown");
- else
- label.setText(userData.getEndpoint().getTitle());
+ label.setText(getEndpointsTitle((IUserData)userData));
table = new
UserDataTable(dataList,columns,options_editable,query,enableColumn);
//table.setBackground(getBackground());
pane = new JScrollPane(table);
@@ -138,11 +136,20 @@
// }
}
protected void updateBorder(IUserData o) {
- if (((IUserData)o).getEndpoint()==null)
- label.setText("");
- else
- label.setText(((IUserData)o).getEndpoint().getTitle());

+ label.setText(getEndpointsTitle((IUserData)o));
}
+ protected String getEndpointsTitle(IUserData data) {
+ Iterable<MAEndpoint> endpoints = data.getEndpoints();
+ if (endpoints == null) return "Unknown";
+ StringBuffer b = new StringBuffer();
+ String delimiter = "";
+ for (MAEndpoint e : endpoints) {
+ b.append(delimiter);
+ b.append(e.getTitle());
+ delimiter = ",";
+ }
+ return b.toString();
+ }
@Override
public String toString() {
return title;



  • perfsonar: r4633 - in branches/perfsonarui: ant src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/bwctl src/org/perfsonar/perfsonarui/demo src/org/perfsonar/perfsonarui/flowsa src/org/perfsonar/perfsonarui/ippm src/org/perfsonar/perfsonarui/ippm/ui/actions src/org/perfsonar/perfsonarui/ippm/ui/panels src/org/perfsonar/perfsonarui/linkstatus src/org/perfsonar/perfsonarui/lookingglass src/org/perfsonar/perfsonarui/ls src/org/perfsonar/perfsonarui/ma src/org/perfsonar/perfsonarui/ma/ui/actions src/org/perfsonar/perfsonarui/ma/ui/panels src/org/perfsonar/perfsonarui/playground src/org/perfsonar/perfsonarui/plugins src/org/perfsonar/perfsonarui/test src/org/perfsonar/perfsonarui/test/ls src/org/perfsonar/perfsonarui/test/ma src/org/perfsonar/perfsonarui/test/plugins src/org/perfsonar/perfsonarui/ui src/org/perfsonar/perfsonarui/ui/actions src/org/perfsonar/perfsonarui/ui/panels, svnlog, 10/20/2008

Archive powered by MHonArc 2.6.16.

Top of Page