perfsonar-dev - perfsonar: r4105 - in trunk/geant2-java-rrd-ma: ant samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType
Subject: perfsonar development work
List archive
perfsonar: r4105 - in trunk/geant2-java-rrd-ma: ant samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4105 - in trunk/geant2-java-rrd-ma: ant samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType
- Date: Thu, 3 Jul 2008 07:13:27 -0400
Author: roman
Date: 2008-07-03 07:13:27 -0400 (Thu, 03 Jul 2008)
New Revision: 4105
Added:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-xmldb-access-test.xml
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-xmldb-content-test.xml
Modified:
trunk/geant2-java-rrd-ma/ant/test-targets.xml
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
Log:
Tests of accessing to xml db added:
1) test of simple access to xml db
request:
<nmwg:message type="EchoRequest"
id="id1"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
<nmwg:metadata id="meta">
<nmwg:eventType>http://schemas.perfsonar.net/tools/admin/echo/2.0/xmldb-access-test</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="data" metadataIdRef="meta"/>
</nmwg:message>
example response:
<nmwg:message id="id1_resp" messageIdRef="id1" type="EchoResponse"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
<nmwg:metadata id="localhost.5d5d7b4c:11ae891f6be:-7ffc">
<nmwg:eventType>success.echo</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="localhost.5d5d7b4c:11ae891f6be:-7ffe"
metadataIdRef="localhost.5d5d7b4c:11ae891f6be:-7ffc">
<nmwgr:datum xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">Xml
Database ver. 1.1.1 is accessible.</nmwgr:datum>
</nmwg:data>
</nmwg:message>
2) counting the number of nmwg:metadata and nmwg:data elements
request:
<nmwg:message type="EchoRequest"
id="id1"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
<nmwg:metadata id="meta">
<nmwg:eventType>http://schemas.perfsonar.net/tools/admin/echo/2.0/xmldb-content-test</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="data" metadataIdRef="meta"/>
</nmwg:message>
example response:
<nmwg:message id="id1_resp" messageIdRef="id1" type="EchoResponse"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
<nmwg:metadata id="localhost.5d5d7b4c:11ae891f6be:-7ff7">
<nmwg:eventType>success.echo</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="localhost.5d5d7b4c:11ae891f6be:-7ff9"
metadataIdRef="localhost.5d5d7b4c:11ae891f6be:-7ff7">
<nmwgr:datum xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">Number
of all metadata and data elements in the xml database is
13.</nmwgr:datum>
</nmwg:data>
</nmwg:message>
Modified: trunk/geant2-java-rrd-ma/ant/test-targets.xml
===================================================================
--- trunk/geant2-java-rrd-ma/ant/test-targets.xml 2008-07-03 09:56:53
UTC (rev 4104)
+++ trunk/geant2-java-rrd-ma/ant/test-targets.xml 2008-07-03 11:13:27
UTC (rev 4105)
@@ -43,6 +43,30 @@
</target>
+ <target name="echo-xmldb-access-test"
+ depends="init-test">
+ <java classname="org.perfsonar.client.testHarness.SOAPClient"
+ classpathref="classpath"
+ fork="true">
+ <arg value="${ma.local}"/>
+ <arg
value="${basedir}/samples/requests/EchoRequest-xmldb-access-test.xml"/>
+ <arg value="${basedir}/samples/requests/response-1-xmldb-access.xml"/>
+ </java>
+ </target>
+
+
+ <target name="echo-xmldb-content-test"
+ depends="init-test">
+ <java classname="org.perfsonar.client.testHarness.SOAPClient"
+ classpathref="classpath"
+ fork="true">
+ <arg value="${ma.local}"/>
+ <arg
value="${basedir}/samples/requests/EchoRequest-xmldb-content-test.xml"/>
+ <arg value="${basedir}/samples/requests/response-1-xmldb-content.xml"/>
+ </java>
+ </target>
+
+
<target name="lookup-info-test"
depends="init-test">
<java classname="org.perfsonar.client.testHarness.SOAPClient"
Added:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-xmldb-access-test.xml
Property changes on:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-xmldb-access-test.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-xmldb-content-test.xml
Property changes on:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-xmldb-content-test.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2008-07-03 09:56:53 UTC (rev 4104)
+++
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2008-07-03 11:13:27 UTC (rev 4105)
@@ -19,6 +19,7 @@
import org.ggf.ns.nmwg.base.v2_0.Metadata;
import org.ggf.ns.nmwg.base.v2_0.Parameter;
import org.ggf.ns.nmwg.base.v2_0.Parameters;
+import org.ggf.ns.nmwg.base.v2_0.EventType;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
@@ -89,7 +90,10 @@
public static final String SELECT_NAMESPACE =
"http://ggf.org/ns/nmwg/ops/select/2.0";
+ public static final String ECHO_XMLDB_ACCESS_TEST_NAMESPACE =
"http://schemas.perfsonar.net/tools/admin/echo/2.0/xmldb-access-test";
+ public static final String ECHO_XMLDB_CONTENT_TEST_NAMESPACE =
"http://schemas.perfsonar.net/tools/admin/echo/2.0/xmldb-content-test";
+
// ---------------------------------- constructors
@@ -216,8 +220,6 @@
}
} else if
(actionType.equals(ActionType.STORE_METADATA_CONFIGURATION)) {
- // TEMPORARY CHANGE !!!!!!!!!!
- //} else if (actionType.equals("STORE_METADATA_CONFIGURATION")) {
// handle STORE_METADATA_CONFIGURATION
// replace complete metadata configuration file
@@ -899,11 +901,39 @@
// this method will be used for advanced types of echo request
- String desc = "This eventType in echo request is not supported";
- return generateResultCodeResponse("error.request", desc);
+ Data data = request.getDataArray()[0];
+ Metadata metadata = request.getMetadata(data.getMetadataIdRef());
+
+ EventType eventType = metadata.getEventType();
+ String eventTypeStr = eventType.getEventType().trim();
+
+ Message response = null;
+
+ if (eventTypeStr.equals(ECHO_XMLDB_ACCESS_TEST_NAMESPACE)
+ || eventTypeStr.equals(ECHO_XMLDB_CONTENT_TEST_NAMESPACE))
+ response = executeXmlDBSimpleTest(request);
+ else
+ return generateResultCodeResponse(
+ "error.request", "This eventType in echo request is not
supported");
+
+ return response;
}
+ protected Message executeXmlDBSimpleTest(Message request) throws
PerfSONARException {
+
+ Message response = metadataConfig.fetch(request);
+ Metadata metadata = new Metadata();
+ EventType eventType = new EventType();
+ eventType.setEventType("success.echo");
+ metadata.setEventType(eventType);
+ response.setMetadata(metadata);
+ Data data = ((Data[])response.getDataArray())[0];
+ data.setMetadataIdRef(metadata.getId());
+ return response;
+ }
+
+
/**
* Method used by SQL-MA to store dynamic metadata keys.
*
- perfsonar: r4105 - in trunk/geant2-java-rrd-ma: ant samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType, svnlog, 07/03/2008
Archive powered by MHonArc 2.6.16.