perfsonar-dev - perfsonar: r4566 - trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType
Subject: perfsonar development work
List archive
perfsonar: r4566 - trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4566 - trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType
- Date: Wed, 1 Oct 2008 07:42:47 -0400
Author: mac
Date: 2008-10-01 07:42:46 -0400 (Wed, 01 Oct 2008)
New Revision: 4566
Modified:
trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
Log:
- Success Result code in query response
- Accept only "escaped" value of the lsOutput parameter (default value if no
such parameter). Error when different parameter value used (result code:
error.ls.query.ls_output_not_accepted)
Modified:
trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
===================================================================
---
trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
2008-09-30 15:24:03 UTC (rev 4565)
+++
trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
2008-10-01 11:42:46 UTC (rev 4566)
@@ -4,6 +4,8 @@
import org.ggf.ns.nmwg.base.v2_0.EventType;
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.Parameter;
+import
org.ggf.ns.nmwg.tools.org.perfsonar.service.lookup.xquery.v1_0.Parameters;
import org.perfsonar.base.util.XMLUtils;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.lookupService.xmlType.storage.LookupServiceDAO;
@@ -31,6 +33,11 @@
"service.lookup.xquery",
"http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0",
"http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xpath/1.0",
+
"http://ogf.org/ns/nmwg/tools/org/perfsonar/service/lookup/query/control/xquery/2.0",
+
"http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/",
+
"http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xpath/1.0/",
+
"http://ogf.org/ns/nmwg/tools/org/perfsonar/service/lookup/query/control/xquery/2.0/"
+
};
@@ -64,7 +71,7 @@
throw new PerfSONARException("error.ls.not_supported", m);
}
- Metadata requestMetadata = mdArray[0];
+ Metadata requestMetadata = mdArray[0]; //temp. get any metadata
//get eventType and query type
String queryType;
@@ -81,6 +88,24 @@
throw new PerfSONARException("error.ls.no_querytype", m);
}
+ //native vs escaped
+ // <nmwg:parameter name="lsOutput">native</nmwg:parameter>
+ try {
+ //use xquery:parameters !! if other - ClassCastEx exception
+ Parameters params = (Parameters) requestMetadata.getParameters();
+ //get parameter - if not found NullPointerEx
+ String lsOutput =
params.getParameterByName("lsOutput").getParameterValue();
+ //if not null check if different from "escaped"
+ if (lsOutput!=null)
+ if (!"escaped".equals(lsOutput)) {
+ throw new
PerfSONARException("error.ls.query.ls_output_not_accepted",
+ "This version of LS supports only [escaped]
results of xquery (by default). You used ["+lsOutput+"] value.");
+ }
+ } catch (RuntimeException ex) {
+ //do nothing
+ }
+
+
logger.debug("XmlTypeLSServiceEngine: Query type (EventType) is ["+
queryType +"]");
@@ -161,6 +186,9 @@
String metadataId = "LSQueryResponseMetadata";
responseMetadata.setId(metadataId);
+ EventType evt = new EventType();
+ evt.setEventType("success.ls.query");
+ responseMetadata.setEventType(evt);
response.addChild(responseMetadata);
//add data elements to ServiceEngineResponse
- perfsonar: r4566 - trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType, svnlog, 10/01/2008
Archive powered by MHonArc 2.6.16.