perfsonar-dev - r2105 - in branches/JAVA-SQL-MA-STABLE: ant/rrdma src/org/perfsonar/commons/messages src/org/perfsonar/service/measurementArchive/rrdType
Subject: perfsonar development work
List archive
r2105 - in branches/JAVA-SQL-MA-STABLE: ant/rrdma src/org/perfsonar/commons/messages src/org/perfsonar/service/measurementArchive/rrdType
Chronological Thread
- From:
- To:
- Subject: r2105 - in branches/JAVA-SQL-MA-STABLE: ant/rrdma src/org/perfsonar/commons/messages src/org/perfsonar/service/measurementArchive/rrdType
- Date: Wed, 21 Feb 2007 06:53:34 -0500
Author: roman
Date: 2007-02-21 06:53:33 -0500 (Wed, 21 Feb 2007)
New Revision: 2105
Modified:
branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-axis-deploy-targets.xml
branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-release-targets.xml
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/commons/messages/EchoRequest.java
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
Log:
svn merge -r 2091:2102
https://svn.perfsonar.net/svn/perfsonar/trunk/perfsonar
Modified: branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-axis-deploy-targets.xml
===================================================================
--- branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-axis-deploy-targets.xml
2007-02-21 11:48:07 UTC (rev 2104)
+++ branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-axis-deploy-targets.xml
2007-02-21 11:53:33 UTC (rev 2105)
@@ -131,7 +131,7 @@
<echo>Please, make sure that Tomcat is running.</echo>
<echo>You can do it using your web browser and connect the address
http://${target.server}:${target.port}</echo>
- <echo>or looking at Tomcat's log file (catalina.out).</echo>
+ <echo>or looking at Tomcat's log file
(${tomcat.home}/logs/catalina.out).</echo>
<input message="Press Enter when finished"/>
Modified: branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-release-targets.xml
===================================================================
--- branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-release-targets.xml
2007-02-21 11:48:07 UTC (rev 2104)
+++ branches/JAVA-SQL-MA-STABLE/ant/rrdma/rrdma-release-targets.xml
2007-02-21 11:53:33 UTC (rev 2105)
@@ -24,7 +24,7 @@
comment="This file was created by the Ant configuration script.">
<entry key="service.name" value="${service.name}"/>
<entry key="build" value="build"/>
- </propertyfile>
+ </propertyfile>
</target>
Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/commons/messages/EchoRequest.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/commons/messages/EchoRequest.java
2007-02-21 11:48:07 UTC (rev 2104)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/commons/messages/EchoRequest.java
2007-02-21 11:53:33 UTC (rev 2105)
@@ -6,11 +6,20 @@
package org.perfsonar.commons.messages;
+import org.perfsonar.service.commons.exceptions.PerfSONARException;
+import org.perfsonar.service.commons.exceptions.DataFormatException;
+import org.perfsonar.service.commons.exceptions.RequestException;
import org.perfsonar.service.commons.exceptions.SystemException;
+import org.perfsonar.service.commons.exceptions.ResourceException;
import org.perfsonar.service.commons.engine.ActionType;
+import org.perfsonar.service.commons.util.ResultCodesUtil;
+import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.base.v2_0.Data;
+import org.ggf.ns.nmwg.base.v2_0.EventType;
+import java.util.ArrayList;
import java.util.Map;
@@ -48,6 +57,116 @@
}
+ public Message execute(Message reqMessage) {
+ ArrayList<Message> output = new ArrayList<Message>();
+ for (Message inputMessage: extractMultipleRequests(reqMessage)) {
+
+ try {
+
+ output.add(
+ executeEcho(inputMessage));
+
+ } catch (PerfSONARException e) {
+
+ output.add(
+ ResultCodesUtil.createResultCodeMetadata(
+ null, e));
+
+ }
+
+ }
+
+ //do one message from all result messages
+ Message respMessage = mergeMultipleResponses(output);
+
+ //if no metadata inside, print error
+ if (respMessage.getMetadataMap().values().size() == 0) {
+ ResultCodesUtil.createResultCodeMetadata(
+ respMessage,
+ new PerfSONARException(
+ "warning.common.no_metadata",
+ "No output metadata was returned by MessageHandler."+
+ " Maybe there was no data trigger, or data trigger "+
+ " didn't have valid metadataIdRef? ")
+ );
+
+ }
+
+ respMessage.setId(reqMessage.getId() + "_resp");
+ respMessage.setType(reqMessage.getType().replaceFirst("Request",
"Response"));
+ respMessage.setMessageIdRef(reqMessage.getId());
+
+ return respMessage;
+
+ }
+
+
+ protected Message executeEcho(Message request)
+ throws SystemException, RequestException, DataFormatException,
ResourceException {
+
+ Data data = request.getDataArray()[0];
+ Metadata metadata = request.getMetadata(data.getMetadataIdRef());
+
+ EventType eventType = metadata.getEventType();
+ if (eventType == null) {
+ logger.debug("EchoRequest.executeEcho: The request does not
contain "
+ + "eventType element");
+ throw new SystemException(
+ "error.request",
+ "EchoRequest.executeEcho: The request does
not contain "
+ + "eventType element");
+ }
+
+ Message response = null;
+
+ if (eventType.getEventType().equals("echo")) {
+ response = executeSimpleEcho();
+ } else if (eventType.getEventType().equals("")) {
+ response = getEmptyEventTypeResponse();
+ } else {
+ response = serviceEngine.takeAction(getType(), request);
+ }
+
+ return response;
+
+ }
+
+
+ protected Message executeSimpleEcho() {
+
+ logger.debug("EchoRequest: executeSimpleEcho()");
+
+ Message response = new Message();
+
+ PerfSONARException pex =
+ new PerfSONARException(
+ "success.echo",
+ "This is the echo response from the
service.");
+
+ ResultCodesUtil.createResultCodeMetadata(response, pex);
+
+ return response;
+
+ }
+
+
+ protected Message getEmptyEventTypeResponse() {
+
+ Message response = new Message();
+
+ PerfSONARException pex =
+ new PerfSONARException(
+ "error.echo",
+ "EventType is empty.");
+
+ ResultCodesUtil.createResultCodeMetadata(response, pex);
+
+ return response;
+
+ }
+
+
+
} //EchoRequest
Modified:
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2007-02-21 11:48:07 UTC (rev 2104)
+++
branches/JAVA-SQL-MA-STABLE/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2007-02-21 11:53:33 UTC (rev 2105)
@@ -820,18 +820,19 @@
}
- protected Message getEcho(Message request)
- throws SystemException, RequestException, DataFormatException {
+ protected Message getEcho(Message request) {
Message response = new Message();
PerfSONARException pex =
new PerfSONARException(
- "success.echo",
- "This is the echo response from the
service.");
+ "error.request",
+ "This eventType in echo request is not
supported");
+ // this method will be used for advanced types of echo request
+
ResultCodesUtil.createResultCodeMetadata(response, pex);
-
+
return response;
}
- r2105 - in branches/JAVA-SQL-MA-STABLE: ant/rrdma src/org/perfsonar/commons/messages src/org/perfsonar/service/measurementArchive/rrdType, svnlog, 02/21/2007
Archive powered by MHonArc 2.6.16.