perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6179 - in trunk: . perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations perfsonar-base/base/src/main/java/net/geant/perfsonar perfsonar-java-rrd-ma-base3 perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r6179 - in trunk: . perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations perfsonar-base/base/src/main/java/net/geant/perfsonar perfsonar-java-rrd-ma-base3 perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6179 - in trunk: . perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations perfsonar-base/base/src/main/java/net/geant/perfsonar perfsonar-java-rrd-ma-base3 perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd
- Date: Fri, 1 Mar 2013 13:59:01 +0000 (GMT)
- Authentication-results: sfpop-ironport07.merit.edu; dkim=neutral (message not signed) header.i=none
Author: dante.delvaux
Date: 2013-03-01 13:59:01 +0000 (Fri, 01 Mar 2013)
New Revision: 6179
Removed:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Discards.java
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Errors.java
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Utilization.java
Modified:
trunk/perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/ServiceType.java
trunk/perfsonar-java-rrd-ma-base3/pom.xml
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/RrdMAService.java
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Interface.java
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDKey.java
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDSelect.java
trunk/perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd/RrdMAWebServiceTest.java
trunk/pom.xml
Log:
RRD MA with base3: adding webservice and namespace annotations.
Modified:
trunk/perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
===================================================================
---
trunk/perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -6,7 +6,7 @@
import java.lang.annotation.Target;
/**
- * Namespace with prefix and url provided as a value.
+ * Namespace with prefix and uri provided as a value.
*
* @author <a
href="mailto:">Blazej
Pietrzak</a>
*/
Modified:
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/ServiceType.java
===================================================================
---
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/ServiceType.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/ServiceType.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -24,6 +24,8 @@
* end-to-end measurements.
*/
MP,
+ OWAMP_MP,
+ BWCTL_MP,
/**
* Measurement Archive service.
@@ -38,6 +40,10 @@
* (i.e. aggregate/correlate/filter) any data.
*/
MA,
+ HADES_MA,
+ TRACEROUTE_MA,
+ OWAMP_MA,
+ BWCTL_MA,
/**
* Lookup service.
Modified: trunk/perfsonar-java-rrd-ma-base3/pom.xml
===================================================================
--- trunk/perfsonar-java-rrd-ma-base3/pom.xml 2013-03-01 10:54:44 UTC (rev
6178)
+++ trunk/perfsonar-java-rrd-ma-base3/pom.xml 2013-03-01 13:59:01 UTC (rev
6179)
@@ -95,6 +95,20 @@
<version>4.9</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <version>1.3</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-bundle</artifactId>
+ <version>2.4.2</version>
+ <type>bundle</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/RrdMAService.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/RrdMAService.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/RrdMAService.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -1,5 +1,7 @@
package net.geant.perfsonar.ma;
+import javax.xml.ws.WebServiceProvider;
+
import net.geant.perfsonar.PerfSONAR;
import net.geant.perfsonar.ServiceType;
@@ -10,6 +12,8 @@
* @author Antoine Delvaux
<>
*
*/
+
+@WebServiceProvider
public class RrdMAService extends PerfSONAR {
@Override
Deleted:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Discards.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Discards.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Discards.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -1,30 +0,0 @@
-package net.geant.perfsonar.ma.rrd;
-
-/**
- * @author Antoine Delvaux -
- *
- */
-public class Discards {
- /**
- * Fields of eventType
"http://ggf.org/ns/nmwg/characteristic/discards/2.0/"
- * @see not sure an schema exist
- */
-
-
- private Interface iface;
-
- /**
- * All Getters
- */
- public Interface getIface() {
- return iface;
- }
-
- /**
- * All Setters
- */
- public void setIface(Interface iface) {
- this.iface = iface;
- }
-
-}
Deleted:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Errors.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Errors.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Errors.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -1,30 +0,0 @@
-package net.geant.perfsonar.ma.rrd;
-
-/**
- * @author Antoine Delvaux -
- *
- */
-public class Errors {
- /**
- * Fields of eventType
"http://ggf.org/ns/nmwg/characteristic/errors/2.0/"
- * @see
http://anonsvn.internet2.edu/svn/nmwg/trunk/nmwg/schema/rnc/errors.rnc
- */
-
-
- private Interface iface;
-
- /**
- * All Getters
- */
- public Interface getIface() {
- return iface;
- }
-
- /**
- * All Setters
- */
- public void setIface(Interface iface) {
- this.iface = iface;
- }
-
-}
Modified:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Interface.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Interface.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Interface.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -2,6 +2,7 @@
import java.net.InetAddress;
+import net.geant.perfsonar.annotations.Namespace;
import net.geant.perfsonar.annotations.XPath;
/**
@@ -24,13 +25,16 @@
private String authRealm;
private String classOfService;
private String capacity;
+
+ private String eventType;
- // Any need for this?
- private String localName = "interface";
- private String uri = "http://ggf.org/ns/nmwg/topology/2.0/";
- private String qName = "nmwgtopo:interface";
- private String prefix = "nmwgtopo";
-
+ // TODO: Should be generalised in psBase3
+ public static final String NMWG_URI = "http://ggf.org/ns/nmwg/base/2.0/";
+ public static final String NMWG_TOPO_URI =
"http://ggf.org/ns/nmwg/base/2.0/";
+ public static final String NMWG_PREFIX = "nmwg";
+ public static final String NMWG_TOPO_PREFIX = "nmwgt";
+
+
/**
* All Getters
*/
@@ -67,6 +71,9 @@
public String getCapacity() {
return capacity;
}
+ public String getEventType() {
+ return eventType;
+ }
/**
* All Setters with their @XPath annotations
@@ -76,17 +83,23 @@
this.ipAddress = ipAddress;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:hostName/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:hostName/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setHostName(String hostName) {
this.hostName = hostName;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:ifName/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:ifName/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setIfName(String ifName) {
this.ifName = ifName;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:ifDescription/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:ifDescription/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setIfDescription(String ifDescription) {
this.ifDescription = ifDescription;
}
@@ -99,29 +112,55 @@
this.ifIndex = ifIndex;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:type/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:type/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setType(String type) {
this.type = type;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:direction/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:direction/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setDirection(String direction) {
this.direction = direction;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:authRealm/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:authRealm/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setAuthRealm(String authRealm) {
this.authRealm = authRealm;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:classOfService/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:classOfService/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setClassOfService(String classOfService) {
this.classOfService = classOfService;
}
- @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:capacity/text()")
+ @XPath(xpath =
"nmwg:message/nmwg:metadata/*/nmwgt:interface/nmwgt:capacity/text()",
+ namespaces = { @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI),
+ @Namespace(prefix = NMWG_TOPO_PREFIX, uri =
NMWG_TOPO_URI) })
public void setCapacity(String capacity) {
this.capacity = capacity;
}
+
+ /**
+ * Extract the eventType which we're asked for this interface
+ * It should be one of:
+ * http://ggf.org/ns/nmwg/characteristic/utilization/2.0/
+ * http://ggf.org/ns/nmwg/characteristic/errors/2.0/
+ * http://ggf.org/ns/nmwg/characteristic/discards/2.0/
+ *
+ * @param eventType
+ */
+ @XPath(xpath = "substring(nmwg:message/nmwg:metadata/nmwg:eventType,
38)",
+ namespaces = @Namespace(prefix = NMWG_PREFIX, uri = NMWG_URI))
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
}
Modified:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDKey.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDKey.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDKey.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -35,21 +35,25 @@
* All setters with their @XPath annotations
*/
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/nmwg:key/nmwg:parameters/nmwg:parameter[name=file]/text()")
public void setFile(String file) {
this.file = file;
}
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/nmwg:key/nmwg:parameters/nmwg:parameter[name=dataSource]/text()")
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/nmwg:key/nmwg:parameters/nmwg:parameter[name=valueUnits]/text()")
public void setValueUnits(String valueUnits) {
this.valueUnits = valueUnits;
}
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/nmwg:key/nmwg:parameters/nmwg:parameter[name=eventType]/text()")
public void setEventType(String eventType) {
this.eventType = eventType;
Modified:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDSelect.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDSelect.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/RRDSelect.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -39,21 +39,25 @@
* All setters with their @XPath annotations
*/
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/select:parameters/nmwg:parameter[name=startTime]/text()")
public void setStartTime(String startTime) {
this.startTime = startTime;
}
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/select:parameters/nmwg:parameter[name=endTime]/text()")
public void setEndTime(String endTime) {
this.endTime = endTime;
}
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/select:parameters/nmwg:parameter[name=consolidationFunction]/text()")
public void setConsolidationFunction(String consolidationFunction) {
this.consolidationFunction = consolidationFunction;
}
+ // TODO: Add @Namespace annotation with NMWG constants
@XPath(xpath =
"nmwg:message/nmwg:metadata/select:parameters/nmwg:parameter[name=resolution]/text()")
public void setResolution(String resolution) {
this.resolution = resolution;
Deleted:
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Utilization.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Utilization.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd/Utilization.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -1,30 +0,0 @@
-package net.geant.perfsonar.ma.rrd;
-
-/**
- * @author Antoine Delvaux -
- *
- */
-public class Utilization {
- /**
- * Fields of eventType
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/"
- * @see
http://anonsvn.internet2.edu/svn/nmwg/trunk/nmwg/schema/rnc/utilization.rnc
- */
-
-
- private Interface iface;
-
- /**
- * All Getters
- */
- public Interface getIface() {
- return iface;
- }
-
- /**
- * All Setters
- */
- public void setIface(Interface iface) {
- this.iface = iface;
- }
-
-}
Modified:
trunk/perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd/RrdMAWebServiceTest.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd/RrdMAWebServiceTest.java
2013-03-01 10:54:44 UTC (rev 6178)
+++
trunk/perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd/RrdMAWebServiceTest.java
2013-03-01 13:59:01 UTC (rev 6179)
@@ -2,10 +2,12 @@
import static org.junit.Assert.*;
+import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import javax.xml.ws.Endpoint;
+import javax.xml.ws.soap.SOAPFaultException;
import net.geant.perfsonar.helpers.PerfSONARServiceClient;
import net.geant.perfsonar.helpers.Response;
@@ -14,6 +16,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXException;
@@ -46,9 +49,10 @@
public void shouldSayEcho() throws SAXException, InterruptedException
{
assertEquals(new Response(NMWG.toEchoResponse(REQUEST_ID)),
client.echo(REQUEST_ID));
}
-
- @Test(expected=NullPointerException.class)
- public void shouldFail() {
+
+ @Test(expected=SOAPFaultException.class)
+ @Ignore
+ public void shouldFail() throws FileNotFoundException, SAXException {
client.invoke(new
FileReader("samples/requests/MetadataKeyRequest-Discards-1.xml"));
}
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-01 10:54:44 UTC (rev 6178)
+++ trunk/pom.xml 2013-03-01 13:59:01 UTC (rev 6179)
@@ -32,10 +32,10 @@
<module>perfsonar-base/ls</module>
<module>perfsonar-base/messaging</module>
<module>perfsonar-base/apt</module>
+ <module>perfsonar-java-rrd-ma-base3</module>
<module>perfsonar_base</module>
<module>perfsonar-java-sql-ma</module>
<module>perfsonar-java-base2</module>
- <module>perfsonar-java-rrd-ma-base3</module>
<module>perfsonar-java-rrd-ma-SQL_backend</module>
<module>perfsonar-java-xml-ls</module>
<module>perfsonar-java-web-admin</module>
- [pS-dev] [GEANT/SA2/ps-java-services] r6179 - in trunk: . perfsonar-base/annotations/src/main/java/net/geant/perfsonar/annotations perfsonar-base/base/src/main/java/net/geant/perfsonar perfsonar-java-rrd-ma-base3 perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma perfsonar-java-rrd-ma-base3/src/main/java/net/geant/perfsonar/ma/rrd perfsonar-java-rrd-ma-base3/src/test/java/net/geant/perfsonar/ma/rrd, svn-noreply, 03/01/2013
Archive powered by MHonArc 2.6.16.