Manuele Simi 2009-08-18 22:39:41 +00:00
parent 76c5604d7c
commit 640d3b8050
13 changed files with 176 additions and 26 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -6,6 +6,7 @@ wsdl.1 = XMLCollectionAccess
wsdl.2 = Sink_service
wsdl.3 = SinkEntry_service
wsdl.4 = DISICService
wsdl.5 = XQueryAccess
namespace.1=http://gcube-system.org/namespaces/informationsystem/collector
namespace.2=http://gcube-system.org/namespaces/informationsystem/collector/Sink
namespace.3=http://mds.globus.org/index/2004/07/12

View File

@ -10,6 +10,9 @@
<environment name="sweeperIntervalinMillis" value="120000"
type="java.lang.String" override="false" />
<environment name="registrationURI" value="http://...."
type="java.lang.String" override="false" />
<environment name="resourceExpirationTimeInMillis" value="600000"
type="java.lang.String" override="false" />
@ -68,6 +71,15 @@
type="java.lang.String"
override="false" />
</service>
<service name="gcube/informationsystem/collector/XQueryAccess">
<environment
name="name"
value="XQueryAccess"
type="java.lang.String"
override="false" />
</service>
<!-- Aggregator Framework registration portType -->

View File

@ -15,6 +15,15 @@
<wsdlFile>share/schema/org.gcube.informationsystem.collector/XMLCollectionAccess_service.wsdl</wsdlFile>
</service>
<service name="gcube/informationsystem/collector/XQueryAccess" provider="Handler" use="literal" style="document">
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
<parameter name="scope" value="Application"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="className" value="org.gcube.informationsystem.collector.impl.porttypes.XQueryAccess"/>
<parameter name="loadOnStartup" value="false"/>
<wsdlFile>share/schema/org.gcube.informationsystem.collector/XQueryAccess_service.wsdl</wsdlFile>
</service>
<service name="gcube/informationsystem/collector/SinkEntry" provider="Handler" use="literal" style="document">
<parameter name="providers"
value="GetRPProvider

View File

@ -50,7 +50,17 @@
<Name>gcube/informationsystem/collector/XMLCollectionAccess</Name>
<Security />
<WSDL />
</PortType>
</PortType>
<PortType>
<Name>gcube/informationsystem/collector/XQueryAccess</Name>
<Security />
<WSDL />
</PortType>
<PortType>
<Name>gcube/informationsystem/collector/XMLStorageAccess</Name>
<Security />
<WSDL />
</PortType>
</Main>
<Software deployable="true">
<Description>InformationCollector Stubs</Description>

View File

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DIS-IC WSDL interace
-->
<wsdl:definitions name="XMLCollectionAccess" targetNamespace="http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess"
xmlns:tns="http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

94
schema/XQueryAccess.wsdl Normal file
View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="XQueryAccess" targetNamespace="http://gcube-system.org/namespaces/informationsystem/collector/XQueryAccess"
xmlns:tns="http://gcube-system.org/namespaces/informationsystem/collector/XQueryAccess"
xmlns:corefaults="http://gcube-system.org/namespaces/common/core/faults"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsntw="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:import namespace="http://gcube-system.org/namespaces/common/core/faults" location="../gcube/common/core/faults/GCUBEFaults.wsdl"/>
<!--============================================================
T Y P E S
============================================================-->
<wsdl:types>
<xsd:schema targetNamespace="http://gcube-system.org/namespaces/informationsystem/collector/XQueryAccess"
xmlns:tns="http://gcube-system.org/namespaces/informationsystem/collector/XQueryAccess"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://gcube-system.org/namespaces/common/core/types" schemaLocation="../gcube/common/core/types/GCUBETypes.xsd"/>
<xsd:element name="XQueryExecuteRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="XQueryExpression" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="XQueryExecuteResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Dataset" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="Size" type="xsd:long" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="XQueryFaultType">
<xsd:complexType name="profileAlreadyRegisteredFault">
<xsd:complexContent>
<xsd:extension base="corefaults:GCUBEUnrecoverableFault">
<xsd:sequence/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<!--============================================================
M E S S A G E S
============================================================-->
<wsdl:message name="XQueryExecuteInputMessage">
<part name="parameters" element="tns:XQueryExecuteRequest"/>
</wsdl:message>
<wsdl:message name="XQueryExecuteOutputMessage">
<part name="parameters" element="tns:XQueryExecuteResponse"/>
</wsdl:message>
<message name="XQueryFaultTypeMessage">
<part name="fault" element="tns:XQueryFaultType"/>
</message>
<!--============================================================
P O R T T Y P E
============================================================-->
<wsdl:portType name="XQueryAccessPortType">
<wsdl:operation name="XQueryExecute">
<wsdl:input message="tns:XQueryExecuteInputMessage"/>
<wsdl:output message="tns:XQueryExecuteOutputMessage"/>
<wsdl:fault name="fault" message="tns:XQueryFaultTypeMessage"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

View File

@ -10,7 +10,10 @@ import org.globus.wsrf.impl.ReflectionResourceProperty;
import org.globus.wsrf.impl.SimpleResourcePropertyMetaData;
import org.globus.wsrf.impl.SimpleResourcePropertySet;
import org.gcube.common.core.contexts.GCUBEServiceContext;
import org.gcube.common.core.porttypes.GCUBEPortType;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
/**
* <em>Sink</em> PortType's implementation class. It's the registration PortType
@ -19,7 +22,7 @@ import org.gcube.common.core.utils.logging.GCUBELog;
* @author Manuele Simi (ISTI-CNR)
*
*/
public class Sink implements ResourceLifetime, ResourceProperties {
public class Sink extends GCUBEPortType implements ResourceLifetime, ResourceProperties {
// WS-Lifetime Properties
protected Calendar terminationTime, currentTime;
@ -28,6 +31,12 @@ public class Sink implements ResourceLifetime, ResourceProperties {
private ResourcePropertySet propSet;
/** {@inheritDoc} */
@Override
protected GCUBEServiceContext getServiceContext() {
return ICServiceContext.getContext();
}
/**
* Initializes a new Sink PortType by creating its
* {@link SimpleResourcePropertySet}

View File

@ -11,6 +11,10 @@ import org.oasis.wsrf.properties.GetResourcePropertyResponse;
import org.oasis.wsrf.servicegroup.ServiceGroupEntry;
import org.globus.wsrf.impl.properties.GetResourcePropertyProvider;
import org.gcube.common.core.contexts.GCUBEServiceContext;
import org.gcube.common.core.porttypes.GCUBEPortType;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
/**
* A ServiceGroupEntry implemenation.<br>
@ -20,7 +24,7 @@ import org.globus.wsrf.impl.properties.GetResourcePropertyProvider;
*
*/
public class SinkEntry implements ServiceGroupEntry {
public class SinkEntry extends GCUBEPortType implements ServiceGroupEntry {
private GetResourcePropertyProvider getResourcePropertyProvider = new GetResourcePropertyProvider();
@ -28,6 +32,11 @@ public class SinkEntry implements ServiceGroupEntry {
// WS-Lifetime Properties
protected Calendar terminationTime, currentTime;
/** {@inheritDoc} */
@Override
protected GCUBEServiceContext getServiceContext() {
return ICServiceContext.getContext();
}
/**
* Gets WS-Resource property by using the {@link GetResourcePropertyProvider}

View File

@ -9,8 +9,9 @@ import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
/**
* TODO: Manuele, don't forget to add a comment for this new type!!
*
* <em>XMLStorageAccess</em> portType implementation. <br/>
* It gives remote access to administration features of the XML Storage
*
* @author Manuele Simi (ISTI-CNR)
*
*/

View File

@ -1,7 +1,6 @@
package org.gcube.informationsystem.collector.impl.porttypes;
import org.globus.wsrf.utils.FaultHelper;
import org.oasis.wsrf.faults.BaseFaultType;
import org.xmldb.api.base.ResourceSet;
import org.xmldb.api.modules.XMLResource;
@ -11,49 +10,58 @@ import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XQuery;
import org.gcube.informationsystem.collector.stubs.XQueryExecuteRequest;
import org.gcube.informationsystem.collector.stubs.XQueryExecuteResponse;
import org.gcube.informationsystem.collector.stubs.XQueryFaultType;
/**
* <em>XQueryAccess</em> portType implementation
*
*
* @author Manuele Simi (ISTI-CNR)
*
*
*/
public class XQueryAccess extends GCUBEPortType {
private final GCUBELog logger = new GCUBELog(XQueryAccess.class);
/** {@inheritDoc} */
@Override
protected GCUBEServiceContext getServiceContext() {
protected GCUBEServiceContext getServiceContext() {
return ICServiceContext.getContext();
}
/*
public XQueryExecuteResponse XQueryExecute(XQueryExecuteRequest XQueryExecuteRequest) throw XQueryFaultType {
StringBuilder response = new StringBuilder();
/**
* Executes a XQuery expression in the XML storage
* @param XQueryExpression the XQuery expression
* @return a formatted XML document
* @throws XQueryFaultType if the execution fails
*/
public XQueryExecuteResponse XQueryExecute(XQueryExecuteRequest request) throws XQueryFaultType {
StringBuilder dataset = new StringBuilder();
XQueryExecuteResponse response = new XQueryExecuteResponse();
try {
logger.debug("executing XQuery: " + request.getXQueryExpression());
logger.debug("executing XQuery: " + xquery);
XQuery q = new XQuery(xquery);
XQuery q = new XQuery(request.getXQueryExpression());
ResourceSet result = State.query_manager.executeXQuery(q);
response.setSize(result.getSize());
logger.debug("number of returned documents: " + result.getSize());
response.append("<Resultset>\n");
dataset.append("<Resultset>\n");
for (int i = 0; i < (int) result.getSize(); i++) {
XMLResource xmlres = (XMLResource) result.getResource((long) i);
// logger.debug("retrieved resource - " + xmlres.getContent());
response.append("<Record>\n" + xmlres.getContent()+ "\n</Record>\n");
dataset.append("<Record>\n" + xmlres.getContent() + "\n</Record>\n");
}
response.append("</Resultset>");
dataset.append("</Resultset>");
response.setDataset(dataset.toString());
} catch (Exception e) {
BaseFaultType fault = new BaseFaultType();
XQueryFaultType fault = new XQueryFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper.addDescription("IC service: Exception when executing the requested XQuery");
throw fault;
}
}*/
return response;
}
}