Adding new XMLCollectionAccess interface (WS-DAIX compliant), comprehensive reorganization of the internal hierarchy of resources was needed, XMLStorage interface to eXist was remodeled

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Collector@30018 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2010-10-25 03:15:43 +00:00
parent 261af6ff6a
commit 75305c4169
48 changed files with 3857 additions and 1949 deletions

View File

@ -7,5 +7,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/EXISTLIBS"/>
<classpathentry kind="lib" path="/Dependencies/ISCollector/org.gcube.informationsystem.collector.stubs.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/GCF.TRUNK"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry combineaccessrules="false" kind="src" path="/DISTRO.RESOURCES"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -91,7 +91,8 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<property name="previous.stubs.package" value="${previous-package}.${stubs.dir.name}"/>
<property name="stubs.dir.name" value="stubs" /> <!-- auxiliary stub classes -->
<property name="stubs.dir" value="${source.dir}/${package.dir}/${stubs.dir.name}" />
<property name="stubs.dir" value="${source.dir}/${package.dir}/${stubs.dir.name}" />
<property name="test.dir" value="${source.dir}/${package.dir}/test" />
<available file="${stubs.dir}" property="stubs.dir.present"/>
<!-- temporary build locations -->
@ -164,6 +165,7 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
</target>
<!-- wsdl specific tasks. Clone for each additional wsdl, if required -->
<target name="processWSDL.1" depends="init" if="wsdl.1" description="Flattens wsdl and generate bindings">
<echo message="PROCESSING ${wsdl.1}'s WSDL:" level="debug"/>
<ant antfile="${build.stubs}" target="flatten">
@ -171,23 +173,6 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
<property name="wsdl.source" value="${wsdl.1}.wsdl" />
<property name="wsdl.target" value="${wsdl.1}_flattened.wsdl" />
<property name="wsdl.porttype" value="${wsdl.1}PortType" />
</ant>
<ant antfile="${build.stubs}" target="generateBinding">
<property name="source.binding.dir" value="${build.schema.service.dir}" />
<property name="target.binding.dir" value="${build.schema.service.dir}" />
<property name="porttype.wsdl" value="${wsdl.1}_flattened.wsdl" />
<property name="binding.root" value="${wsdl.1}" />
</ant>
</target>
<target name="processWSDL.2" depends="init" if="wsdl.2" description="Flattens wsdl and generate bindings">
<echo message="PROCESSING ${wsdl.2}'s WSDL:" level="debug"/>
<ant antfile="${build.stubs}" target="flatten">
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
<property name="wsdl.source" value="${wsdl.2}.wsdl" />
<property name="wsdl.target" value="${wsdl.2}_flattened.wsdl" />
<property name="wsdl.porttype" value="SinkPortType" />
</ant>
<!-- <ant antfile="${build.stubs}" target="generateBinding">
@ -200,13 +185,13 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
</target>
<target name="processWSDL.3" depends="init" if="wsdl.3" description="Flattens wsdl and generate bindings">
<echo message="PROCESSING ${wsdl.3}'s WSDL:" level="debug"/>
<target name="processWSDL.2" depends="init" if="wsdl.2" description="Flattens wsdl and generate bindings">
<echo message="PROCESSING ${wsdl.2}'s WSDL:" level="debug"/>
<ant antfile="${build.stubs}" target="flatten">
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
<property name="wsdl.source" value="${wsdl.3}.wsdl" />
<property name="wsdl.target" value="${wsdl.3}_flattened.wsdl" />
<property name="wsdl.source" value="${wsdl.2}.wsdl" />
<property name="wsdl.target" value="${wsdl.2}_flattened.wsdl" />
<property name="wsdl.porttype" value="EntryPortType" />
</ant>
<!-- <ant antfile="${build.stubs}" target="generateBinding">
@ -220,15 +205,15 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<target name="processWSDL.4" depends="init" if="wsdl.4" description="Flattens wsdl and generate bindings">
<echo message="PROCESSING ${wsdl.4.name}'s WSDL:" level="debug"/>
<ant antfile="${build.stubs}" target="flatten">
<property name="source.flatten.dir" location="${build.schema.service.dir}/previous" />
<property name="target.flatten.dir" location="${build.schema.service.dir}/previous" />
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
<property name="wsdl.source" value="${wsdl.4}.wsdl" />
<property name="wsdl.target" value="${wsdl.4}_flattened.wsdl" />
<property name="wsdl.porttype" value="${wsdl.4}PortType" />
</ant>
<ant antfile="${build.stubs}" target="generateBinding">
<property name="source.binding.dir" value="${build.schema.service.dir}/previous" />
<property name="target.binding.dir" value="${build.schema.service.dir}/previous" />
<property name="source.binding.dir" value="${build.schema.service.dir}" />
<property name="target.binding.dir" value="${build.schema.service.dir}" />
<property name="porttype.wsdl" value="${wsdl.4}_flattened.wsdl" />
<property name="binding.root" value="${wsdl.4}" />
</ant>
@ -254,30 +239,31 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<target name="processWSDL.6" depends="init" if="wsdl.6" description="Flattens wsdl and generate bindings">
<echo message="PROCESSING ${wsdl.6}'s WSDL:" level="debug"/>
<ant antfile="${build.stubs}" target="flatten">
<property name="source.flatten.dir" location="${build.schema.service.dir}" />
<property name="target.flatten.dir" location="${build.schema.service.dir}" />
<property name="source.flatten.dir" location="${build.schema.service.dir}/wsdaix" />
<property name="target.flatten.dir" location="${build.schema.service.dir}/wsdaix" />
<property name="wsdl.source" value="${wsdl.6}.wsdl" />
<property name="wsdl.target" value="${wsdl.6}_flattened.wsdl" />
<property name="wsdl.porttype" value="${wsdl.6}PortType" />
<property name="wsdl.porttype" value="${wsdl.6}" />
</ant>
<ant antfile="${build.stubs}" target="generateBinding">
<property name="source.binding.dir" value="${build.schema.service.dir}" />
<property name="target.binding.dir" value="${build.schema.service.dir}" />
<property name="source.binding.dir" value="${build.schema.service.dir}/wsdaix" />
<property name="target.binding.dir" value="${build.schema.service.dir}/wsdaix" />
<property name="porttype.wsdl" value="${wsdl.6}_flattened.wsdl" />
<property name="binding.root" value="${wsdl.6}" />
</ant>
</target>
<target name="generateStubs.1" if="wsdl.1" description="Generate wsdl stub classes">
<echo message="GENERATING ${wsdl.1}'s STUBS:" level="debug"/>
<ant antfile="${build.stubs}" target="generateStubs">
<property name="mappings" value="${mappings}"/>
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
<property name="wsdl.file" value="${wsdl.1}_service.wsdl" />
<property name="wsdl.file" value="${wsdl.1}.wsdl" />
</ant>
</target>
<target name="generateStubs.2" if="wsdl.2" description="Generate wsdl stub classes">
<echo message="GENERATING ${wsdl.2}'s STUBS:" level="debug"/>
<ant antfile="${build.stubs}" target="generateStubs">
@ -287,16 +273,6 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<property name="wsdl.file" value="${wsdl.2}.wsdl" />
</ant>
</target>
<target name="generateStubs.3" if="wsdl.3" description="Generate wsdl stub classes">
<echo message="GENERATING ${wsdl.3}'s STUBS:" level="debug"/>
<ant antfile="${build.stubs}" target="generateStubs">
<property name="mappings" value="${mappings}"/>
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
<property name="wsdl.file" value="${wsdl.3}.wsdl" />
</ant>
</target>
<target name="generateStubs.4" if="wsdl.4" description="Generate wsdl stub classes">
<echo message="GENERATING ${wsdl.4}'s STUBS:" level="debug"/>
@ -304,7 +280,7 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<property name="mappings" value="${mappings}"/>
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
<property name="wsdl.file" value="previous/${wsdl.4}_service.wsdl" />
<property name="wsdl.file" value="${wsdl.4}_service.wsdl" />
</ant>
</target>
@ -324,13 +300,13 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<property name="mappings" value="${mappings}"/>
<property name="source.stubs.dir" location="${build.schema.service.dir}" />
<property name="target.stubs.dir" location="${build.stubs.src.dir}" />
<property name="wsdl.file" value="${wsdl.6}_service.wsdl" />
<property name="wsdl.file" value="wsdaix/${wsdl.6}_service.wsdl" />
</ant>
</target>
<!-- Cross-wsdl tasks. Adds dependencies for each additional wsdl, if required -->
<target name="processWSDLs" depends="processWSDL.1,processWSDL.2,processWSDL.3,processWSDL.4,processWSDL.5,processWSDL.6" description="generate bindings for all porttypes" />
<target name="generateStubs" depends="generateMappings,generateStubs.1,generateStubs.2,generateStubs.3,generateStubs.4,generateStubs.5,generateStubs.6" description="generate stub classes for all porttypes" />
<target name="processWSDLs" depends="processWSDL.1,processWSDL.2,processWSDL.4,processWSDL.5,processWSDL.6" description="generate bindings for all porttypes" />
<target name="generateStubs" depends="generateMappings,generateStubs.1,generateStubs.2,generateStubs.4,generateStubs.5,generateStubs.6" description="generate stub classes for all porttypes" />
<target name="generateMappings">
<var name="mappings" value=""/>
@ -382,7 +358,23 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
</if>
<var name="mappings" value="${mappings} -N${namespace.6}=${package.6} -N${namespace.6}/service=${package.6}.service -N${namespace.6}/bindings=${package.6}.bindings"/>
</if>
<if name="previous.namespace.1">
<if name="namespace.7">
<if name="package.7">
<var name="package.7" value="${stubs.package}.${package.7}"/>
<else>
<var name="package.7" value="${stubs.package}"/></else>
</if>
<var name="mappings" value="${mappings} -N${namespace.7}=${package.7} -N${namespace.7}/service=${package.7}.service -N${namespace.7}/bindings=${package.7}.bindings"/>
</if>
<if name="namespace.8">
<if name="package.8">
<var name="package.8" value="${stubs.package}.${package.8}"/>
<else>
<var name="package.8" value="${stubs.package}"/></else>
</if>
<var name="mappings" value="${mappings} -N${namespace.8}=${package.8} -N${namespace.8}/service=${package.8}.service -N${namespace.8}/bindings=${package.8}.bindings"/>
</if>
<!--<if name="previous.namespace.1">
<if name="package.7">
<var name="package.7" value="${previous.stubs.package}.${package.7}"/>
<else>
@ -397,7 +389,7 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<var name="package.7" value="${previous.stubs.package}"/></else>
</if>
<var name="mappings" value="${mappings} -N${previous.namespace.2}=${package.7} -N${previous.namespace.2}/service=${package.7}.service -N${previous.namespace.2}/bindings=${package.7}.bindings"/>
</if>
</if> -->
</target>
@ -411,7 +403,8 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac
<target name="buildService" depends="processWSDLs" description="compiles service implementation">
<javac srcdir="${source.dir}" destdir="${build.class.dir}" debug="${java.debug}" deprecation="${java.deprecation}">
<exclude name="${stubs.dir}/**"/>
<exclude name="org/gcube/informationsystem/collector/test/**"/>
<exclude name="${stubs.dir}/**"/>
<classpath>
<fileset dir="${lib.location}">
<include name="**/*.jar" />

View File

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component=" org.gcube.information-system.collector.3-0-0" date="2010-11">
<Change>WSDAI::XMLCollectionAccess interface</Change>
<Change>internal refactoring of resources</Change>
</Changeset>
<Changeset component=" org.gcube.information-system.collector.2-2-0" date="2009-10-30">
<Change>GetProfileLastModificationTimeMs and GetResourceLastModificationTimeMs operations</Change>
</Changeset>

View File

@ -1,18 +1,19 @@
package = org.gcube.informationsystem.collector
previous-package = org.diligentproject.informationservice.disic
package.6 = wsdai
package.7 = wsdaix
lib.dir = Dependencies/ISCollector
wsdl.1 = XMLCollectionAccess
wsdl.2 = Sink_service
wsdl.3 = SinkEntry_service
wsdl.4 = DISICService
wsdl.5 = XQueryAccess
wsdl.6 = XMLStorageAccess
wsdl.1 = Sink_service
wsdl.2 = SinkEntry_service
wsdl.4 = XQueryAccess
wsdl.5 = XMLStorageAccess
wsdl.6 = XMLCollectionAccessPT
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
namespace.4=http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess
namespace.5=http://gcube-system.org/namespaces/informationsystem/collector/XQueryAccess
namespace.6=http://gcube-system.org/namespaces/informationsystem/collector/XMLStorageAccess
previous.namespace.1=http://diligentproject.org/namespaces/informationservice/disic/DISICService
namespace.4=http://gcube-system.org/namespaces/informationsystem/collector/XQueryAccess
namespace.5=http://gcube-system.org/namespaces/informationsystem/collector/XMLStorageAccess
namespace.6=http://www.ggf.org/namespaces/2005/12/WS-DAI
namespace.7=http://www.ggf.org/namespaces/2005/12/WS-DAIX

View File

@ -76,8 +76,7 @@
</global>
<!-- query portType -->
<service name="gcube/informationsystem/collector/XMLCollectionAccess">
<service name="gcube/informationsystem/collector/wsdaix/XMLCollectionAccess">
<environment
name="name"
value="XMLCollectionAccess"
@ -151,35 +150,4 @@
<resourceLink name="configuration" target="java:comp/env/configuration"/>
</service>
<!-- OLD service, here for backward compatibility -->
<service name="diligentproject/informationservice/disic/DISICRegistrationService">
<environment
name="name"
value="Sink"
type="java.lang.String"
override="false" />
<resource name="home"
type="org.globus.mds.aggregator.impl.SingletonAggregatorHome">
<resourceParams>
<parameter>
<name>
factory
</name>
<value>
org.globus.wsrf.jndi.BeanFactory
</value>
</parameter>
<parameter>
<name>resourceClass</name>
<value>org.gcube.informationsystem.collector.impl.state.AggregatorRegisteredResource</value>
</parameter>
</resourceParams>
</resource>
<resourceLink name="entryHome" target="java:comp/env/services/gcube/informationsystem/collector/SinkEntry/home"/>
<resourceLink name="configuration" target="java:comp/env/configuration"/>
</service>
</jndiConfig>

View File

@ -5,16 +5,17 @@
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<service name="gcube/informationsystem/collector/XMLCollectionAccess" provider="Handler" use="literal" style="document">
<service name="gcube/informationsystem/collector/wsdaix/XMLCollectionAccess" 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.XMLCollectionAccess"/>
<parameter name="className" value="org.gcube.informationsystem.collector.impl.porttypes.wsdaix.XMLCollectionAccess"/>
<parameter name="loadOnStartup" value="false"/>
<wsdlFile>share/schema/org.gcube.informationsystem.collector/XMLCollectionAccess_service.wsdl</wsdlFile>
<wsdlFile>share/schema/org.gcube.informationsystem.collector/wsdaix/XMLCollectionAccessPT_service.wsdl</wsdlFile>
</service>
<service name="gcube/informationsystem/collector/XMLStorageAccess" provider="Handler" use="literal" style="document">
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
<parameter name="scope" value="Application"/>
@ -23,7 +24,7 @@
<parameter name="loadOnStartup" value="false"/>
<wsdlFile>share/schema/org.gcube.informationsystem.collector/XMLStorageAccess_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"/>
@ -68,38 +69,4 @@
</service>
<!-- OLD PortTypes, here for backward compatibility -->
<service name="diligentproject/informationservice/disic/DISICService" 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.OldService"/>
<parameter name="loadOnStartup" value="false"/>
<wsdlFile>share/schema/org.gcube.informationsystem.collector/previous/DISICService_service.wsdl</wsdlFile>
</service>
<service name="diligentproject/informationservice/disic/DISICRegistrationService" provider="Handler"
use="literal" style="document">
<parameter name="providers"
value="org.globus.wsrf.impl.servicegroup.ServiceGroupRegistrationProvider
GetRPProvider
GetMRPProvider
QueryRPProvider
DestroyProvider
SetTerminationTimeProvider
SubscribeProvider
GetCurrentMessageProvider"/>
<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.Sink"/>
<parameter name="loadOnStartup" value="false"/>
<wsdlFile>share/schema/org.gcube.informationsystem.collector/Sink_service.wsdl</wsdlFile>
</service>
</deployment>

View File

@ -16,11 +16,9 @@
</Dependencies> -->
<Packages>
<Main>
<Description>Information Collector service: it acts at an aggregator
sink by collecting and exposing the information published by the
registered gCube services</Description>
<Description>Information Collector service: aggregate and make available information published by gCube services</Description>
<Name>IS-Collector-service</Name>
<Version>2.2.0</Version>
<Version>3.0.0</Version>
<Dependencies>
<Dependency>
<Service>
@ -29,7 +27,7 @@
<Version>1.0.0</Version>
</Service>
<Package>IS-Collector-stubs</Package>
<Version>[2.2.0]</Version>
<Version>[3.0.0]</Version>
<Scope level="GHN" />
<Optional>false</Optional>
</Dependency>
@ -62,6 +60,11 @@
<Security />
<WSDL />
</PortType>
<PortType>
<Name>gcube/informationsystem/collector/wsdaix/XMLCollectionAccess</Name>
<Security />
<WSDL />
</PortType>
<PortType>
<Name>gcube/informationsystem/collector/XQueryAccess</Name>
<Security />
@ -76,7 +79,7 @@
<Software deployable="true">
<Description>InformationCollector Stubs</Description>
<Name>IS-Collector-stubs</Name>
<Version>2.2.0</Version>
<Version>3.0.0</Version>
<MultiVersion value="true" />
<Mandatory level="VO" />
<Shareable level="VO" />
@ -88,7 +91,7 @@
<Software>
<Description>Test-suite for IS-Collector: provide sample usages of interaction with a IS-Collector instance</Description>
<Name>IS-Collector-test-suite</Name>
<Version>2.2.0</Version>
<Version>3.0.0</Version>
<MultiVersion value="true"/>
<Shareable level="VO"/>
<Type>application</Type>

View File

@ -1,221 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:asgt="http://mds.globus.org/aggregator/types"
xmlns:corefaults="http://gcube-system.org/namespaces/common/core/faults"
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:gtwsdl1="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.wsdl"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:asgw="http://mds.globus.org/aggregator"
xmlns:wsntw="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
xmlns:gtwsdl0="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.wsdl" location="../wsrf/faults/WS-BaseFaults.wsdl"/>
<wsdl:import namespace="http://mds.globus.org/aggregator" location="../mds/aggregator/aggregator_service_group_port_type.wsdl"/>
<wsdl:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.wsdl" location="../wsrf/servicegroup/WS-ServiceGroup.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/XMLCollectionAccess"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:rpns0="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
xmlns:rpns1="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd"
xmlns:rpns2="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess">
<import namespace="http://schemas.xmlsoap.org/ws/2004/03/addressing" schemaLocation="../ws/addressing/WS-Addressing.xsd"/>
<import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd" schemaLocation="../wsrf/lifetime/WS-ResourceLifetime.xsd"/>
<import namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" schemaLocation="../wsrf/notification/WS-BaseN.xsd"/>
<import namespace="http://mds.globus.org/aggregator/types" schemaLocation="../mds/aggregator/aggregator-types.xsd"/>
<import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd" schemaLocation="../wsrf/servicegroup/WS-ServiceGroup.xsd"/>
<xsd:element name="resourceID" type="xsd:string"/>
<xsd:element name="deleteResponse" type="xsd:boolean"/>
<xsd:element name="getProfileResponse" type="xsd:string"/>
<xsd:element name="getResourceResponse" type="xsd:string"/>
<xsd:element name="getResourceLastModificationTimeMsResponse" type="xsd:long"/>
<xsd:element name="getProfileLastModificationTimeMsResponse" type="xsd:long"/>
<xsd:element name="deleteProfileParams">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
<xsd:element name="profileType" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetProfileLastModificationTimeMsCriteria">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
<xsd:element name="profileType" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetResourceLastModificationTimeMsCriteria">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetProfileCriteria">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
<xsd:element name="profileType" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetResourceCriteria">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="voidType"/>
<xsd:element name="voidElement" type="tns:voidType"/>
<xsd:element name="DocumentNotFoundFaultType">
<xsd:complexType>
<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="DeleteResourceInputMessage">
<part name="parameters" element="tns:resourceID"/>
</wsdl:message>
<wsdl:message name="DeleteResourceOutputMessage">
<part name="parameters" element="tns:deleteResponse"/>
</wsdl:message>
<wsdl:message name="GetResourceInputMessage">
<part name="parameters" element="tns:GetResourceCriteria"/>
</wsdl:message>
<wsdl:message name="GetResourceOutputMessage">
<part name="parameters" element="tns:getResourceResponse"/>
</wsdl:message>
<wsdl:message name="GetResourceLastModificationTimeMsInputMessage">
<part name="parameters" element="tns:GetResourceLastModificationTimeMsCriteria"/>
</wsdl:message>
<wsdl:message name="GetResourceLastModificationTimeMsOutputMessage">
<part name="parameters" element="tns:getResourceLastModificationTimeMsResponse"/>
</wsdl:message>
<wsdl:message name="DeleteProfileInputMessage">
<part name="parameters" element="tns:deleteProfileParams"/>
</wsdl:message>
<wsdl:message name="DeleteProfileOutputMessage">
<part name="parameters" element="tns:deleteResponse"/>
</wsdl:message>
<wsdl:message name="GetProfileInputMessage">
<part name="parameters" element="tns:GetProfileCriteria"/>
</wsdl:message>
<wsdl:message name="GetProfileOutputMessage">
<part name="parameters" element="tns:getProfileResponse"/>
</wsdl:message>
<wsdl:message name="GetProfileLastModificationTimeMsInputMessage">
<part name="parameters" element="tns:GetProfileLastModificationTimeMsCriteria"/>
</wsdl:message>
<wsdl:message name="GetProfileLastModificationTimeMsOutputMessage">
<part name="parameters" element="tns:getProfileLastModificationTimeMsResponse"/>
</wsdl:message>
<wsdl:message name="VoidMessage">
<part name="parameters" element="tns:voidElement"/>
</wsdl:message>
<wsdl:message name="DocumentNotFoundFaultTypeMessage">
<part name="fault" element="tns:DocumentNotFoundFaultType"/>
</wsdl:message>
<!--============================================================
P O R T T Y P E
============================================================-->
<wsdl:portType name="XMLCollectionAccessPortType">
<wsdl:operation name="GetProfile">
<wsdl:input message="tns:GetProfileInputMessage"/>
<wsdl:output message="tns:GetProfileOutputMessage"/>
<wsdl:fault name="fault" message="tns:DocumentNotFoundFaultTypeMessage"/>
</wsdl:operation>
<wsdl:operation name="GetResource">
<wsdl:input message="tns:GetResourceInputMessage"/>
<wsdl:output message="tns:GetResourceOutputMessage"/>
<wsdl:fault name="fault" message="tns:DocumentNotFoundFaultTypeMessage"/>
</wsdl:operation>
<wsdl:operation name="GetProfileLastModificationTimeMs">
<wsdl:input message="tns:GetProfileLastModificationTimeMsInputMessage"/>
<wsdl:output message="tns:GetProfileLastModificationTimeMsOutputMessage"/>
<wsdl:fault name="fault" message="tns:DocumentNotFoundFaultTypeMessage"/>
</wsdl:operation>
<wsdl:operation name="GetResourceLastModificationTimeMs">
<wsdl:input message="tns:GetResourceLastModificationTimeMsInputMessage"/>
<wsdl:output message="tns:GetResourceLastModificationTimeMsOutputMessage"/>
<wsdl:fault name="fault" message="tns:DocumentNotFoundFaultTypeMessage"/>
</wsdl:operation>
<wsdl:operation name="DeleteResource">
<wsdl:input message="tns:DeleteResourceInputMessage"/>
<wsdl:output message="tns:DeleteResourceOutputMessage"/>
</wsdl:operation>
<wsdl:operation name="DeleteProfile">
<wsdl:input message="tns:DeleteProfileInputMessage"/>
<wsdl:output message="tns:DeleteProfileOutputMessage"/>
</wsdl:operation>
<wsdl:operation name="DeleteAllRPs">
<wsdl:input message="tns:VoidMessage"/>
<wsdl:output message="tns:VoidMessage"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

View File

@ -1,136 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DIS-IC WSDL interace
-->
<wsdl:definitions name="DISICService" targetNamespace="http://diligentproject.org/namespaces/informationservice/disic/DISICService"
xmlns:tns="http://diligentproject.org/namespaces/informationservice/disic/DISICService"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:asgt="http://mds.globus.org/aggregator/types"
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:gtwsdl1="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.wsdl"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:asgw="http://mds.globus.org/aggregator"
xmlns:wsntw="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
xmlns:gtwsdl0="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.wsdl" location="../../wsrf/faults/WS-BaseFaults.wsdl"/>
<wsdl:import namespace="http://mds.globus.org/aggregator" location="../../mds/aggregator/aggregator_service_group_port_type.wsdl"/>
<wsdl:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.wsdl" location="../../wsrf/servicegroup/WS-ServiceGroup.wsdl"/>
<!--============================================================
T Y P E S
============================================================-->
<wsdl:types>
<xsd:schema targetNamespace="http://diligentproject.org/namespaces/informationservice/disic/DISICService"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:rpns0="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
xmlns:rpns1="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd"
xmlns:rpns2="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://diligentproject.org/namespaces/informationservice/disic/DISICService">
<import namespace="http://schemas.xmlsoap.org/ws/2004/03/addressing" schemaLocation="../../ws/addressing/WS-Addressing.xsd"/>
<import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd" schemaLocation="../../wsrf/lifetime/WS-ResourceLifetime.xsd"/>
<import namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" schemaLocation="../../wsrf/notification/WS-BaseN.xsd"/>
<import namespace="http://mds.globus.org/aggregator/types" schemaLocation="../../mds/aggregator/aggregator-types.xsd"/>
<import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd" schemaLocation="../../wsrf/servicegroup/WS-ServiceGroup.xsd"/>
<xsd:element name="XQuery" type="xsd:string"/>
<xsd:element name="XQueryResponse" type="xsd:string"/>
<xsd:element name="resourceID" type="xsd:string"/>
<xsd:element name="deleteResponse" type="xsd:boolean"/>
<xsd:element name="deleteProfileParams">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="DILIGENTResourceID" type="xsd:string"/>
<xsd:element name="profileType" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="voidType"/>
<xsd:element name="voidElement" type="tns:voidType"/>
</xsd:schema>
</wsdl:types>
<!--============================================================
M E S S A G E S
============================================================-->
<wsdl:message name="ExecuteXQueryInputMessage">
<part name="parameters" element="tns:XQuery"/>
</wsdl:message>
<wsdl:message name="ExecuteXQueryOutputMessage">
<part name="parameters" element="tns:XQueryResponse"/>
</wsdl:message>
<wsdl:message name="DeleteResourceInputMessage">
<part name="parameters" element="tns:resourceID"/>
</wsdl:message>
<wsdl:message name="DeleteResourceOutputMessage">
<part name="parameters" element="tns:deleteResponse"/>
</wsdl:message>
<wsdl:message name="DeleteProfileInputMessage">
<part name="parameters" element="tns:deleteProfileParams"/>
</wsdl:message>
<wsdl:message name="DeleteProfileOutputMessage">
<part name="parameters" element="tns:deleteResponse"/>
</wsdl:message>
<wsdl:message name="VoidMessage">
<part name="parameters" element="tns:voidElement"/>
</wsdl:message>
<!--============================================================
P O R T T Y P E
============================================================-->
<wsdl:portType name="DISICServicePortType">
<wsdl:operation name="ExecuteXQuery">
<wsdl:input message="tns:ExecuteXQueryInputMessage"/>
<wsdl:output message="tns:ExecuteXQueryOutputMessage"/>
</wsdl:operation>
<wsdl:operation name="DeleteResource">
<wsdl:input message="tns:DeleteResourceInputMessage"/>
<wsdl:output message="tns:DeleteResourceOutputMessage"/>
</wsdl:operation>
<wsdl:operation name="DeleteProfile">
<wsdl:input message="tns:DeleteProfileInputMessage"/>
<wsdl:output message="tns:DeleteProfileOutputMessage"/>
</wsdl:operation>
<wsdl:operation name="DeleteAllRPs">
<wsdl:input message="tns:VoidMessage"/>
<wsdl:output message="tns:VoidMessage"/>
</wsdl:operation>
<wsdl:operation name="Dispose">
<wsdl:input message="tns:VoidMessage"/>
<wsdl:output message="tns:VoidMessage"/>
</wsdl:operation>
<wsdl:operation name="Initialize">
<wsdl:input message="tns:VoidMessage"/>
<wsdl:output message="tns:VoidMessage"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

View File

@ -0,0 +1,730 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="wsdaix"
targetNamespace="http://www.ggf.org/namespaces/2005/12/WS-DAIX"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdai="http://www.ggf.org/namespaces/2005/12/WS-DAI"
xmlns:wsdaix="http://www.ggf.org/namespaces/2005/12/WS-DAIX">
<!-- WSDL IMPORTS ################################################## -->
<wsdl:import location="./wsdai_core_porttypes.wsdl"
namespace="http://www.ggf.org/namespaces/2005/12/WS-DAI"/>
<!-- WSDL TYPES #################################################### -->
<wsdl:types>
<xsd:schema targetNamespace="http://www.ggf.org/namespaces/2005/12/WS-DAIX"
elementFormDefault="qualified">
<xsd:import namespace="http://www.ggf.org/namespaces/2005/12/WS-DAI"
schemaLocation="../wsdaix/types/wsdai_core_types.xsd" />
<xsd:include schemaLocation="../wsdaix/types/wsdaix_xmlcollection_types.xsd" />
<!-- ############################ -->
<!-- ### Common Message Types ### -->
<!-- ############################ -->
<xsd:complexType name="InvalidCollectionNameFaultType"/>
<xsd:element name="InvalidCollectionNameFault" type="wsdaix:InvalidCollectionNameFaultType"/>
<xsd:complexType name="SchemaDoesNotExistFaultType"/>
<xsd:element name="SchemaDoesNotExistFault" type="wsdaix:SchemaDoesNotExistFaultType"/>
<!-- ################################## -->
<!-- ### GetDocuments Message Types ### -->
<!-- ################################## -->
<xsd:element name="GetDocumentRequestWrapper">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetDocumentResponseWrapper">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
<xsd:element name="Response">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="Success"/>
<xsd:enumeration value="DocumentNotRetrieved-DocumentDoesNotExist"/>
<xsd:enumeration value="DocumentNotRetrieved-NotAuthorized"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Data" type="wsdaix:XMLWrapperType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetDocumentsRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="wsdaix:GetDocumentRequestWrapper" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetDocumentsResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdaix:GetDocumentResponseWrapper" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- ################################## -->
<!-- ### AddDocuments Message Types ### -->
<!-- ################################## -->
<xsd:element name="AddDocumentRequestWrapper">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
<xsd:element name="Data" type="wsdaix:XMLWrapperType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="AddDocumentResponseWrapper">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
<xsd:element name="Response">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="Success"/>
<xsd:enumeration value="DocumentNotAdded-DocumentDoesNotValidate"/>
<xsd:enumeration value="DocumentNotAdded-SchemaDoesNotExist"/>
<xsd:enumeration value="DocumentNotAdded-NotAuthorized"/>
<xsd:enumeration value="DocumentOfSameNameOverwritten"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Detail" type="wsdaix:XMLWrapperType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="AddDocumentsRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="wsdaix:AddDocumentRequestWrapper" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="AddDocumentsResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdaix:AddDocumentResponseWrapper" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- ##################################### -->
<!-- ### RemoveDocuments Message Types ### -->
<!-- ##################################### -->
<xsd:element name="RemoveDocumentRequestWrapper">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RemoveDocumentResponseWrapper">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
<xsd:element name="Response">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="Success"/>
<xsd:enumeration value="DocumentNotRemoved-NotAuthorized"/>
<xsd:enumeration value="DocumentNotRemoved-DocumentDoesNotExist"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Detail" type="wsdaix:XMLWrapperType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RemoveDocumentsRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="wsdaix:RemoveDocumentRequestWrapper" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="RemoveDocumentsResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdaix:RemoveDocumentResponseWrapper" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- ######################################### -->
<!-- ### CreateSubCollection Message Types ### -->
<!-- ######################################### -->
<xsd:element name="CreateSubcollectionRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element name="SubcollectionName" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CreateSubcollectionResponse">
<xsd:complexType/>
</xsd:element>
<xsd:complexType name="CollectionAlreadyExistsFaultType"/>
<xsd:element name="CollectionAlreadyExistsFault" type="wsdaix:CollectionAlreadyExistsFaultType"/>
<!-- ######################################### -->
<!-- ### RemoveSubCollection Message Types ### -->
<!-- ######################################### -->
<xsd:element name="RemoveSubcollectionRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element name="SubcollectionName" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="RemoveSubcollectionResponse">
<xsd:complexType/>
</xsd:element>
<xsd:complexType name="CollectionDoesNotExistFaultType"/>
<xsd:element name="CollectionDoesNotExistFault" type="wsdaix:CollectionDoesNotExistFaultType"/>
<!-- ############################### -->
<!-- ### GetSchema Message Types ### -->
<!-- ############################### -->
<xsd:element name="GetSchemaRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetSchemaResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="http://www.w3.org/2001/XMLSchema"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- ############################### -->
<!-- ### AddSchema Message Types ### -->
<!-- ############################### -->
<xsd:element name="AddSchemaRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:any namespace="http://www.w3.org/2001/XMLSchema"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="AddSchemaResponse">
<xsd:complexType/>
</xsd:element>
<xsd:complexType name="SchemaInvalidFaultType"/>
<xsd:element name="SchemaInvalidFault" type="wsdaix:SchemaInvalidFaultType"/>
<xsd:complexType name="SchemaAlreadyExistsFaultType"/>
<xsd:element name="SchemaAlreadyExistsFault" type="wsdaix:SchemaAlreadyExistsFaultType"/>
<xsd:complexType name="SchemaAdditionMakesDocumentsInvalidFaultType"/>
<xsd:element name="SchemaAdditionMakesDocumentsInvalidFault" type="wsdaix:SchemaAdditionMakesDocumentsInvalidFaultType"/>
<!-- ################################## -->
<!-- ### RemoveSchema Message Types ### -->
<!-- ################################## -->
<xsd:element name="RemoveSchemaRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element name="SchemaNamespace" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="RemoveSchemaResponse">
<xsd:complexType/>
</xsd:element>
<xsd:complexType name="SchemaRemovalMakesDocumentsInvalidFaultType">
<xsd:sequence>
<xsd:element name="DocumentName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SchemaRemovalMakesDocumentsInvalidFault" type="wsdaix:SchemaRemovalMakesDocumentsInvalidFaultType"/>
<xsd:complexType name="SchemaRemovalMakesSchemaInvalidFaultType">
<xsd:sequence>
<xsd:element name="SchemaNamespace" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SchemaRemovalMakesSchemaInvalidFault" type="wsdaix:SchemaRemovalMakesSchemaInvalidFaultType"/>
<!-- ######################################### -->
<!-- ### CollectionSelectionFactory Types ### -->
<!-- ######################################### -->
<xsd:element name="CollectionSelectionFactoryRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:FactoryRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CollectionSelectionFactoryResponse" type="wsdai:DataResourceAddressType" />
<!-- ####################################### -->
<!-- ### DocumentSelectionFactory Types ### -->
<!-- ####################################### -->
<xsd:element name="DocumentSelectionFactoryRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:FactoryRequestType">
<xsd:sequence>
<xsd:element name="CollectionName" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
<xsd:element name="DocumentName" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="DocumentSelectionFactoryResponse" type="wsdai:DataResourceAddressType" />
<xsd:complexType name="DocumentDoesNotExistFaultType"/>
<xsd:element name="DocumentDoesNotExistFault" type="wsdaix:DocumentDoesNotExistFaultType"/>
</xsd:schema>
</wsdl:types>
<!-- WSDL MESSAGES ################################################# -->
<wsdl:message name="InvalidCollectionNameFault">
<wsdl:part name="InvalidCollectionNameFault"
element="wsdaix:InvalidCollectionNameFault"/>
</wsdl:message>
<wsdl:message name="SchemaDoesNotExistFault">
<wsdl:part name="SchemaDoesNotExistFault"
element="wsdaix:SchemaDoesNotExistFault"/>
</wsdl:message>
<!-- ############################################## -->
<!-- ### GetCollectionPropertyDocument Messages ### -->
<!-- ############################################## -->
<wsdl:message name="GetCollectionPropertyDocumentRequest">
<wsdl:part name="GetCollectionPropertyDocumentRequest"
element="wsdai:GetDataResourcePropertyDocumentRequest" />
</wsdl:message>
<wsdl:message name="GetCollectionPropertyDocumentResponse">
<wsdl:part name="GetCollectionPropertyDocumentResponse"
element="wsdaix:XMLCollectionPropertyDocument" />
</wsdl:message>
<!-- ############################# -->
<!-- ### GetDocuments Messages ### -->
<!-- ############################# -->
<wsdl:message name="GetDocumentsRequest">
<wsdl:part name="GetDocumentsRequest" element="wsdaix:GetDocumentsRequest"/>
</wsdl:message>
<wsdl:message name="GetDocumentsResponse">
<wsdl:part name="GetDocumentsResponse" element="wsdaix:GetDocumentsResponse"/>
</wsdl:message>
<!-- ############################# -->
<!-- ### AddDocuments Messages ### -->
<!-- ############################# -->
<wsdl:message name="AddDocumentsRequest">
<wsdl:part name="AddDocumentsRequest" element="wsdaix:AddDocumentsRequest"/>
</wsdl:message>
<wsdl:message name="AddDocumentsResponse">
<wsdl:part name="AddDocumentsResponse" element="wsdaix:AddDocumentsResponse"/>
</wsdl:message>
<!-- ################################ -->
<!-- ### RemoveDocuments Messages ### -->
<!-- ################################ -->
<wsdl:message name="RemoveDocumentsRequest">
<wsdl:part name="RemoveDocumentsRequest" element="wsdaix:RemoveDocumentsRequest"/>
</wsdl:message>
<wsdl:message name="RemoveDocumentsResponse">
<wsdl:part name="RemoveDocumentsResponse" element="wsdaix:RemoveDocumentsResponse"/>
</wsdl:message>
<!-- #################################### -->
<!-- ### CreateSubcollection Messages ### -->
<!-- #################################### -->
<wsdl:message name="CreateSubcollectionRequest">
<wsdl:part name="CreateSubcollectionRequest" element="wsdaix:CreateSubcollectionRequest"/>
</wsdl:message>
<wsdl:message name="CreateSubcollectionResponse">
<wsdl:part name="CreateSubcollectionResponse" element="wsdaix:CreateSubcollectionResponse"/>
</wsdl:message>
<wsdl:message name="CollectionAlreadyExistsFault">
<wsdl:part name="CollectionAlreadyExistsFault"
element="wsdaix:CollectionAlreadyExistsFault"/>
</wsdl:message>
<!-- #################################### -->
<!-- ### RemoveSubcollection Messages ### -->
<!-- #################################### -->
<wsdl:message name="RemoveSubcollectionRequest">
<wsdl:part name="RemoveSubcollectionRequest" element="wsdaix:RemoveSubcollectionRequest"/>
</wsdl:message>
<wsdl:message name="RemoveSubcollectionResponse">
<wsdl:part name="RemoveSubcollectionResponse" element="wsdaix:RemoveSubcollectionResponse"/>
</wsdl:message>
<wsdl:message name="CollectionDoesNotExistFault">
<wsdl:part name="CollectionDoesNotExistFault"
element="wsdaix:CollectionDoesNotExistFault"/>
</wsdl:message>
<!-- ########################## -->
<!-- ### AddSchema Messages ### -->
<!-- ########################## -->
<wsdl:message name="AddSchemaRequest">
<wsdl:part name="AddSchemaRequest" element="wsdaix:AddSchemaRequest"/>
</wsdl:message>
<wsdl:message name="AddSchemaResponse">
<wsdl:part name="AddSchemaResponse" element="wsdaix:AddSchemaResponse"/>
</wsdl:message>
<wsdl:message name="SchemaAlreadyExistsFault">
<wsdl:part name="SchemaAlreadyExistsFault"
element="wsdaix:SchemaAlreadyExistsFault"/>
</wsdl:message>
<wsdl:message name="SchemaInvalidFault">
<wsdl:part name="SchemaInvalidFault"
element="wsdaix:SchemaInvalidFault"/>
</wsdl:message>
<wsdl:message name="SchemaAdditionMakesDocumentsInvalidFault">
<wsdl:part name="SchemaAdditionMakesDocumentsInvalidFault"
element="wsdaix:SchemaAdditionMakesDocumentsInvalidFault"/>
</wsdl:message>
<!-- ############################# -->
<!-- ### RemoveSchema Messages ### -->
<!-- ############################# -->
<wsdl:message name="RemoveSchemaRequest">
<wsdl:part name="RemoveSchemaRequest" element="wsdaix:RemoveSchemaRequest"/>
</wsdl:message>
<wsdl:message name="RemoveSchemaResponse">
<wsdl:part name="RemoveSchemaResponse" element="wsdaix:RemoveSchemaResponse"/>
</wsdl:message>
<wsdl:message name="SchemaRemovalMakesDocumentsInvalidFault">
<wsdl:part name="SchemaRemovalMakesDocumentsInvalidFault"
element="wsdaix:SchemaRemovalMakesDocumentsInvalidFault"/>
</wsdl:message>
<wsdl:message name="SchemaRemovalMakesSchemaInvalidFault">
<wsdl:part name="SchemaRemovalMakesSchemaInvalidFault"
element="wsdaix:SchemaRemovalMakesSchemaInvalidFault"/>
</wsdl:message>
<!-- ############################# -->
<!-- ### GetSchema Messages ### -->
<!-- ############################# -->
<wsdl:message name="GetSchemaRequest">
<wsdl:part name="GetSchemaRequest" element="wsdaix:GetSchemaRequest"/>
</wsdl:message>
<wsdl:message name="GetSchemaResponse">
<wsdl:part name="GetSchemaResponse" element="wsdaix:GetSchemaResponse"/>
</wsdl:message>
<!-- ########################################### -->
<!-- ### CollectionSelectionFactory Messages ### -->
<!-- ########################################### -->
<wsdl:message name="CollectionSelectionFactoryRequest">
<wsdl:part name="CollectionSelectionFactoryRequest" element="wsdaix:CollectionSelectionFactoryRequest"/>
</wsdl:message>
<wsdl:message name="CollectionSelectionFactoryResponse">
<wsdl:part name="CollectionSelectionFactoryResponse" element="wsdaix:CollectionSelectionFactoryResponse"/>
</wsdl:message>
<!-- ######################################### -->
<!-- ### DocumentSelectionFactory Messages ### -->
<!-- ######################################### -->
<wsdl:message name="DocumentSelectionFactoryRequest">
<wsdl:part name="DocumentSelectionFactoryRequest" element="wsdaix:DocumentSelectionFactoryRequest"/>
</wsdl:message>
<wsdl:message name="DocumentSelectionFactoryResponse">
<wsdl:part name="DocumentSelectionFactoryResponse" element="wsdaix:DocumentSelectionFactoryResponse"/>
</wsdl:message>
<wsdl:message name="DocumentDoesNotExistFault">
<wsdl:part name="DocumentDoesNotExistFault"
element="wsdaix:DocumentDoesNotExistFault"/>
</wsdl:message>
<!-- WSDL PORT TYPES ############################################### -->
<wsdl:portType name="XMLCollectionAccessPT">
<wsdl:operation name="GetCollectionPropertyDocument">
<wsdl:input name="GetCollectionPropertyDocumentRequest"
message="wsdaix:GetCollectionPropertyDocumentRequest" />
<wsdl:output name="GetCollectionPropertyDocumentResponse"
message="wsdaix:GetCollectionPropertyDocumentResponse" />
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="AddDocuments">
<wsdl:input message="wsdaix:AddDocumentsRequest"/>
<wsdl:output message="wsdaix:AddDocumentsResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="GetDocuments">
<wsdl:input message="wsdaix:GetDocumentsRequest"/>
<wsdl:output message="wsdaix:GetDocumentsResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="RemoveDocuments">
<wsdl:input message="wsdaix:RemoveDocumentsRequest"/>
<wsdl:output message="wsdaix:RemoveDocumentsResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="CreateSubcollection">
<wsdl:input message="wsdaix:CreateSubcollectionRequest"/>
<wsdl:output message="wsdaix:CreateSubcollectionResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
<wsdl:fault name="CollectionAlreadyExistsFault"
message="wsdaix:CollectionAlreadyExistsFault" />
</wsdl:operation>
<wsdl:operation name="RemoveSubcollection">
<wsdl:input message="wsdaix:RemoveSubcollectionRequest"/>
<wsdl:output message="wsdaix:RemoveSubcollectionResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="AddSchema">
<wsdl:input message="wsdaix:AddSchemaRequest"/>
<wsdl:output message="wsdaix:AddSchemaResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
<wsdl:fault name="SchemaAlreadyExistsFault"
message="wsdaix:SchemaAlreadyExistsFault" />
<wsdl:fault name="SchemaInvalidFault"
message="wsdaix:SchemaInvalidFault" />
<wsdl:fault name="SchemaAdditionMakesDocumentsInvalidFault"
message="wsdaix:SchemaAdditionMakesDocumentsInvalidFault" />
</wsdl:operation>
<wsdl:operation name="GetSchema">
<wsdl:input message="wsdaix:GetSchemaRequest"/>
<wsdl:output message="wsdaix:GetSchemaResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
<wsdl:fault name="SchemaDoesNotExistFault"
message="wsdaix:SchemaDoesNotExistFault" />
</wsdl:operation>
<wsdl:operation name="RemoveSchema">
<wsdl:input message="wsdaix:RemoveSchemaRequest"/>
<wsdl:output message="wsdaix:RemoveSchemaResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
<wsdl:fault name="SchemaRemovalMakesDocumentsInvalidFault"
message="wsdaix:SchemaRemovalMakesDocumentsInvalidFault" />
<wsdl:fault name="SchemaRemovalMakesSchemaInvalidFault"
message="wsdaix:SchemaRemovalMakesSchemaInvalidFault" />
<wsdl:fault name="SchemaDoesNotExistFault"
message="wsdaix:SchemaDoesNotExistFault" />
</wsdl:operation>
</wsdl:portType>
<!--
<wsdl:portType name="XMLCollectionFactoryPT">
<wsdl:operation name="CollectionSelectionFactory">
<wsdl:input message="wsdaix:CollectionSelectionFactoryRequest"/>
<wsdl:output message="wsdaix:CollectionSelectionFactoryResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
<wsdl:fault message="wsdai:InvalidConfigurationDocumentFault"
name="InvalidConfigurationDocumentFault" />
<wsdl:fault message="wsdai:InvalidPortTypeQNameFault"
name="InvalidPortTypeQNameFault" />
</wsdl:operation>
<wsdl:operation name="DocumentSelectionFactory">
<wsdl:input message="wsdaix:DocumentSelectionFactoryRequest"/>
<wsdl:output message="wsdaix:DocumentSelectionFactoryResponse"/>
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault" />
<wsdl:fault name="InvalidCollectionNameFault"
message="wsdaix:InvalidCollectionNameFault" />
<wsdl:fault message="wsdai:NotAuthorizedFault"
name="NotAuthorizedFault"/>
<wsdl:fault message="wsdai:ServiceBusyFault"
name="ServiceBusyFault" />
<wsdl:fault name="DocumentDoesNotExistFault"
message="wsdaix:DocumentDoesNotExistFault" />
<wsdl:fault message="wsdai:InvalidConfigurationDocumentFault"
name="InvalidConfigurationDocumentFault" />
<wsdl:fault message="wsdai:InvalidPortTypeQNameFault"
name="InvalidPortTypeQNameFault" />
</wsdl:operation>
</wsdl:portType>
-->
</wsdl:definitions>

View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
<!--
W3C XML Schema defined in the Web Services Addressing 1.0 specification
http://www.w3.org/TR/ws-addr-core
Copyright © 2005 World Wide Web Consortium,
(Massachusetts Institute of Technology, European Research Consortium for
Informatics and Mathematics, Keio University). All Rights Reserved. This
work is distributed under the W3C® Software License [1] in the hope that
it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
$Id: ws-addressing-0805.xsd,v 1.3 2006/07/21 15:56:29 slynden Exp $
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2005/08/addressing" targetNamespace="http://www.w3.org/2005/08/addressing" blockDefault="#all" elementFormDefault="qualified" finalDefault="" attributeFormDefault="unqualified">
<!-- Constructs from the WS-Addressing Core -->
<xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
<xs:complexType name="EndpointReferenceType" mixed="false">
<xs:sequence>
<xs:element name="Address" type="tns:AttributedURIType"/>
<xs:element name="ReferenceParameters" type="tns:ReferenceParametersType" minOccurs="0"/>
<xs:element ref="tns:Metadata" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="ReferenceParametersType" mixed="false">
<xs:sequence>
<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:element name="Metadata" type="tns:MetadataType"/>
<xs:complexType name="MetadataType" mixed="false">
<xs:sequence>
<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:element name="MessageID" type="tns:AttributedURIType"/>
<xs:element name="RelatesTo" type="tns:RelatesToType"/>
<xs:complexType name="RelatesToType" mixed="false">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="RelationshipType" type="tns:RelationshipTypeOpenEnum" use="optional" default="http://www.w3.org/2005/08/addressing/reply"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="RelationshipTypeOpenEnum">
<xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="RelationshipType">
<xs:restriction base="xs:anyURI">
<xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
<xs:element name="From" type="tns:EndpointReferenceType"/>
<xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
<xs:element name="To" type="tns:AttributedURIType"/>
<xs:element name="Action" type="tns:AttributedURIType"/>
<xs:complexType name="AttributedURIType" mixed="false">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- Constructs from the WS-Addressing SOAP binding -->
<xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
<xs:simpleType name="FaultCodesOpenEnumType">
<xs:union memberTypes="tns:FaultCodesType xs:QName"/>
</xs:simpleType>
<xs:simpleType name="FaultCodesType">
<xs:restriction base="xs:QName">
<xs:enumeration value="tns:InvalidAddressingHeader"/>
<xs:enumeration value="tns:InvalidAddress"/>
<xs:enumeration value="tns:InvalidEPR"/>
<xs:enumeration value="tns:InvalidCardinality"/>
<xs:enumeration value="tns:MissingAddressInEPR"/>
<xs:enumeration value="tns:DuplicateMessageID"/>
<xs:enumeration value="tns:ActionMismatch"/>
<xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
<xs:enumeration value="tns:DestinationUnreachable"/>
<xs:enumeration value="tns:ActionNotSupported"/>
<xs:enumeration value="tns:EndpointUnavailable"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
<xs:complexType name="AttributedUnsignedLongType" mixed="false">
<xs:simpleContent>
<xs:extension base="xs:unsignedLong">
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
<xs:complexType name="AttributedQNameType" mixed="false">
<xs:simpleContent>
<xs:extension base="xs:QName">
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="ProblemHeader" type="tns:AttributedAnyType"/>
<xs:complexType name="AttributedAnyType" mixed="false">
<xs:sequence>
<xs:any namespace="##any" processContents="lax" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
<xs:element name="ProblemAction" type="tns:ProblemActionType"/>
<xs:complexType name="ProblemActionType" mixed="false">
<xs:sequence>
<xs:element ref="tns:Action" minOccurs="0"/>
<xs:element name="SoapAction" minOccurs="0" type="xs:anyURI"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema targetNamespace="http://www.ggf.org/namespaces/2005/12/WS-DAI" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdai="http://www.ggf.org/namespaces/2005/12/WS-DAI" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<xsd:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="./ws-addressing-0805.xsd" />
<!-- general types -->
<!-- A type that holds the abstract name (a URI) of a data resource -->
<xsd:simpleType name="DataResourceAbstractNameType">
<xsd:restriction base="xsd:anyURI"></xsd:restriction>
</xsd:simpleType>
<xsd:element name="DataResourceAbstractName" type="wsdai:DataResourceAbstractNameType" />
<!-- The address of a data resource is a WS-Addressing End Point Reference -->
<!-- DAIS will use the EPR <ReferenceParameters> element to hold the -->
<!-- DataResourceAbstractName -->
<xsd:complexType name="DataResourceAddressType">
<xsd:complexContent>
<xsd:extension base="wsa:EndpointReferenceType" />
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="DataResourceAddress" type="wsdai:DataResourceAddressType" />
<xsd:complexType name="DataResourceAddressListType">
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceAddress" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="DataResourceAddressList" type="wsdai:DataResourceAddressListType" />
<!-- the wrapper for input/output datasets -->
<xsd:complexType name="DatasetDataType" mixed="true">
<xsd:sequence>
<xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="DatasetData" type="wsdai:DatasetDataType" />
<!-- the base type wrapper for input/output datasets -->
<!-- the DatasetFormatURI indicates the format of -->
<!-- the ##any of DatasetData -->
<!-- It is expected that this type will be extended -->
<!-- by the realisations -->
<xsd:complexType name="DatasetType">
<xsd:sequence>
<xsd:element ref="wsdai:DatasetFormatURI" />
<xsd:element ref="wsdai:DatasetData" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="Dataset" type="wsdai:DatasetType" />
<!-- the base type for query expressions -->
<xsd:complexType name="ExpressionType">
<xsd:attribute name="Language" type="xsd:anyURI" />
</xsd:complexType>
<xsd:element name="Expression" type="wsdai:ExpressionType" />
<!-- the base type for requests that include an abstract resource name parameter -->
<xsd:complexType name="BaseRequestType">
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceAbstractName" />
</xsd:sequence>
</xsd:complexType>
<!-- the base types for requests that also specify a return type -->
<xsd:complexType name="RequestType">
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element ref="wsdai:DatasetFormatURI" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="Request" type="wsdai:RequestType" />
<!-- the base type for factory requests that include an abstract resource name parameter -->
<!-- a port type QName and a configuration document -->
<xsd:complexType name="FactoryRequestType">
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType">
<xsd:sequence>
<xsd:element ref="wsdai:PortTypeQName" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:ConfigurationDocument" minOccurs="0" maxOccurs="1" />
<xsd:element name="PreferredTargetService" type="wsa:EndpointReferenceType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="FactoryRequest" type="wsdai:FactoryRequestType" />
<!-- Static Properties -->
<!-- An open description of the data resource -->
<xsd:element name="DataResourceDescription">
<xsd:complexType mixed="true">
<xsd:sequence>
<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- The address of the data resource that created this data resource -->
<xsd:element name="ParentDataResource" type="wsdai:DataResourceAddressType" />
<!-- The mapping between message type and resource type. -->
<!-- For direct access, where results are returned directly -->
<!-- the DatasetType refers to the supported dataset types. -->
<xsd:element name="MessageQName" type="xsd:QName" />
<xsd:element name="DatasetFormatURI" type="xsd:anyURI" />
<xsd:complexType name="DatasetMapType">
<xsd:sequence>
<xsd:element ref="wsdai:MessageQName" />
<xsd:element ref="wsdai:DatasetFormatURI" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="DatasetMap" type="wsdai:DatasetMapType" />
<!-- For indirect access where a new resource results the -->
<!-- ConfigurationType refers to the QName of the configuration -->
<!-- document that identifies the required port type and -->
<!-- provides inital property values -->
<xsd:element name="PortTypeQName" type="xsd:QName" />
<xsd:element name="ConfigurationDocumentQName" type="xsd:QName" />
<xsd:complexType name="ConfigurationMapType">
<xsd:sequence>
<xsd:element ref="wsdai:MessageQName" />
<xsd:element ref="wsdai:PortTypeQName" />
<xsd:element ref="wsdai:ConfigurationDocumentQName" />
<xsd:element name="DefaultConfigurationDocument">
<xsd:complexType mixed="true">
<xsd:sequence>
<xsd:element ref="wsdai:ConfigurationDocument" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ConfigurationMap" type="wsdai:ConfigurationMapType" />
<!-- The mapping between message type and language type. -->
<!-- The language here is the language used to form the -->
<!-- request expression, e.g. SQL99 -->
<xsd:element name="LanguageURI" type="xsd:anyURI" />
<xsd:complexType name="LanguageMapType">
<xsd:sequence>
<xsd:element ref="wsdai:MessageQName" />
<xsd:element ref="wsdai:LanguageURI" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="LanguageMap" type="wsdai:LanguageMapType" />
<!-- Is the data resource managed by the data service -->
<!-- or by an external data management system -->
<xsd:element name="DataResourceManagement">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="ExternallyManaged" />
<xsd:enumeration value="ServiceManaged" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- Configurable properties -->
<xsd:element name="Readable" type="xsd:boolean" default="true" />
<xsd:element name="Writeable" type="xsd:boolean" />
<xsd:element name="ConcurrentAccess" type="xsd:boolean" />
<xsd:element name="TransactionInitiation">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="NotSupported" />
<xsd:enumeration value="Automatic" />
<xsd:enumeration value="Manual" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="TransactionIsolation">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="NotSupported" />
<xsd:enumeration value="ReadUncommitted" />
<xsd:enumeration value="ReadCommitted" />
<xsd:enumeration value="RepeatableRead" />
<xsd:enumeration value="Serialisable" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ChildSensitiveToParent">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="Insensitive" />
<xsd:enumeration value="Sensitive" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ParentSensitiveToChild">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="Insensitive" />
<xsd:enumeration value="Sensitive" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- core property and configuration documents -->
<xsd:complexType name="PropertyDocumentType">
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceAbstractName" />
<xsd:element ref="wsdai:DataResourceManagement" />
<xsd:element ref="wsdai:ParentDataResource" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:DatasetMap" minOccurs="0" maxOccurs="unbounded" />
<xsd:element ref="wsdai:ConfigurationMap" minOccurs="0" maxOccurs="unbounded" />
<xsd:element ref="wsdai:LanguageMap" minOccurs="0" maxOccurs="unbounded" />
<xsd:element ref="wsdai:DataResourceDescription" />
<xsd:element ref="wsdai:Readable" />
<xsd:element ref="wsdai:Writeable" />
<xsd:element ref="wsdai:ConcurrentAccess" />
<xsd:element ref="wsdai:TransactionInitiation" />
<xsd:element ref="wsdai:TransactionIsolation" />
<xsd:element ref="wsdai:ChildSensitiveToParent" />
<xsd:element ref="wsdai:ParentSensitiveToChild" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="PropertyDocument" type="wsdai:PropertyDocumentType" />
<xsd:complexType name="ConfigurationDocumentType">
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceDescription" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:Readable" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:Writeable" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:TransactionInitiation" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:TransactionIsolation" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:ChildSensitiveToParent" minOccurs="0" maxOccurs="1" />
<xsd:element ref="wsdai:ParentSensitiveToChild" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<!-- The head of the substitution group of configuration documents -->
<xsd:element name="ConfigurationDocument" type="wsdai:ConfigurationDocumentType" />
</xsd:schema>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema targetNamespace="http://www.ggf.org/namespaces/2005/12/WS-DAIX" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wrs="http://java.sun.com/xml/ns/jdbc" xmlns:wsdai="http://www.ggf.org/namespaces/2005/12/WS-DAI"
xmlns:wsdaix="http://www.ggf.org/namespaces/2005/12/WS-DAIX">
<xsd:import namespace="http://www.ggf.org/namespaces/2005/12/WS-DAI" schemaLocation="./wsdai_core_types.xsd" />
<!-- type for wrapping mixed content XML -->
<xsd:complexType name="XMLWrapperType" mixed="true">
<xsd:sequence>
<xsd:any namespace="##any" />
</xsd:sequence>
</xsd:complexType>
<!-- properties -->
<!-- the descriptive properties for an XML schema document -->
<xsd:complexType name="SchemaDescriptionType">
<xsd:sequence>
<xsd:element name="targetNamespace" type="xsd:anyURI" />
</xsd:sequence>
</xsd:complexType>
<!-- the descriptive properties for an XML document -->
<xsd:complexType name="DocumentDescriptionType">
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
<!-- a structure representing the hierarchy of collections -->
<!-- schemas and document names -->
<xsd:complexType name="CollectionType">
<xsd:sequence>
<xsd:element name="Collection" type="wsdaix:CollectionType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="Schema" type="wsdaix:SchemaDescriptionType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="Document" type="wsdaix:DocumentDescriptionType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:anyURI" />
</xsd:complexType>
<xsd:element name="TopLevelCollection" type="wsdaix:CollectionType" />
<!-- the number of documents in the data resource -->
<xsd:element name="NumberOfDocuments" type="xsd:long" />
<!-- indicates whether the XML resource supports collections -->
<xsd:element name="SupportsCollections" type="xsd:boolean" />
<!-- indicates whether the XML resource supports XML Schemas -->
<xsd:element name="SupportsSchemas" type="xsd:boolean" />
<!-- indicates whether the XML resource supports nested collections -->
<xsd:element name="SupportsCollectionNesting" type="xsd:boolean" />
<!-- property and configuration documents -->
<xsd:complexType name="XMLCollectionPropertyDocumentType">
<xsd:complexContent>
<xsd:extension base="wsdai:PropertyDocumentType">
<xsd:sequence>
<xsd:element ref="wsdaix:TopLevelCollection" />
<xsd:element ref="wsdaix:NumberOfDocuments" />
<xsd:element ref="wsdaix:SupportsCollections" />
<xsd:element ref="wsdaix:SupportsCollectionNesting" />
<xsd:element ref="wsdaix:SupportsSchemas" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="XMLCollectionPropertyDocument" type="wsdaix:XMLCollectionPropertyDocumentType" />
<!-- the properties used to configure an xml collection data resource -->
<xsd:complexType name="XMLCollectionConfigurationDocumentType">
<xsd:complexContent>
<xsd:extension base="wsdai:ConfigurationDocumentType">
<xsd:sequence>
<xsd:element ref="wsdaix:SupportsCollections" />
<xsd:element ref="wsdaix:SupportsCollectionNesting" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="XMLCollectionConfigurationDocument" type="wsdaix:XMLCollectionConfigurationDocumentType"
substitutionGroup="wsdai:ConfigurationDocument" />
</xsd:schema>

View File

@ -0,0 +1,319 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="wsdai"
targetNamespace="http://www.ggf.org/namespaces/2005/12/WS-DAI"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdai="http://www.ggf.org/namespaces/2005/12/WS-DAI">
<!-- WSDL IMPORTS ################################################## -->
<!-- WSDL TYPES #################################################### -->
<wsdl:types>
<xsd:schema targetNamespace="http://www.ggf.org/namespaces/2005/12/WS-DAI"
elementFormDefault="qualified">
<xsd:include schemaLocation="../wsdaix/types/wsdai_core_types.xsd" />
<!-- ##################### -->
<!-- ### General Types ### -->
<!-- ##################### -->
<xsd:complexType name="DataResourceUnavailableFaultType"/>
<xsd:element name="DataResourceUnavailableFault" type="wsdai:DataResourceUnavailableFaultType"/>
<xsd:complexType name="ServiceBusyFaultType"/>
<xsd:element name="ServiceBusyFault" type="wsdai:ServiceBusyFaultType"/>
<xsd:complexType name="NotAuthorizedFaultType"/>
<xsd:element name="NotAuthorizedFault" type="wsdai:NotAuthorizedFaultType"/>
<xsd:complexType name="InvalidResourceNameFaultType"/>
<xsd:element name="InvalidResourceNameFault" type="wsdai:InvalidResourceNameFaultType"/>
<xsd:complexType name="InvalidExpressionFaultType"/>
<xsd:element name="InvalidExpressionFault" type="wsdai:InvalidExpressionFaultType"/>
<xsd:complexType name="InvalidLanguageFaultType"/>
<xsd:element name="InvalidLanguageFault" type="wsdai:InvalidLanguageFaultType"/>
<xsd:complexType name="InvalidDatasetFormatFaultType"/>
<xsd:element name="InvalidDatasetFormatFault" type="wsdai:InvalidDatasetFormatFaultType"/>
<xsd:complexType name="InvalidPortTypeQNameFaultType"/>
<xsd:element name="InvalidPortTypeQNameFault" type="wsdai:InvalidPortTypeQNameFaultType"/>
<xsd:complexType name="InvalidConfigurationDocumentFaultType"/>
<xsd:element name="InvalidConfigurationDocumentFault" type="wsdai:InvalidConfigurationDocumentFaultType"/>
<!-- ####################### -->
<!-- ### GetResourceList ### -->
<!-- ####################### -->
<xsd:element name="GetResourceListRequest">
<xsd:complexType/>
</xsd:element>
<xsd:element name="GetResourceListResponse" >
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceAddress" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- ############### -->
<!-- ### Resolve ### -->
<!-- ############### -->
<xsd:element name="ResolveRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceAbstractName"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ResolveResponse" >
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdai:DataResourceAddress" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- ###################################### -->
<!-- ### GetDatResourcePropertyDocument ### -->
<!-- ###################################### -->
<xsd:element name="GetDataResourcePropertyDocumentRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:RequestType"/>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- ########################### -->
<!-- ### DestroyDataResource ### -->
<!-- ########################### -->
<xsd:element name="DestroyDataResourceRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:BaseRequestType"/>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="DestroyDataResourceResponse" >
<xsd:complexType />
</xsd:element>
<!-- ############################# -->
<!-- ### GenericQuery Messages ### -->
<!-- ############################# -->
<xsd:element name="GenericExpression">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:ExpressionType">
<xsd:sequence>
<xsd:any namespace="##any"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="GenericQueryRequest" >
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="wsdai:RequestType">
<xsd:sequence>
<xsd:element ref="wsdai:GenericExpression"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="GenericQueryResponse" >
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsdai:Dataset" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<!-- WSDL MESSAGES ############################################# -->
<wsdl:message name="ServiceBusyFault">
<wsdl:part name="ServiceBusyFault"
element="wsdai:ServiceBusyFault" />
</wsdl:message>
<wsdl:message name="DataResourceUnavailableFault">
<wsdl:part name="DataResourceUnavailableFault"
element="wsdai:DataResourceUnavailableFault" />
</wsdl:message>
<wsdl:message name="NotAuthorizedFault">
<wsdl:part name="NotAuthorizedFault"
element="wsdai:NotAuthorizedFault" />
</wsdl:message>
<wsdl:message name="InvalidResourceNameFault">
<wsdl:part name="InvalidResourceNameFault"
element="wsdai:InvalidResourceNameFault" />
</wsdl:message>
<wsdl:message name="InvalidExpressionFault">
<wsdl:part name="InvalidExpressionFault"
element="wsdai:InvalidLanguageFault" />
</wsdl:message>
<wsdl:message name="InvalidLanguageFault">
<wsdl:part name="InvalidLanguageFault"
element="wsdai:InvalidLanguageFault" />
</wsdl:message>
<wsdl:message name="InvalidDatasetFormatFault">
<wsdl:part name="InvalidDatasetFormatFault"
element="wsdai:InvalidDatasetFormatFault" />
</wsdl:message>
<wsdl:message name="InvalidPortTypeQNameFault">
<wsdl:part name="InvalidPortTypeQNameFault"
element="wsdai:InvalidPortTypeQNameFault" />
</wsdl:message>
<wsdl:message name="InvalidConfigurationDocumentFault">
<wsdl:part name="InvalidConfigurationDocumentFault"
element="wsdai:InvalidConfigurationDocumentFault" />
</wsdl:message>
<wsdl:message name="GetResourceListRequest">
<wsdl:part name="GetResourceListRequest"
element="wsdai:GetResourceListRequest" />
</wsdl:message>
<wsdl:message name="GetResourceListResponse">
<wsdl:part name="GetResourceListResponse"
element="wsdai:GetResourceListResponse" />
</wsdl:message>
<wsdl:message name="ResolveRequest">
<wsdl:part name="ResolveRequest" element="wsdai:ResolveRequest" />
</wsdl:message>
<wsdl:message name="ResolveResponse">
<wsdl:part name="ResolveResponse" element="wsdai:ResolveResponse" />
</wsdl:message>
<wsdl:message name="GetDataResourcePropertyDocumentRequest">
<wsdl:part name="GetDataResourcePropertyDocumentRequest"
element="wsdai:GetDataResourcePropertyDocumentRequest" />
</wsdl:message>
<wsdl:message name="GetDataResourcePropertyDocumentResponse">
<wsdl:part name="GetDataResourcePropertyDocumentResponse"
element="wsdai:PropertyDocument" />
</wsdl:message>
<wsdl:message name="DestroyDataResourceRequest">
<wsdl:part name="DestroyDataResourceRequest"
element="wsdai:DestroyDataResourceRequest" />
</wsdl:message>
<wsdl:message name="DestroyDataResourceResponse">
<wsdl:part name="DestroyDataResourceResponse"
element="wsdai:DestroyDataResourceResponse" />
</wsdl:message>
<wsdl:message name="GenericQueryRequest">
<wsdl:part name="GenericQueryRequest"
element="wsdai:GenericQueryRequest" />
</wsdl:message>
<wsdl:message name="GenericQueryResponse">
<wsdl:part name="GenericQueryResponse"
element="wsdai:GenericQueryResponse" />
</wsdl:message>
<!-- WSDL PORTTYPES ############################################# -->
<wsdl:portType name="CoreDataAccessPT">
<wsdl:operation name="GetDataResourcePropertyDocument">
<wsdl:input name="GetDataResourcePropertyDocumentRequest"
message="wsdai:GetDataResourcePropertyDocumentRequest" />
<wsdl:output name="GetDataResourcePropertyDocumentResponse"
message="wsdai:GetDataResourcePropertyDocumentResponse" />
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="NotAuthorizedFault"
message="wsdai:NotAuthorizedFault" />
<wsdl:fault name="ServiceBusyFault"
message="wsdai:ServiceBusyFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault"/>
</wsdl:operation>
<wsdl:operation name="DestroyDataResource">
<wsdl:input message="wsdai:DestroyDataResourceRequest" />
<wsdl:output message="wsdai:DestroyDataResourceResponse" />
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault"/>
<wsdl:fault name="NotAuthorizedFault"
message="wsdai:NotAuthorizedFault"/>
<wsdl:fault name="ServiceBusyFault"
message="wsdai:ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="GenericQuery">
<wsdl:input message="wsdai:GenericQueryRequest" />
<wsdl:output message="wsdai:GenericQueryResponse" />
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="InvalidExpressionFault"
message="wsdai:InvalidExpressionFault" />
<wsdl:fault name="InvalidLanguageFault"
message="wsdai:InvalidLanguageFault" />
<wsdl:fault name="InvalidDatasetFormatFault"
message="wsdai:InvalidDatasetFormatFault" />
<wsdl:fault name="NotAuthorizedFault"
message="wsdai:NotAuthorizedFault" />
<wsdl:fault name="ServiceBusyFault"
message="wsdai:ServiceBusyFault" />
<wsdl:fault name="DataResourceUnavailableFault"
message="wsdai:DataResourceUnavailableFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="CoreResourceListPT">
<wsdl:operation name="GetResourceList">
<wsdl:input name="GetResourceListRequest"
message="wsdai:GetResourceListRequest" />
<wsdl:output name="GetResourceListResponse"
message="wsdai:GetResourceListResponse" />
<wsdl:fault name="NotAuthorizedFault"
message="wsdai:NotAuthorizedFault" />
<wsdl:fault name="ServiceBusyFault"
message="wsdai:ServiceBusyFault" />
</wsdl:operation>
<wsdl:operation name="Resolve">
<wsdl:input message="wsdai:ResolveRequest" />
<wsdl:output message="wsdai:ResolveResponse" />
<wsdl:fault name="InvalidResourceNameFault"
message="wsdai:InvalidResourceNameFault" />
<wsdl:fault name="NotAuthorizedFault"
message="wsdai:NotAuthorizedFault" />
<wsdl:fault name="ServiceBusyFault"
message="wsdai:ServiceBusyFault" />
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

View File

@ -1,571 +0,0 @@
package org.gcube.informationsystem.collector.impl.persistence;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.persistence.AggregatorPersistentResource;
import org.xmldb.api.modules.XMLResource;
import org.xmldb.api.base.XMLDBException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.lang.Exception;
import org.w3c.dom.*;
import org.xml.sax.InputSource;
import javax.xml.parsers.*;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.*;
/**
* AggregatorPersistentResource represents a resource in the XML Storage
* repository
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class AggregatorPersistentResource extends PersistentResource {
private String resourceID = null;
private String resource_string = null;
// the resource type states if the resource contains a profile or generic
// WS-ResourceProperties
private RESOURCETYPE type = null;
// the profile type states which kind of profiles the resource contains
// (RunningInstance, Service, etc.)
private String profile_type = null;
// the various parts of the resource
private String data = null, entryKey, groupKey, source, sourceKey = "", completeSourceKey = "";
private Calendar terminationTime = null, lastUpdateTime = null;
private static GCUBELog logger = new GCUBELog(AggregatorPersistentResource.class);
// the source XMLResource (if any)
private XMLResource originalSource = null;
// the XML DOM loaded from the resource string
private Document internalDOM = null;
// xpath factory to evaluate Xpath expressions
private XPath path = XPathFactory.newInstance().newXPath();
/**
* Builds a new empty DISPersinstentresource
* @param key
* @param source
* @throws Exception if it was impossible to extract the ID from the resource
*
*/
public AggregatorPersistentResource(String source, String key, String data, RESOURCETYPE type) throws Exception {
// defatult termination time is now
Calendar cal = new GregorianCalendar();
cal.setTimeZone(TimeZone.getTimeZone("GMT"));
this.setTerminationTime(cal);
this.source = source;
this.sourceKey = key;
this.data = data;
this.type = type;
lastUpdateTime = new GregorianCalendar();
lastUpdateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
this.buildID();
logger.debug("Resource ID: " + this.resourceID);
}
/**
* Builds a DISPersinstentresource starting from an eXist resource
*
* @param resource
* the input eXist resource
* @throws Exception
* if the resource is invalid
*/
public AggregatorPersistentResource(XMLResource resource) throws Exception {
if (resource == null)
throw new Exception("invalid resource");
try {
this.resourceID = resource.getId();
this.originalSource = resource;
this.resource_string = resource.getContent().toString();
this.parseResource();
logger.debug("Resource ID: " + this.resourceID);
} catch (XMLDBException dbe) {
throw new Exception("invalid resource");
}
}
private void buildID() throws Exception {
if ((this.type != null) && (type == RESOURCETYPE.Profile)) { //it's a gCube profile
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(this.toXML());
InputSource source = new InputSource(reader);
Document internalDOM = builder.parse(source);
// gets the type
XPath path = XPathFactory.newInstance().newXPath();
this.profile_type = path.evaluate("/Document/Data/child::*[local-name()='Profile']/Resource/Type", internalDOM);
// uses the GCUBEResource ID as local resource ID
this.resourceID = path.evaluate("/Document/Data/child::*[local-name()='Profile']/Resource/ID", internalDOM);
} catch (Exception e) {
logger.error("Unable to extract the ID from the resource " + e.getMessage());
throw e;
}
} else { //it's a RP doc
//we need to replace the schema and colons in order to make it an ID accepted by eXist
this.resourceID = this.source.replace("http://", "").replace(":", "").replace("/", "-") + "-" + this.sourceKey.replace("http://", "").replace(":", "").replace("/", "-");
}
}
/**
* Sets the content of the resource
*
* @param data the new content
*/
public void setData(String data) {
this.data = data;
}
/**
* Sets the content of the resource using the content of a file
*
* @param f the file to use as content source
*
* @throws IOException if the access to the given file fails
*
*/
public void setData(File f) throws IOException {
try {
FileInputStream fin = new FileInputStream(f);
this.data = fin.toString();
} catch (IOException ioe) {
logger.error("Unable to set content from file " + f.getAbsolutePath());
throw ioe;
}
}
/**
* Accesses the resource content
*
* @return the content
* @throws MalformedResourceException
*/
public String getData() throws MalformedResourceException {
if (this.data == null)
this.data = this.extractData();
return this.data;
}
/**
* @return
* @throws MalformedResourceException
*/
private String extractData() throws MalformedResourceException {
if (this.internalDOM != null) {
try {
if (this.getType() == RESOURCETYPE.Profile)
return nodeToString(internalDOM.getElementsByTagName("Resource").item(0)); //Data/Profile/Resource
else
return nodeToString(internalDOM.getElementsByTagName("Data").item(0)); //Data/*
} catch (Exception e) {
logger.error("",e);
throw new MalformedResourceException("unable to retrieve data for resource " + this.getID());
}
} else
throw new MalformedResourceException("unable to retrieve data for resource " + this.getID());
}
/**
*
* @return the original XMLResource from which the resource has been
* generated (if any)
*/
public XMLResource getOriginalXMLResource() {
return this.originalSource;
}
/**
* Accesses the resource ID
*
* @return the ID
*/
public String getID() {
return this.resourceID;
}
/**
* Accesses the source GroupKey
*
* @return the ID
*/
public String getGroupKey() {
return this.groupKey;
}
/**
* Sets the source GroupKey
*
* @param groupKey
* the new group key
*
*/
public void setGroupKey(String groupKey) {
this.groupKey = groupKey;
}
/**
* Accesses the source EntryKey
*
* @return the ID
*/
public String getEntryKey() {
return this.entryKey;
}
/**
* Sets the source EntryKey
*
* @param entryKey
* the new entry key
*/
public void setEntryKey(String entryKey) {
this.entryKey = entryKey;
}
/**
* Sets the source address of the RI that publishes resource as reported in
* the servicegroup entry
*
* @param source
* the new source address
*/
public void setSource(String source) {
this.source = source;
}
/**
* Accesses the source address of the service that published the data
*
* @return the source
*/
public String getSource() {
return this.source;
}
/**
* Sets the key of the WS-Resource that published the data
*
* @param key
* the new source key
*/
public void setSourceKey(String key) {
this.sourceKey = key;
}
/**
* Gets the key of the WS-Resource that published the data
*
* @return the key
*/
public String getSourceKey() {
return this.sourceKey;
}
/**
* Sets the complete source key
*
* @param completeKey the new complete key
*/
public void setCompleteSourceKey(String completeKey) {
this.completeSourceKey = completeKey;
}
/**
* Gets the complete source key
*
* @return the complete source key
*/
public String getCompleteSourceKey() {
return this.completeSourceKey;
}
/**
* Sets the resource type. The actual implementation supports "Profile" and
* "Properties" as type
*
* @param type
* "Profile" or "Properties"
*/
public void setType(RESOURCETYPE type) {
this.type = type;
}
/**
* Accesses the resource type. The actual implementation supports "Profile"
* and "Properties" as type
*
* @return the type
*/
public RESOURCETYPE getType() {
if (this.type == null)
this.type = this.extractType();
return this.type;
}
/**
* @return
*/
private RESOURCETYPE extractType() {
if (internalDOM.getElementsByTagName("Resource").getLength() > 0) {
logger.trace("The resource is a profile");
return RESOURCETYPE.Profile;
}
else {
logger.trace("The resource is a RP");
return RESOURCETYPE.Properties;
}
}
/**
* Updates the resource body
*
* @param data
* the new body
*
*/
public void updateData(String data) {
this.data = data;
}
/**
* Builds a XML representation of the resource
*
* @return a String in the form of &lt;Document&gt;... &lt;Data&gt; resource
* content &lt;/Data&gt; &lt;/Document&gt;
*/
private String toXML() {
StringBuilder resource = new StringBuilder("<Document>\n");
resource.append("<ID>" + this.getID() + "</ID>\n");
resource.append("<Source>" + this.getSource() + "</Source>\n");
resource.append("<SourceKey>" + this.getSourceKey() + "</SourceKey>\n");
resource.append("<CompleteSourceKey>" + this.getCompleteSourceKey() + "</CompleteSourceKey>\n");
resource.append("<EntryKey>" + this.getEntryKey() + "</EntryKey>\n");
resource.append("<GroupKey>" + this.getGroupKey() + "</GroupKey>\n");
resource.append("<TerminationTime>"+ this.getTerminationTime().getTimeInMillis()+ "</TerminationTime>\n");
resource.append("<TerminationTimeHuman>" + this.getTerminationTime().getTime().toString()+ "</TerminationTimeHuman>\n");
resource.append("<LastUpdateMs>" + this.lastUpdateTime.getTimeInMillis()+ "</LastUpdateMs>\n");
resource.append("<LastUpdateHuman>" + this.lastUpdateTime.getTime().toString() + "</LastUpdateHuman>\n");
try {
resource.append(this.getData() + "\n");
} catch (MalformedResourceException e) {
logger.warn("Unable to read the resource data",e);
}
resource.append( "</Document>\n");
return resource.toString();
}
/**
*
* @return a String representation of the resource
*/
public String toString() {
if (this.resource_string == null)
return this.toXML();
else
return this.resource_string;
}
/**
* Accesses the type of resource to which the profile is related to (if any)
*
* @return null if the resource does not contain a profile
*/
public String getProfileType() {
if (this.profile_type != null) {
// the profile type has been already extracted
return this.profile_type;
}
if ((this.type != null) && (type == RESOURCETYPE.Profile)) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(this.toXML());
InputSource source = new InputSource(reader);
Document internalDOM = builder.parse(source);
// gets the type
XPath path = XPathFactory.newInstance().newXPath();
this.profile_type = path.evaluate("/Document/Data/child::*[local-name()='Profile']/Resource/Type", internalDOM);
// uses the GCUBEResource ID as local resource ID
this.resourceID = path.evaluate("/Document/Data/child::*[local-name()='Profile']/Resource/ID", internalDOM);
} catch (Exception e) {
logger.error("Unable to extract the profile type from the resource " + e.getMessage());
}
}
return this.profile_type;
}
/**
* @return the terminationTime of this resource
*/
public Calendar getTerminationTime() {
return terminationTime;
}
/**
* @param terminationTime
* the terminationTime to set
*/
public void setTerminationTime(Calendar terminationTime) {
this.terminationTime = (Calendar) terminationTime.clone();
this.terminationTime.setTimeZone(TimeZone.getTimeZone("GMT"));
}
/**
* Compares two resources
*
* @param o
* the resource to compare
* @return true if the resources have the same ID
*/
public boolean equals(Object o) {
// check the class this object is instance of
if (!(o instanceof AggregatorPersistentResource))
return false;
// compare the two objects
AggregatorPersistentResource key = (AggregatorPersistentResource) o;
if (key.getID() == this.getID())
return true;
else
return false;
}
/**
* @return the lastUpdateTime in milliseconds
* @throws Exception if an error occurs when accessing the LastUpdateMs field
*/
public long getLastUpdateTimeinMills() throws MalformedResourceException {
if (lastUpdateTime != null)
return lastUpdateTime.getTimeInMillis();
if ((lastUpdateTime == null) && (this.internalDOM != null)) {
String value = "";
try {
value = path.evaluate("Document/LastUpdateMs", this.internalDOM);
} catch (XPathExpressionException xpee) {
logger.error("" + xpee.getMessage());
logger.error("" + xpee.getStackTrace());
throw new MalformedResourceException("XPath evaluation error");
}
try {
return Long.parseLong(value);
} catch (NumberFormatException nfe) {
logger.error("Invalid last update time format found in resource " + this.getID());
logger.error("Parsed string was " + value);
throw new MalformedResourceException("Unable to retrieve last update time for resource " + this.getID());
}
} else
throw new MalformedResourceException("unable to retrieve last update time for resource " + this.getID());
}
/**
* Loads the XML DOM from the resource string
*
*/
private void parseResource() throws MalformedResourceException {
logger.debug("Parsing resource: " + this.resource_string);
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(this.resource_string);
InputSource source = new InputSource(reader);
this.internalDOM = builder.parse(source);
} catch (Exception e) {
throw new MalformedResourceException(e);
}
}
/*
* (non-Javadoc)
*
* @see
* org.gcube.informationsystem.collector.impl.persistence.PersistentResource
* #getPublisher()
*/
@Override
public String getPublisher() {
return null;
}
/*
* (non-Javadoc)
*
* @see
* org.gcube.informationsystem.collector.impl.persistence.PersistentResource
* #setPublisher(java.lang.String)
*/
@Override
public void setPublisher(String publisher) {
}
/**
* Node to String helper
* @param node the source node
* @return the node content serialized as string
* @throws Exception if the serialization fails
*/
private String nodeToString(Node node) throws Exception{
try {
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
StringWriter buffer = new StringWriter();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.transform(new DOMSource(node), new StreamResult(buffer));
return buffer.toString();
} catch (TransformerConfigurationException e) {
logger.error("Unable to deserialise content data", e);
throw new Exception("Unable to deserialise content data");
} catch (TransformerException e) {
logger.error("Unable to deserialise content data", e);
throw new Exception("Unable to deserialise content data");
}
}
}

View File

@ -1,109 +0,0 @@
package org.gcube.informationsystem.collector.impl.persistence;
/**
* A resource handled by the XML repository
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public abstract class PersistentResource {
public enum RESOURCETYPE {
Profile, Properties
}
protected String id;
/**
* Gets the resource ID
*
* @return the ID
*/
public abstract String getID();
/**
* @return a String representation of the resource
*/
public abstract String toString();
/**
* Gets the resource type.
*
* @return the resource type
*/
public abstract RESOURCETYPE getType();
/**
* Gets the resource profile type, if any
*
* @return the resource profile type
* @throws Exception
* if the resource has no profile type (i.e. it is not a
* profile)
*/
public abstract String getProfileType() throws MalformedResourceException;
/**
* Gets the publisher of the resource
*
* @return the publisher
*/
public abstract String getPublisher();
/**
* Sets the resource's publisher
*
* @param publisher
* the publisher
*/
public abstract void setPublisher(String publisher);
/**
* @return
* @throws Exception
*/
public abstract long getLastUpdateTimeinMills() throws MalformedResourceException;
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PersistentResource other = (PersistentResource) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
/**
*
* Malformed resource exception
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public static class MalformedResourceException extends Exception {
private static final long serialVersionUID = 1L;
public MalformedResourceException(Exception e) {super(e);}
public MalformedResourceException(String message) {super(message);}
}
}

View File

@ -1,253 +0,0 @@
package org.gcube.informationsystem.collector.impl.porttypes;
import javax.xml.namespace.QName;
import org.diligentproject.informationservice.disic.stubs.DeleteProfileParams;
import org.globus.wsrf.utils.FaultHelper;
import org.oasis.wsrf.faults.BaseFaultType;
import org.xmldb.api.base.ResourceSet;
import org.xmldb.api.modules.XMLResource;
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;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.Sweeper;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XQuery;
/**
* An implementation of the <em>diligentproject/informationservice/disic/DISICService</em> portType. <br/>
* This is here to support backward compatibility with the "old" GHN in the infrastructure.
* @deprecated
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class OldService extends GCUBEPortType {
private final GCUBELog logger = new GCUBELog(OldService.class);
/**
* WS Properties namespace
*/
public static final QName RP_SET = new QName(
"http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess",
"ICRP");
/**
* Executes the given XQuery on the embedded eXist DB instance
*
* @param xquery
* - a valid XQuery. It must be compliant with the syntax (with
* the exception of XML Schema-related features) as specified in
* W3C's recommendations outlined in the June 2006 candidate
* recommendation
* @return the result set wrapped in a &lt;Resultset&gt; tag. Each record is
* wrapped with a &lt;Recordt&gt;
* @throws BaseFaultType
* if the XQuery is not valid or the connection to eXist is
* broken
*/
public String executeXQuery(String xquery) throws BaseFaultType {
StringBuilder response = new StringBuilder();
try {
logger.debug("executing XQuery: " + xquery);
XQuery q = new XQuery(xquery);
ResourceSet result = State.getQueryManager().executeXQuery(q);
logger.debug("number of returned documents: " + result.getSize());
response.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");
}
response.append("</Resultset>");
} catch (Exception e) {
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper.addDescription("IC service: Exception when executing the requested XQuery");
throw fault;
}
return response.toString();
}
/**
* Removes a profile from the Storage given its DILIGENT Resource ID
*
* @param params
* a stub class including private java.lang.String
* DILIGENTResourceID; the id of the profile to remove private
* java.lang.String profileType; the type of the profile to
* remove (e.g RunningInstance, DHN, Service, etc.);
* @return true if the resource is successfully deleted
* @throws BaseFaultType
* if the type parameter is not valid or an error occurs when
* deleting the profile
*/
public boolean deleteProfile(DeleteProfileParams params) throws BaseFaultType {
boolean response = false;
String id = params.getDILIGENTResourceID();
String type = params.getProfileType();
if ((id == "") || (id == null)) {
logger.warn("invalid id");
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addDescription("invalid id");
throw fault;
}
if ((type == "") || (type == null)) {
logger.warn("invalid profile type");
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addDescription("invalid profile type");
throw fault;
}
try {
logger.debug("deleting profile " + id + " from collection " + type);
State.getDataManager().retrieveAndDeleteProfileFromID(id, type);
if (type.equalsIgnoreCase("RunningInstance"))
Sweeper.cleanResourceForRI(id);
} catch (Exception e) {
logger.error("unable to remove resource: " + id, e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper
.addDescription("IC service: Exception when deleting the requested resource");
throw fault;
}
return response;
}
/**
* Removes a resource from the Storage given its ID
*
* @param id
* - the id of the resoure to remove
* @return true if the resource is successfully deleted
* @throws BaseFaultType
* if the id parameter is null or an error occurs when deleting
* the profile
*/
public boolean deleteResource(String id) throws BaseFaultType {
boolean response = false;
if ((id == "") || (id == null)) {
logger.warn("invalid id");
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addDescription("invalid id");
throw fault;
}
try {
logger.debug("deleting resource: " + id);
State.getDataManager().retrieveAndDeleteResourceFromID(id);
} catch (Exception e) {
logger.error("unable to remove resource: " + id, e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper
.addDescription("IC service: Exception when deleting the requested resource");
throw fault;
}
return response;
}
/**
* Deletes the entire set of registered RPs from the storage
*
* @throws BaseFaultType
* if an error occurs when deleting the resources
*/
public void deleteAllRPs() throws BaseFaultType {
try {
logger.info("DeleteAllRPs operation invoked");
Sweeper.cleanRPs();
logger.info("All RPs have been deleted from the storage");
} catch (Exception e) {
logger.error("unable to clean RPs collction: ", e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper.addDescription("IC service: Exception when deleting the requested resource");
throw fault;
}
}
/**
* Disposes the State service
*
* @throws BaseFaultType
* if the shutdown fails
*/
public void dispose() throws BaseFaultType {
try {
logger.info("Dispose operation invoked");
logger.info("trying to shutdown the storage instances...");
try {
State.getDataManager().shutdown(true);
State.getQueryManager().shutdown(true);
} catch (NullPointerException se) {/* nothing to do */
}
// request the interruption of the sweeper thread
State.sweeperT.interrupt();
logger.info("done");
} catch (Exception e) {
logger.error("unable to pose the IC with success ", e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper
.addDescription("-IC service: Unable to pose the service");
throw fault;
}
}
/**
* Initialized the State service
*
* @throws BaseFaultType
* if the initialization fails
*/
public void initialize() throws BaseFaultType {
try {
logger.info("Initialize operation invoked");
State.initialize();
logger.info("done");
} catch (Exception e) {
logger.error("Unable to initialize the IC state", e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper.addDescription("-IC service: Unable to initialize the service");
throw fault;
}
}
/* (non-Javadoc)
* @see org.gcube.common.core.porttypes.GCUBEPortType#getServiceContext()
*/
@Override
protected GCUBEServiceContext getServiceContext() {
return ICServiceContext.getContext();
}
}

View File

@ -14,6 +14,7 @@ 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;
import org.gcube.informationsystem.collector.impl.state.AggregatorRegisteredResource;
/**
* <em>Sink</em> PortType's implementation class. It's the registration PortType
@ -43,7 +44,7 @@ public class Sink extends GCUBEPortType implements ResourceLifetime, ResourcePro
*
*/
public Sink() {
this.propSet = new SimpleResourcePropertySet(XMLCollectionAccess.RP_SET);
this.propSet = new SimpleResourcePropertySet(AggregatorRegisteredResource.RP_SET);
ResourceProperty prop = null;
try {
// ResourceLifeTime properties

View File

@ -1,224 +0,0 @@
package org.gcube.informationsystem.collector.impl.porttypes;
import javax.xml.namespace.QName;
import org.oasis.wsrf.faults.BaseFaultType;
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;
import org.gcube.informationsystem.collector.impl.persistence.AggregatorPersistentResource;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.Sweeper;
import org.gcube.informationsystem.collector.stubs.DeleteProfileParams;
import org.gcube.informationsystem.collector.stubs.DocumentNotFoundFaultType;
import org.gcube.informationsystem.collector.stubs.GetProfileCriteria;
import org.gcube.informationsystem.collector.stubs.GetProfileLastModificationTimeMsCriteria;
import org.gcube.informationsystem.collector.stubs.GetResourceCriteria;
import org.gcube.informationsystem.collector.stubs.GetResourceLastModificationTimeMsCriteria;
import org.globus.wsrf.utils.FaultHelper;
/**
* State service implementation class
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class XMLCollectionAccess extends GCUBEPortType {
/**
* WS Properties namespace
*/
public static final QName RP_SET = new QName(
"http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess",
"ICRP");
private final GCUBELog logger = new GCUBELog(XMLCollectionAccess.class);
/**
* Removes a profile from the Storage given its DILIGENT Resource ID
*
* @param params
* a stub class including private java.lang.String
* DILIGENTResourceID; the id of the profile to remove private
* java.lang.String profileType; the type of the profile to
* remove (e.g RunningInstance, DHN, Service, etc.);
* @return true if the resource is successfully deleted
* @throws BaseFaultType
* if the type parameter is not valid or an error occurs when
* deleting the profile
*/
public boolean deleteProfile(DeleteProfileParams params)
throws BaseFaultType {
boolean response = false;
String id = params.getID();
String type = params.getProfileType();
if ((id == "") || (id == null)) {
logger.warn("invalid id");
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addDescription("invalid id");
throw fault;
}
if ((type == "") || (type == null)) {
logger.warn("invalid profile type");
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addDescription("invalid profile type");
throw fault;
}
try {
logger.debug("deleting profile " + id + " from collection " + type);
State.getDataManager().retrieveAndDeleteProfileFromID(id, type);
if (type.equalsIgnoreCase("RunningInstance"))
Sweeper.cleanResourceForRI(id);
} catch (Exception e) {
logger.error("unable to remove resource: " + id, e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper
.addDescription("IC service: Exception when deleting the requested resource");
throw fault;
}
return response;
}
/**
* Removes a resource from the Storage given its ID
*
* @param id
* - the id of the resoure to remove
* @return true if the resource is successfully deleted
* @throws BaseFaultType
* if the id parameter is null or an error occurs when deleting
* the profile
*/
public boolean deleteResource(String id) throws BaseFaultType {
boolean response = false;
if ((id == "") || (id == null)) {
logger.warn("invalid id");
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addDescription("invalid id");
throw fault;
}
try {
logger.debug("deleting resource: " + id);
State.getDataManager().retrieveAndDeleteResourceFromID(id);
} catch (Exception e) {
logger.error("unable to remove resource: " + id, e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper
.addDescription("IC service: Exception when deleting the requested resource");
throw fault;
}
return response;
}
/**
* Deletes the entire set of registered RPs from the storage
*
* @throws BaseFaultType if an error occurs when deleting the resources
*/
public void deleteAllRPs() throws BaseFaultType {
try {
logger.info("DeleteAllRPs operation invoked");
Sweeper.cleanRPs();
logger.info("All RPs have been deleted from the storage");
} catch (Exception e) {
logger.error("unable to clean RPs collction: ", e);
BaseFaultType fault = new BaseFaultType();
FaultHelper faultHelper = new FaultHelper(fault);
faultHelper.addFaultCause(e);
faultHelper.addDescription("IC service: Exception when deleting the requested resource");
throw fault;
}
}
/**
* Retrieves the given Resource
* @param criteria the Resource ID
* @return the XML serialization of the Resource
* @throws DocumentNotFoundFaultType if the Resource does not exist
*/
public String getResource(GetResourceCriteria criteria) throws DocumentNotFoundFaultType {
try {
AggregatorPersistentResource aresource = State.getDataManager().retrievePropertyResourceFromID(criteria.getID());
return aresource.getData();
} catch (Exception e) {
logger.warn("Unable to find Resource with ID=" + criteria.getID(), e);
throw new DocumentNotFoundFaultType();
}
}
/**
* Retrieves the given Profile
* @param criteria the Profile ID and Type
* @return the XML serialization of the Profile
* @throws DocumentNotFoundFaultType if the Profile does not exist
*/
public String getProfile(GetProfileCriteria criteria) throws DocumentNotFoundFaultType {
try {
AggregatorPersistentResource aresource = State.getDataManager().retrieveProfile(criteria.getID(), criteria.getProfileType());
return aresource.getData();
} catch (Exception e) {
logger.warn("Unable to find Profile with ID=" + criteria.getID(), e);
throw new DocumentNotFoundFaultType();
}
}
/**
* Gets the last modification time in milliseconds of the given Profile
* @param criteria the Profile ID and Type
* @return the last update time in milliseconds
* @throws DocumentNotFoundFaultType if the Profile does not exist
*/
public long getProfileLastModificationTimeMs(GetProfileLastModificationTimeMsCriteria criteria) throws DocumentNotFoundFaultType {
try {
AggregatorPersistentResource aresource = State.getDataManager().retrieveProfile(criteria.getID(), criteria.getProfileType());
return aresource.getLastUpdateTimeinMills();
} catch (Exception e) {
logger.warn("Unable to find Profile with ID=" + criteria.getID(), e);
throw new DocumentNotFoundFaultType();
}
}
/**
* Gets the last modification time in milliseconds of the given Resource
* @param criteria the Resource ID
* @return the last update time in milliseconds
* @throws DocumentNotFoundFaultType if the Resource does not exist
*/
public long getResourceLastModificationTimeMs(GetResourceLastModificationTimeMsCriteria criteria) throws DocumentNotFoundFaultType {
try {
AggregatorPersistentResource aresource = State.getDataManager().retrievePropertyResourceFromID(criteria.getID());
return aresource.getLastUpdateTimeinMills();
} catch (Exception e) {
logger.warn("Unable to find Resource with ID=" + criteria.getID(), e);
throw new DocumentNotFoundFaultType();
}
}
/** {@inheritDoc} */
@Override
protected GCUBEServiceContext getServiceContext() {
return ICServiceContext.getContext();
}
}

View File

@ -9,7 +9,7 @@ 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.impl.xmlstorage.exist.XMLStorageManager.XMLStorageNotAvailableException;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.XMLStorageNotAvailableException;
import org.gcube.informationsystem.collector.stubs.XQueryExecuteRequest;
import org.gcube.informationsystem.collector.stubs.XQueryExecuteResponse;
import org.gcube.informationsystem.collector.stubs.XQueryFaultType;

View File

@ -0,0 +1,391 @@
package org.gcube.informationsystem.collector.impl.porttypes.wsdaix;
import java.rmi.RemoteException;
import org.apache.axis.message.MessageElement;
import org.w3c.dom.Document;
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;
import org.gcube.informationsystem.collector.impl.resources.BaseDAIXResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEProfileResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.gcube.informationsystem.collector.impl.resources.DAIXResource.MalformedResourceException;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource.MalformedXMLResourceException;
import org.gcube.informationsystem.collector.impl.utils.MetadataReader;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.XMLStorageNotAvailableException;
import org.gcube.informationsystem.collector.stubs.wsdai.DataResourceUnavailableFaultType;
import org.gcube.informationsystem.collector.stubs.wsdai.GetDataResourcePropertyDocumentRequest;
import org.gcube.informationsystem.collector.stubs.wsdai.InvalidResourceNameFaultType;
import org.gcube.informationsystem.collector.stubs.wsdai.NotAuthorizedFaultType;
import org.gcube.informationsystem.collector.stubs.wsdai.ServiceBusyFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentRequestWrapper;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentResponseWrapper;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentResponseWrapperResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentsRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentsResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddSchemaRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddSchemaResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.CollectionAlreadyExistsFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.CreateSubcollectionRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.CreateSubcollectionResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.GetDocumentResponseWrapper;
import org.gcube.informationsystem.collector.stubs.wsdaix.GetDocumentResponseWrapperResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.GetDocumentsRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.GetDocumentsResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.GetSchemaRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.GetSchemaResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.InvalidCollectionNameFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveDocumentRequestWrapper;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveDocumentResponseWrapper;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveDocumentResponseWrapperResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.XMLWrapperType;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveDocumentsRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveDocumentsResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveSchemaRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveSchemaResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveSubcollectionRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.RemoveSubcollectionResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.SchemaAdditionMakesDocumentsInvalidFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.SchemaAlreadyExistsFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.SchemaDoesNotExistFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.SchemaInvalidFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.SchemaRemovalMakesDocumentsInvalidFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.SchemaRemovalMakesSchemaInvalidFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.XMLCollectionPropertyDocumentType;
/**
*
* Implementation of the WS-DAIX XMLCollectionAccess port type
*
* @author Manuele Simi (ISTI-CNR)
*
*
*/
public class XMLCollectionAccess extends GCUBEPortType {
private static GCUBELog logger = new GCUBELog(XMLCollectionAccess.class);
/**
* Implementation of CollectionAccess::GetDocuments
*
* @param getDocumentsRequest
* @return
* @throws RemoteException
* @throws ServiceBusyFaultType the service is already processing a request and ConcurrentAccess is false.
* @throws InvalidResourceNameFaultType the supplied resource name is not known to the service.
* @throws InvalidCollectionNameFaultType the supplied collection name is not known to the XML resource.
*/
public GetDocumentsResponse getDocuments(GetDocumentsRequest getDocumentsRequest)
throws RemoteException, ServiceBusyFaultType, InvalidResourceNameFaultType,
InvalidCollectionNameFaultType {
int size = getDocumentsRequest.getGetDocumentRequestWrapper().length;
GetDocumentResponseWrapper[] responseWrapper = new GetDocumentResponseWrapper[size];
for(int i=0;i<size;i++) {
String resourceName = getDocumentsRequest.getGetDocumentRequestWrapper(i).getDocumentName();
responseWrapper[i] = new GetDocumentResponseWrapper();
responseWrapper[i].setDocumentName(resourceName);
try {
logger.trace("Retrieving resource " + resourceName + " from collection " + getDocumentsRequest.getCollectionName().getPath());
BaseDAIXResource resource = new BaseDAIXResource(resourceName);
resource.setCollectionName(getDocumentsRequest.getCollectionName().getPath());
GCUBEXMLResource xmlResource = new GCUBEXMLResource(resource);
State.getDataManager().retrieveResourceContent(xmlResource);
XMLWrapperType wrapper = new XMLWrapperType();
MessageElement msgElem = new MessageElement(xmlResource.getContent().getDocumentElement());
wrapper.set_any(new MessageElement[] {msgElem} );
responseWrapper[i].setData(wrapper);
responseWrapper[i].setResponse(GetDocumentResponseWrapperResponse.value1);
} catch ( Exception e ) {
logger.error("Unable to get the resource: " + e);
responseWrapper[i].setResponse(GetDocumentResponseWrapperResponse.value2);
}
}
GetDocumentsResponse response = new GetDocumentsResponse();
response.setGetDocumentResponseWrapper(responseWrapper);
return response;
}
/**
* Implementation of CollectionAccess::AddDocuments
*
* @param addDocumentsRequest
* @return the documents response
* @throws RemoteException
* @throws ServiceBusyFaultType
* @throws InvalidResourceNameFaultType
* @throws InvalidCollectionNameFaultType
*/
public AddDocumentsResponse addDocuments(AddDocumentsRequest addDocumentsRequest)
throws RemoteException, ServiceBusyFaultType, InvalidResourceNameFaultType, InvalidCollectionNameFaultType {
logger.debug("Adding documents to collection");
AddDocumentRequestWrapper[] docs = addDocumentsRequest.getAddDocumentRequestWrapper();
AddDocumentResponseWrapper[] responseWrappers = new AddDocumentResponseWrapper[docs.length];
//response wrapper values
//1 - <xsd:enumeration value="Success"/>
//2 - <xsd:enumeration value="DocumentNotAdded-DocumentDoesNotValidate"/>
//3 - <xsd:enumeration value="DocumentNotAdded-NotAuthorized"/>
//4 - <xsd:enumeration value="DocumentOfSameNameOverwritten"/>
for(int i=0;i<docs.length;i++) {
String resourceName = docs[i].getDocumentName();
responseWrappers[i] = new AddDocumentResponseWrapper();
responseWrappers[i].setDocumentName(resourceName);
logger.info("Storing resource " + resourceName);
//String output = "AddDocument-" + UniqueName.getInstance().getName();
MessageElement elem = docs[i].getData().get_any()[0];
MessageElement elem2 = docs[i].getData().get_any()[1];
Document doc = null;
MetadataReader metadataReader = null;
try {
Object o = elem.getAsDocument();
if (! (o instanceof Document))
throw new Exception("Unable to add resource " + resourceName + " because of a problem deserializing the document");
doc = (Document) o;
} catch ( Exception e ) {
logger.error("Unable to read the resource", e);
responseWrappers[i].setResponse(AddDocumentResponseWrapperResponse.value2);
continue;
}
try {
Object o = elem2.getAsDocument();
if (! (o instanceof Document))
throw new Exception("Unable to add resource " + resourceName + " because of a problem deserializing the metadata");
metadataReader = new MetadataReader((Document) o);
} catch ( Exception e ) {
logger.error("Unable to read resource's metadata", e);
responseWrappers[i].setResponse(AddDocumentResponseWrapperResponse.value2);
continue;
}
BaseDAIXResource resource;
if (metadataReader.getType().compareToIgnoreCase("Profile") == 0) {
resource = new GCUBEProfileResource();
} else if (metadataReader.getType().compareToIgnoreCase("InstanceState") == 0) {
resource = new GCUBEInstanceStateResource();
} else {
resource = new BaseDAIXResource();
resource.setCollectionName(addDocumentsRequest.getCollectionName().getPath());
}
try {
resource.setResourceName(resourceName);
resource.setContent(doc);
} catch (MalformedResourceException e1) {
logger.error("Invalid resource ", e1);
responseWrappers[i].setResponse(AddDocumentResponseWrapperResponse.value2);
continue;
}
GCUBEXMLResource xmlResource;
try {
xmlResource = new GCUBEXMLResource(resource);
xmlResource.setSource(metadataReader.getSource());
xmlResource.setTerminationTime(metadataReader.getTerminationTime());
xmlResource.setGroupKey(metadataReader.getGroupKey());
xmlResource.setEntryKey(metadataReader.getEntryKey());
xmlResource.setSourceKey(metadataReader.getKey());
//store/update the new resource
State.getDataManager().storeResource(xmlResource);
logger.info("Resouce " + resource.getResourceName() + " successfully stored");
responseWrappers[i].setResponse(AddDocumentResponseWrapperResponse.value1);
} catch (MalformedXMLResourceException e) {
logger.error("Invalid resource ", e);
responseWrappers[i].setResponse(AddDocumentResponseWrapperResponse.value2);
continue;
} catch (XMLStorageNotAvailableException e) {
logger.error("Storage not available ", e);
responseWrappers[i].setResponse(AddDocumentResponseWrapperResponse.value3);
continue;
}
}
AddDocumentsResponse r = new AddDocumentsResponse();
r.setAddDocumentResponseWrapper(responseWrappers);
return r;
}
/**
* Implementation of CollectionAccess::RemoveDocuments
*
* @param removeDocumentsRequest
* @return
* @throws RemoteException
* @throws ServiceBusyFaultType
* @throws InvalidResourceNameFaultType
* @throws InvalidCollectionNameFaultType
*/
public RemoveDocumentsResponse removeDocuments(RemoveDocumentsRequest removeDocumentsRequest)
throws RemoteException, ServiceBusyFaultType, InvalidResourceNameFaultType, InvalidCollectionNameFaultType {
RemoveDocumentsResponse response = new RemoveDocumentsResponse();
RemoveDocumentRequestWrapper[] docs = removeDocumentsRequest.getRemoveDocumentRequestWrapper();
RemoveDocumentResponseWrapper[] responseWrappers = new RemoveDocumentResponseWrapper[docs.length];
//response wrapper values
//v1 = Success
//v2 = DocumentNotRemoved-NotAuthorized
//v3 = documentDoesNotExist
for(int i=0;i<docs.length;i++) {
String resourceName = docs[i].getDocumentName();
logger.info("Removing resource " + resourceName + " from " + removeDocumentsRequest.getCollectionName().getPath());
responseWrappers[i] = new RemoveDocumentResponseWrapper();
responseWrappers[i].setDocumentName(resourceName);
try {
BaseDAIXResource resource = new BaseDAIXResource(resourceName);
resource.setCollectionName(removeDocumentsRequest.getCollectionName().getPath());
GCUBEXMLResource xmlResource = new GCUBEXMLResource(resource);
if ( ! State.getDataManager().checkResource(xmlResource) ) {
responseWrappers[i].setResponse(RemoveDocumentResponseWrapperResponse.value3);
continue;
}
State.getDataManager().deleteResource(xmlResource);
logger.info("Resource "+ xmlResource.getResourceName() +" successfully removed");
responseWrappers[i].setResponse(RemoveDocumentResponseWrapperResponse.value1);
} catch ( Exception e ) {
logger.error("Unable to remove the resource: " + e);
responseWrappers[i].setResponse(RemoveDocumentResponseWrapperResponse.value2);
continue;
}
}
response.setRemoveDocumentResponseWrapper(responseWrappers);
return response;
}
/**
* Implementation of CollectionAccess::createSubCollection
*
* @param createSubcollectionRequest
* DataResourceAbstractName the abstract name of the data resource to which the message is directed.
CollectionName an OPTIONAL parameter that contains the URI of the collection to which the subcollection will be added. If no collection name is provided the top level collection is assumed.
SubcollectionName the URI of the new subcollection.
* @return the response always indicates success. In error conditions a fault is returned
* @throws RemoteException a generic exception not included in any fault
* @throws CollectionAlreadyExistsFaultType The subcollection name specified already exists in the collection specified.
* @throws ServiceBusyFaultType the service is already processing a request and ConcurrentAccess is false.
* @throws InvalidResourceNameFaultType the supplied resource name is not known to the service.
* @throws InvalidCollectionNameFaultType the supplied collection name is not known to the XML resource.
* @throws NotAuthorizedFaultType the consumer is not authorized to perform this operation at this time.
* @throws DataResourceUnavailableFaultType the specified data resource is unavailable.
*
*/
public CreateSubcollectionResponse createSubcollection(CreateSubcollectionRequest createSubcollectionRequest)
throws RemoteException, CollectionAlreadyExistsFaultType, ServiceBusyFaultType, InvalidResourceNameFaultType,
InvalidCollectionNameFaultType, NotAuthorizedFaultType, DataResourceUnavailableFaultType {
throw new NotAuthorizedFaultType();
}
/**
* Implementation of CollectionAccess::removeSubcollection
*
* @param removeSubcollectionRequest
* @return the response always indicates success. In error conditions a fault is returned.
* @throws RemoteException a generic exception not included in any fault
* @throws ServiceBusyFaultType the service is already processing a request and ConcurrentAccess is false.
* @throws InvalidResourceNameFaultType the supplied resource name is not known to the service.
* @throws InvalidCollectionNameFaultType the supplied collection name is not known to the XML resource.
* @throws NotAuthorizedFaultType the consumer is not authorized to perform this operation at this time.
* @throws DataResourceUnavailableFaultType the specified data resource is unavailable.
*/
public RemoveSubcollectionResponse removeSubcollection(RemoveSubcollectionRequest removeSubcollectionRequest)
throws RemoteException, ServiceBusyFaultType, InvalidResourceNameFaultType, InvalidCollectionNameFaultType, NotAuthorizedFaultType, DataResourceUnavailableFaultType {
throw new NotAuthorizedFaultType();
}
/**
* Implementation of CollectionAccess::addSchema
*
* @param addSchemaRequest
* @return
* @throws SchemaInvalidFaultType
* @throws DataResourceUnavailableFaultType
* @throws ServiceBusyFaultType
* @throws SchemaAdditionMakesDocumentsInvalidFaultType
* @throws InvalidResourceNameFaultType
* @throws InvalidCollectionNameFaultType
* @throws SchemaAlreadyExistsFaultType
* @throws NotAuthorizedFaultType
*/
public AddSchemaResponse addSchema(AddSchemaRequest addSchemaRequest)
throws SchemaInvalidFaultType, DataResourceUnavailableFaultType,
ServiceBusyFaultType, SchemaAdditionMakesDocumentsInvalidFaultType, InvalidResourceNameFaultType,
InvalidCollectionNameFaultType, SchemaAlreadyExistsFaultType, NotAuthorizedFaultType {
throw new NotAuthorizedFaultType();
}
/**
* Implementation of CollectionAccess::removeSchema
*
* @param getSchemaRequest
* @return
* @throws DataResourceUnavailableFaultType
* @throws ServiceBusyFaultType
* @throws SchemaDoesNotExistFaultType
* @throws InvalidResourceNameFaultType
* @throws InvalidCollectionNameFaultType
* @throws NotAuthorizedFaultType
*/
public GetSchemaResponse getSchema (GetSchemaRequest getSchemaRequest)
throws DataResourceUnavailableFaultType, ServiceBusyFaultType, SchemaDoesNotExistFaultType,
InvalidResourceNameFaultType, InvalidCollectionNameFaultType, NotAuthorizedFaultType{
throw new NotAuthorizedFaultType();
}
/**
* Implementation of CollectionAccess::getSchema
* @param removeSchemaRequest
* @return
* @throws DataResourceUnavailableFaultType
* @throws ServiceBusyFaultType
* @throws SchemaRemovalMakesDocumentsInvalidFaultType
* @throws SchemaDoesNotExistFaultType
* @throws InvalidResourceNameFaultType
* @throws SchemaRemovalMakesSchemaInvalidFaultType
* @throws InvalidCollectionNameFaultType
* @throws NotAuthorizedFaultType
*/
public RemoveSchemaResponse removeSchema (RemoveSchemaRequest removeSchemaRequest)
throws DataResourceUnavailableFaultType, ServiceBusyFaultType,
SchemaRemovalMakesDocumentsInvalidFaultType, SchemaDoesNotExistFaultType,
InvalidResourceNameFaultType, SchemaRemovalMakesSchemaInvalidFaultType,
InvalidCollectionNameFaultType, NotAuthorizedFaultType {
throw new NotAuthorizedFaultType();
}
/**
* Implementation of CollectionAccess::getCollectionPropertyDocument
* @param request
* @return
* @throws DataResourceUnavailableFaultType
* @throws ServiceBusyFaultType
* @throws InvalidResourceNameFaultType
* @throws NotAuthorizedFaultType
*/
public XMLCollectionPropertyDocumentType getCollectionPropertyDocument(GetDataResourcePropertyDocumentRequest request)
throws DataResourceUnavailableFaultType, ServiceBusyFaultType, InvalidResourceNameFaultType, NotAuthorizedFaultType {
throw new NotAuthorizedFaultType();
}
/** {@inheritDoc} */
@Override
protected GCUBEServiceContext getServiceContext() {
return ICServiceContext.getContext();
}
}

View File

@ -0,0 +1,173 @@
package org.gcube.informationsystem.collector.impl.resources;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URI;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
/**
*
* Encapsulates a WS-DAIX data resource which represents a
* collection or document in an XML database.
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class BaseDAIXResource implements DAIXResource {
protected String resourceName;
protected URI resourceURI;
protected String collectionName;
protected Document data = null;
protected String dataAsString = null;
protected final String rootElement = "Data";
protected static GCUBELog logger = new GCUBELog(BaseDAIXResource.class);
public BaseDAIXResource() {}
public BaseDAIXResource(String resourceName) {
this.resourceName = resourceName;
}
/**
* @return the resource name
*/
public String getResourceName() {
return resourceName;
}
/**
* @param resourceName the resourceName to set
*/
public void setResourceName(final String resourceName) {
this.resourceName = resourceName;
}
/**
* @return the resourceURI
*/
public URI getResourceURI() {
return resourceURI;
}
/**
* @param resourceURI the resourceURI to set
*/
public void setResourceURI(final URI resourceURI) {
this.resourceURI = resourceURI;
}
/**
* @return the name of the collection including the resource
* @throws MalformedResourceException
*/
public String getCollectionName() throws MalformedResourceException {
return collectionName;
}
/**
* @param collectionName the name of the collection including the resource
*/
public void setCollectionName(String collectionName) {
this.collectionName = collectionName;
}
public Document getContent() throws MalformedResourceException {
if (this.data != null) {
return this.data;
} else if (this.dataAsString.compareToIgnoreCase("") != 0) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(this.dataAsString);
InputSource source = new InputSource(reader);
return builder.parse(source);
} catch (Exception e) {
throw new MalformedResourceException(e);
}
}
throw new MalformedResourceException("content is null");
}
public void setContent(Document content) throws MalformedResourceException {
this.data = content;
}
public void setContent(String content) throws MalformedResourceException {
this.dataAsString = content;
}
public String toString() {
if (this.dataAsString != null)
return this.dataAsString;
try {
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
StringWriter buffer = new StringWriter();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.transform(new DOMSource(this.data), new StreamResult(buffer));
return buffer.toString();
} catch (TransformerConfigurationException e) {
logger.error("Unable to deserialise content data", e);
} catch (TransformerException e) {
logger.error("Unable to deserialise content data", e);
}
return "invalid resource";
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
BaseDAIXResource other = (BaseDAIXResource) obj;
if (resourceName == null) {
if (other.resourceName != null)
return false;
} else if (!resourceName.equals(other.resourceName))
return false;
return true;
}
}

View File

@ -0,0 +1,52 @@
package org.gcube.informationsystem.collector.impl.resources;
import java.net.URI;
import org.w3c.dom.Document;
/**
*
* Interface for DAIXResouces' behavior
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public interface DAIXResource {
public void setResourceName(String resourceName);
public String getResourceName() throws MalformedResourceException;
public URI getResourceURI();
public String toString();
public void setCollectionName(String collectionName);
public String getCollectionName() throws MalformedResourceException;
public void setContent(Document content) throws MalformedResourceException;
public void setContent(String content) throws MalformedResourceException;
public Document getContent() throws MalformedResourceException;
public boolean equals(Object obj);
public int hashCode();
/**
*
* Malformed resource exception
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public static class MalformedResourceException extends Exception {
private static final long serialVersionUID = 1L;
public MalformedResourceException(Exception e) {super(e);}
public MalformedResourceException(String message) {super(message);}
}
}

View File

@ -0,0 +1,43 @@
package org.gcube.informationsystem.collector.impl.resources;
import org.w3c.dom.Document;
public class GCUBEInstanceStateResource extends BaseDAIXResource {
protected static final String PROPERTIES_COLLECTION_NAME = "Properties";
/**
* @return the name of the collection including the resource
*/
public String getCollectionName() {
return PROPERTIES_COLLECTION_NAME;
}
/**
* @param collectionName the name of the collection including the resource
*/
public void setCollectionName(String collectionName) {
// cannot change the collection name
}
/* (non-Javadoc)
* @see org.gcube.informationsystem.collector.impl.resources.BaseDAIXResource#setContent(org.w3c.dom.Document)
*/
@Override
public void setContent(Document content) throws MalformedResourceException {
//Instance state are not well-formed XML, they are a flat list of Elements, cannot set the content as document
throw new MalformedResourceException("cannot set the content as document");
}
/* (non-Javadoc)
* @see org.gcube.informationsystem.collector.impl.resources.BaseDAIXResource#getContent()
*/
@Override
public Document getContent() throws MalformedResourceException {
throw new MalformedResourceException("cannot get the content as document");
}
}

View File

@ -0,0 +1,58 @@
package org.gcube.informationsystem.collector.impl.resources;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
public class GCUBEProfileResource extends BaseDAIXResource {
protected static String PROFILES_COLLECTION_NAME = "Profiles";
private String cachedSubtype;
/**
* @return the name of the collection including the resource
* @throws MalformedResourceException
*/
public String getCollectionName() throws MalformedResourceException {
return PROFILES_COLLECTION_NAME + "/" + this.getSubtype();
}
/**
* @param collectionName the name of the collection including the resource
*/
public void setCollectionName(String collectionName) {
// cannot change the collection name
}
/**
* @param type the resource type (if not set, it's extracted from the content, if any)
*/
public void setResourceType(String type) {
cachedSubtype = type;
}
/**
* Accesses the subtype to which the resource is related to (if any)
*
* @return the subtype or an empty string if the resource does not contain a subtype
* @throws MalformedResourceException
*/
private String getSubtype() throws MalformedResourceException {
String subtype = "";
try {
// gets the type
XPath path = XPathFactory.newInstance().newXPath();
subtype = path.evaluate("/Resource/Type", this.getContent());
} catch (Exception e) {
logger.warn("Unable to extract the profile type from the resource");
if (cachedSubtype != null)
return cachedSubtype;
throw new MalformedResourceException("Unable to extract the profile type from the resource " + e.getMessage());
}
return subtype;
}
}

View File

@ -0,0 +1,446 @@
package org.gcube.informationsystem.collector.impl.resources;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.resources.DAIXResource.MalformedResourceException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
/**
*
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class GCUBEXMLResource {
/**
* the resource type states if the resource contains a profile or generic WS-ResourceProperties
*/
public enum RESOURCETYPE {
Profile, Properties
}
protected RESOURCETYPE type = null;
protected static GCUBELog logger = new GCUBELog(GCUBEXMLResource.class);
protected Calendar terminationTime = null, lastUpdateTime = null;
protected String entryKey, groupKey, source, sourceKey = "", completeSourceKey = "";
// xpath factory to evaluate Xpath expressions
private XPath path = XPathFactory.newInstance().newXPath();
private DAIXResource resource;
public GCUBEXMLResource(DAIXResource resource) throws MalformedXMLResourceException {
this.resource = resource;
this.terminationTime = new GregorianCalendar();
this.terminationTime.setTimeZone(TimeZone.getTimeZone("GMT"));
this.lastUpdateTime = new GregorianCalendar();
this.lastUpdateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
try {
if (resource.getResourceName() == null)
throw new MalformedXMLResourceException("Invalid resource name");
} catch (MalformedResourceException e) {
throw new MalformedXMLResourceException("Invalid resource name");
}
}
/**
* @return the name of the collection including the resource
* @throws MalformedResourceException
*/
public String getCollectionName() throws MalformedXMLResourceException {
try {
return this.resource.getCollectionName();
} catch (MalformedResourceException e) {
throw new MalformedXMLResourceException(e);
}
}
/**
* @return the resource name
* @throws MalformedResourceException
*/
public String getResourceName() throws MalformedXMLResourceException {
try {
return this.resource.getResourceName();
} catch (MalformedResourceException e) {
throw new MalformedXMLResourceException(e);
}
}
/**
* @return the terminationTime of this resource
*/
public Calendar getTerminationTime() {
return this.terminationTime;
}
/**
* @return the lastUpdateTime of this resource
*/
public Calendar getLastUpdateTime() {
return this.lastUpdateTime;
}
/**
* @param terminationTime
* the terminationTime to set
*/
public void setTerminationTime(final Calendar terminationTime) {
this.terminationTime = (Calendar) terminationTime.clone();
this.terminationTime.setTimeZone(TimeZone.getTimeZone("GMT"));
}
/**
* @return the lastUpdateTime in milliseconds
* @throws Exception
* if an error occurs when accessing the LastUpdateMs field
*/
public long getLastUpdateTimeinMills() throws MalformedResourceException {
if (lastUpdateTime != null)
return lastUpdateTime.getTimeInMillis();
else
throw new MalformedResourceException("unable to retrieve last update time for resource " + this.resource.getResourceName());
}
/**
* Accesses the source GroupKey
*
* @return the ID
*/
public String getGroupKey() {
return this.groupKey;
}
/**
* Sets the source GroupKey
*
* @param groupKey
* the new group key
*
*/
public void setGroupKey(String groupKey) {
this.groupKey = groupKey;
}
/**
* Accesses the source EntryKey
*
* @return the ID
*/
public String getEntryKey() {
return this.entryKey;
}
/**
* Sets the source EntryKey
*
* @param entryKey
* the new entry key
*/
public void setEntryKey(String entryKey) {
this.entryKey = entryKey;
}
/**
* Sets the source address of the RI that publishes resource as reported in the servicegroup
* entry
*
* @param source
* the new source address
*/
public void setSource(String source) {
this.source = source;
}
/**
* Accesses the source address of the service that published the data
*
* @return the source
*/
public String getSource() {
return this.source;
}
/**
* Sets the key of the WS-Resource that published the data
*
* @param key
* the new source key
*/
public void setSourceKey(String key) {
this.sourceKey = key;
}
/**
* Gets the key of the WS-Resource that published the data
*
* @return the key
*/
public String getSourceKey() {
return this.sourceKey;
}
/**
* Sets the complete source key
*
* @param completeKey
* the new complete key
*/
public void setCompleteSourceKey(String completeKey) {
this.completeSourceKey = completeKey;
}
/**
* Gets the complete source key
*
* @return the complete source key
/*
if ((lastUpdateTime == null) && (this.resource.getContent() != null)) {
String value = "";
try {
value = path.evaluate("Document/LastUpdateMs", this.resource.getContent());
} catch (XPathExpressionException xpee) {
logger.error("" + xpee.getMessage());
logger.error("" + xpee.getStackTrace());
throw new MalformedResourceException("XPath evaluation error");
}
try {
return Long.parseLong(value);
} catch (NumberFormatException nfe) {
logger.error("Invalid last update time format found in resource " + this.resource.getContent());
logger.error("Parsed string was " + value);
throw new MalformedResourceException("Unable to retrieve last update time for resource " + this.resource.getContent());
}
} else
throw new MalformedResourceException("unable to retrieve last update time for resource " + this.resource.getResourceName());
*/
public String getCompleteSourceKey() {
return this.completeSourceKey;
}
public void setContent(String content, boolean... enveloped) {
try {
if (enveloped != null && enveloped.length > 0 && enveloped[0]) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(content);
InputSource source = new InputSource(reader);
Document doc = builder.parse(source);
this.parseEnvelop(doc);
resource.setContent(this.removeEnvelop(doc));
}
else
resource.setContent(content);
} catch (Exception e) {
}
}
/**
* Extract the resource informantion from the envelop
* @param doc the enveloped content
* @throws MalformedXMLResourceException
*/
private void parseEnvelop(Document doc) throws MalformedXMLResourceException {
String value = "";
try {
value = path.evaluate("Document/LastUpdateMs", doc);
this.lastUpdateTime.setTimeInMillis(Long.parseLong(value));
value = path.evaluate("Document/TerminationTime", doc);
this.terminationTime.setTimeInMillis(Long.parseLong(value));
value = path.evaluate("Document/Source", doc);
this.setSource(value);
value = path.evaluate("Document/SourceKey", doc);
this.setCompleteSourceKey(value);
value = path.evaluate("Document/EntryKey", doc);
this.setEntryKey(value);
value = path.evaluate("Document/GroupKey", doc);
this.setGroupKey(value);
} catch (Exception xpee) {
logger.error("" + xpee.getMessage());
logger.error("" + xpee.getStackTrace());
throw new MalformedXMLResourceException("Unable to retrieve last update time for resource");
}
}
public String toString() {
// we do not use an XML parser for performance reasons
StringBuilder resource = new StringBuilder("<Document>\n");
try {
resource.append("<ID>" + this.resource.getResourceName() + "</ID>\n");
resource.append("<Source>" + this.getSource() + "</Source>\n");
resource.append("<SourceKey>" + this.getSourceKey() + "</SourceKey>\n");
resource.append("<CompleteSourceKey>" + this.getCompleteSourceKey() + "</CompleteSourceKey>\n");
resource.append("<EntryKey>" + this.getEntryKey() + "</EntryKey>\n");
resource.append("<GroupKey>" + this.getGroupKey() + "</GroupKey>\n");
resource.append("<TerminationTime>" + this.getTerminationTime().getTimeInMillis() + "</TerminationTime>\n");
resource.append("<TerminationTimeHuman>" + this.getTerminationTime().getTime().toString() + "</TerminationTimeHuman>\n");
resource.append("<LastUpdateMs>" + this.lastUpdateTime.getTimeInMillis() + "</LastUpdateMs>\n");
resource.append("<LastUpdateHuman>" + this.lastUpdateTime.getTime().toString() + "</LastUpdateHuman>\n");
resource.append("<Data>\n");
resource.append(this.resource.toString() + "\n");
resource.append("</Data>\n");
resource.append("</Document>\n");
} catch (MalformedResourceException e) {
logger.error("invalid content", e);
}
return resource.toString();
}
/**
* Removes the document envelop from the document
*
* @param doc the content to clean up
* @return the content string without the document envelop
* @throws MalformedResourceException
*/
private String removeEnvelop(Document doc) throws MalformedXMLResourceException {
try {
return this.toStringFromElement(doc, "Data"); // Data/*
} catch (Exception e) {
logger.error("unable to retrieve parse the resource's content ", e);
}
throw new MalformedXMLResourceException("unable to retrieve parse the resource's content");
}
/**
* Returns a sub-serialization of the given XML, starting from the element name
*
* @param xml
* the source XML serialization
* @param elementName
* the name of the element
* @return the node content serialized as string
* @throws Exception
* if the serialization fails
*/
private String toStringFromElement(String xml, String elementName) throws MalformedXMLResourceException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(xml);
InputSource source = new InputSource(reader);
return toStringFromElement(builder.parse(source), elementName);
} catch (Exception e) {
logger.error("Unable to deserialise content data", e);
throw new MalformedXMLResourceException("Unable to deserialise the resource");
}
}
/**
* Returns a sub-serialization of the given XML, starting from the element name
*
* @param xml
* the source XML serialization
* @param elementName
* the name of the element
* @return the node content serialized as string
* @throws Exception
* if the serialization fails
*/
private String toStringFromElement(Document xml, String elementName) throws MalformedXMLResourceException {
try {
Node targetNode = xml.getElementsByTagName(elementName).item(0);
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
StringBuilder ret = new StringBuilder();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
int index = 0;
Node node = targetNode.getChildNodes().item(index);
while (node != null) {
StringWriter buffer = new StringWriter();
transformer.transform(new DOMSource(node), new StreamResult(buffer));
ret.append(buffer.toString().trim());
node = targetNode.getChildNodes().item(index++);
}
return ret.toString();
} catch (Exception e) {
logger.error("Unable to deserialise content data", e);
throw new MalformedXMLResourceException("Unable to deserialise the resource");
}
}
/**
*
* Malformed XML resource exception
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public static class MalformedXMLResourceException extends Exception {
private static final long serialVersionUID = 1L;
public MalformedXMLResourceException(Exception e) {
super(e);
}
public MalformedXMLResourceException(String message) {
super(message);
}
}
/**
* Gets the wrapped {@link BaseDAIXResource}'s content
* @return
* @throws MalformedXMLResourceException
*/
public Document getContent() throws MalformedXMLResourceException {
try {
try {
return resource.getContent();
} catch (Exception e) {
//try to wrap with a root element
StringBuilder resource = new StringBuilder("<Data>\n");
resource.append(this.resource.toString() + "\n");
resource.append("</Data>\n");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(resource.toString());
InputSource source = new InputSource(reader);
return builder.parse(source);
}
} catch (Exception e) {
logger.error("Invalid data", e);
throw new MalformedXMLResourceException("Invalid data");
}
}
}

View File

@ -1,16 +1,15 @@
package org.gcube.informationsystem.collector.impl.state;
import java.util.Calendar;
import javax.xml.namespace.QName;
import org.apache.axis.encoding.AnyContentType;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.persistence.AggregatorPersistentResource;
import org.gcube.informationsystem.collector.impl.state.AggregatorRegisteredResource;
import org.gcube.informationsystem.collector.impl.utils.*;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.porttypes.XMLCollectionAccess;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.globus.mds.aggregator.impl.AggregatorServiceGroupResource;
import org.globus.mds.aggregator.impl.AggregatorServiceGroupEntryResource;
import org.globus.mds.aggregator.impl.AggregatorSource;
@ -51,13 +50,15 @@ public class AggregatorRegisteredResource extends AggregatorServiceGroupResource
private TopicList topicList;
// private String baseDir;
public static final QName RP_SET = new QName(
"http://gcube-system.org/namespaces/informationsystem/collector/XMLCollectionAccess",
"ICRP");
/**
* Builds a new resource
*/
public AggregatorRegisteredResource() {
super.init(XMLCollectionAccess.RP_SET);
super.init(RP_SET);
// this.baseDir = getBaseDirectory();
this.propSet = this.getResourcePropertySet();
@ -189,12 +190,13 @@ public class AggregatorRegisteredResource extends AggregatorServiceGroupResource
// Build the new resource to store
logger.debug("Storing the new delivered resource");
AggregatorPersistentResource res = new AggregatorPersistentResource(entryparser.getSourceURI(), entryparser.getSourceKey(), aentry.getEntryAsString(), entryparser.getType());
res.setData(aentry.getEntryAsString());
GCUBEInstanceStateResource instanceState = new GCUBEInstanceStateResource();
instanceState.setResourceName(Identifier.buildInstanceStateID(entryparser));
instanceState.setContent(aentry.getEntryAsString());
GCUBEXMLResource res = new GCUBEXMLResource(instanceState);
res.setEntryKey(sinkparser.getEntryKey());
res.setGroupKey(sinkparser.getGroupKey());
res.setTerminationTime(entry.getTerminationTime());
//res.setType(entryparser.getType());
res.setSource(entryparser.getSourceURI());
res.setSourceKey(entryparser.getSourceKey());
logger.debug("Qualified Source Key: " + entryparser.getQualifiedSourceKey());
@ -204,7 +206,7 @@ public class AggregatorRegisteredResource extends AggregatorServiceGroupResource
synchronized (State.deletedResources) {
if (State.deletedResources.contains(res)) {
State.deletedResources.remove(res);
throw new Exception("the resource " + res.getID() + " is no longer available");
throw new Exception("the resource " + res.getResourceName() + " is no longer available");
}
}
logger.trace("Resource: " + res.toString());

View File

@ -1,11 +1,12 @@
package org.gcube.informationsystem.collector.impl.state;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.persistence.AggregatorPersistentResource;
import org.gcube.informationsystem.collector.impl.persistence.PersistentResource.RESOURCETYPE;
import org.gcube.informationsystem.collector.impl.utils.EntryEPRParser;
import org.gcube.informationsystem.collector.impl.utils.EntryParser;
import org.gcube.informationsystem.collector.impl.utils.Identifier;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.globus.mds.aggregator.impl.AggregatorServiceGroupEntryRemovedCallback;
import org.globus.mds.aggregator.impl.AggregatorServiceGroupEntryResource;
@ -45,7 +46,9 @@ public class ICAggregatorRemoveCallback implements AggregatorServiceGroupEntryRe
logger.debug("Aggregator Sink " + eparser.getSink());
EntryEPRParser parser = eparser.getEPRSinkParser();
AggregatorPersistentResource res = new AggregatorPersistentResource(eparser.getSourceURI(), eparser.getSourceKey(), "", RESOURCETYPE.Properties);
GCUBEInstanceStateResource instancestate = new GCUBEInstanceStateResource();
instancestate.setResourceName(Identifier.buildInstanceStateID(eparser));
GCUBEXMLResource res = new GCUBEXMLResource(instancestate);
res.setEntryKey(parser.getEntryKey());
res.setGroupKey(parser.getGroupKey());
res.setSourceKey(eparser.getSourceKey());
@ -60,7 +63,7 @@ public class ICAggregatorRemoveCallback implements AggregatorServiceGroupEntryRe
try {
//State.getDataManager().retrieveAndDeleteResourceFromID(res.getID());
} catch (Exception e) {
logger.error("Unable to remove resource: " + res.getID(), e);
logger.error("Unable to remove resource: " + res.getResourceName(), e);
}
}

View File

@ -5,7 +5,6 @@ import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.message.addressing.ReferencePropertiesType;
import org.globus.mds.aggregator.impl.AggregatorServiceGroupEntryResource;
import org.gcube.informationsystem.collector.impl.persistence.PersistentResource.RESOURCETYPE;
/**
* Parser for {@link AggregatorServiceGroupEntryResource}
@ -88,7 +87,7 @@ public class EntryParser {
*
* @return the {@link RESOURCETYPE}
*/
public RESOURCETYPE getType() {
/* public RESOURCETYPE getType() {
EndpointReferenceType memberEpr = entry.getMemberEPR();
if (memberEpr.getAddress().toString().endsWith(registryNS)) {
return RESOURCETYPE.Profile;
@ -96,7 +95,7 @@ public class EntryParser {
return RESOURCETYPE.Properties;
}
}
*/
public void getRPSet() {
// get RP set from entry
// ResourcePropertySet rpSet = entry.getResourcePropertySet();

View File

@ -0,0 +1,30 @@
package org.gcube.informationsystem.collector.impl.utils;
/**
*
* Build instance state identifiers
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class Identifier {
/**
* Builds an instance state identifier
* @param parser the parser of the source entry
* @return the identifier
*/
public static String buildInstanceStateID(EntryParser parser) {
return buildInstanceStateID(parser.getSourceURI(),parser.getSourceKey());
}
/**
* Builds an instance state identifier
* @param source the URI of the publisher
* @param id the id related to the piece of state to identify
* @return the identifier
*/
public static String buildInstanceStateID(String source, String id) {
return source.replace("http://", "").replace(":", "").replace("/", "-") + "-" + id.replace("http://", "").replace(":", "").replace("/", "-");
}
}

View File

@ -0,0 +1,53 @@
package org.gcube.informationsystem.collector.impl.utils;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.w3c.dom.Document;
/**
*
* Reader for resource's metadata
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class MetadataReader {
private Document metadata;
public MetadataReader(Document metadata) {
this.metadata = metadata;
}
public String getType(){
return this.metadata.getElementsByTagName("Type").item(0).getTextContent();
}
public String getSource() {
return this.metadata.getElementsByTagName("Source").item(0).getTextContent();
}
public Calendar getTerminationTime() {
//value is in seconds
String value = this.metadata.getElementsByTagName("TerminationTime").item(0).getTextContent();
Calendar now = new GregorianCalendar();
now.setTimeZone(TimeZone.getTimeZone("GMT"));
//add seconds to obtain the effective termination time
now.add(Calendar.SECOND, Integer.valueOf(value));
return now;
}
public String getGroupKey() {
return this.metadata.getElementsByTagName("GroupKey").item(0).getTextContent();
}
public String getEntryKey() {
return this.metadata.getElementsByTagName("EntryKey").item(0).getTextContent();
}
public String getKey() {
return this.metadata.getElementsByTagName("Key").item(0).getTextContent();
}
}

View File

@ -24,12 +24,10 @@ import java.lang.Exception;
/**
*
* @author manuele simi
*
* @version 1.0 June 2006
*
* @link http://www.diligentproject.org
*
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class MsgParser {
@ -100,7 +98,7 @@ public class MsgParser {
logger.warn("The entry does not have a ResourceType");
throw new Exception("Invalid resource (type = Properties)");
}
return this.getDILIGENTProperty("DILIGENTResourceType");
return this.getGCUBEProperty("DILIGENTResourceType");
}
/**
@ -112,7 +110,7 @@ public class MsgParser {
*/
public String getVOName() throws Exception {
return this.getDILIGENTProperty("VO");
return this.getGCUBEProperty("VO");
}
/**
@ -124,7 +122,7 @@ public class MsgParser {
*/
public String getServiceName() throws Exception {
return this.getDILIGENTProperty("ServiceName");
return this.getGCUBEProperty("ServiceName");
}
/**
@ -136,7 +134,7 @@ public class MsgParser {
*/
public String getServiceClass() throws Exception {
return this.getDILIGENTProperty("ServiceClass");
return this.getGCUBEProperty("ServiceClass");
}
/**
@ -148,7 +146,7 @@ public class MsgParser {
*/
public String getRunningInstanceID() throws Exception {
return this.getDILIGENTProperty("RunningInstanceID");
return this.getGCUBEProperty("RunningInstanceID");
}
/**
@ -160,7 +158,7 @@ public class MsgParser {
*/
public String getServiceID() throws Exception {
return this.getDILIGENTProperty("ServiceID");
return this.getGCUBEProperty("ServiceID");
}
/**
@ -172,17 +170,17 @@ public class MsgParser {
*/
public String getDHNID() throws Exception {
return this.getDILIGENTProperty("GHN");
return this.getGCUBEProperty("GHN");
}
/**
* Extracts a given DILIGENT Property
*
* @throws Exception
* Reads a GCUBE Property
*
* @return the property value
* @throws Exception if the reading fails
*
*/
private String getDILIGENTProperty(String propName) throws Exception {
private String getGCUBEProperty(String propName) throws Exception {
String value = null;
@ -203,9 +201,7 @@ public class MsgParser {
* @return the XML string
*/
public String getEntryAsString() {
return "<" + rootElement + ">\n" + this.originalMsgString + "</"
+ rootElement + ">\n";
// return XMLUtils.DocumentToString(this.internalDOM);
return this.originalMsgString ;
}
/**

View File

@ -8,6 +8,7 @@ import org.exist.storage.ConsistencyCheckTask;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.xmlstorage.backup.BackupsRootFolder;
import org.gcube.informationsystem.collector.impl.xmlstorage.backup.Scheduler;
@ -17,7 +18,7 @@ import org.gcube.informationsystem.collector.impl.xmlstorage.backup.Scheduler;
* @author Manuele Simi (ISTI-CNR)
*
*/
public class DataManager extends XMLStorageManager {
public class DataManager extends XMLStorage {
private final static GCUBELog logger = new GCUBELog(DataManager.class);
@ -75,7 +76,7 @@ public class DataManager extends XMLStorageManager {
if (Boolean.valueOf((String) ICServiceContext.getContext().getProperty("deleteRPsOnStartup", true))) {
// cleanup the RPs collection
logger.info("deleting all RPs...");
this.deleteAllProperties();
this.deleteAllResourcesFromCollection(new GCUBEInstanceStateResource().getCollectionName());
}
logger.info("Restore completed");
} catch (Exception e1) {

View File

@ -12,7 +12,7 @@ import org.gcube.common.core.utils.logging.GCUBELog;
* @author Manuele Simi (ISTI-CNR)
*
*/
public class QueryManager extends XMLStorageManager {
public class QueryManager extends XMLStorage {
private final static GCUBELog logger = new GCUBELog(QueryManager.class);

View File

@ -2,8 +2,9 @@ package org.gcube.informationsystem.collector.impl.xmlstorage.exist;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
import org.gcube.informationsystem.collector.impl.persistence.AggregatorPersistentResource;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorageManager.STATUS;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import java.util.ArrayList;
import java.util.Enumeration;
@ -38,7 +39,7 @@ public class State {
* List of recently deleted resources. It is used to avoid the storage of RPs of a deleted
* resource
*/
public static List<AggregatorPersistentResource> deletedResources = Collections.synchronizedList(new ArrayList<AggregatorPersistentResource>());
public static List<GCUBEXMLResource> deletedResources = Collections.synchronizedList(new ArrayList<GCUBEXMLResource>());
private static GCUBELog logger = new GCUBELog(State.class);
@ -52,12 +53,13 @@ public class State {
*/
public static void initialize() throws Exception {
logger.info("Starting IC service initialization...");
State.initializeDataManager();
State.initializeQueryManager();
long maxOperations = Long.valueOf((String) ICServiceContext.getContext().getProperty("maxOperationsPerConnection", true));
State.initializeDataManager(maxOperations);
State.initializeQueryManager(maxOperations);
if (Boolean.valueOf((String) ICServiceContext.getContext().getProperty("deleteRPsOnStartup", true))) {
// cleanup the RPs collection
logger.info("Deleting all RPs...");
State.dataManager.deleteAllProperties();
State.dataManager.deleteAllResourcesFromCollection(new GCUBEInstanceStateResource().getCollectionName());
} else {
logger.info("All RPs previously stored are kept in the storage");
}
@ -83,20 +85,20 @@ public class State {
logger.info("IC service initialization completed");
}
private static void initializeDataManager() throws Exception {
private static void initializeDataManager(long maxOperations) throws Exception {
if (State.dataManager == null)
State.dataManager = new DataManager();
if (State.dataManager.getStatus() != STATUS.INITIALISED)
dataManager.initialize();
dataManager.initialize(maxOperations);
else
logger.info("DataManager already initalized");
}
private static void initializeQueryManager() throws Exception {
private static void initializeQueryManager(long maxOperations) throws Exception {
if (State.queryManager == null)
State.queryManager = new QueryManager();
if (State.queryManager.getStatus() != STATUS.INITIALISED)
queryManager.initialize();
queryManager.initialize(maxOperations);
else
logger.info("QueryManager already initalized");
}
@ -139,7 +141,7 @@ public class State {
/**
* @return the deletedResources
*/
public static List<AggregatorPersistentResource> getDeletedResources() {
public static List<GCUBEXMLResource> getDeletedResources() {
return deletedResources;
}

View File

@ -11,13 +11,14 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.persistence.PersistentResource;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.Sweeper;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
/**
* This class provides some cleanup procedures to use to maintain a consistent
* content in the XML storage One of them is a thread, activated at RI startup
* content in the XML storage. One of them is a thread, activated at RI startup
* time, that periodically drops the out to date resources from the storage
*
* @author Manuele Simi (ISTI-CNR)
@ -31,7 +32,7 @@ public class Sweeper implements Runnable {
private static GCUBELog logger = new GCUBELog(Sweeper.class);
//private static XMLStorageManager storage = null;
//private static XMLStorage storage = null;
/**
* Initializes a new Sweeper
@ -73,15 +74,19 @@ public class Sweeper implements Runnable {
Calendar now = new GregorianCalendar();
now.setTimeZone(TimeZone.getTimeZone("GMT"));
try {
String[] ids = State.getDataManager().listAllPropertiesIDs();
GCUBEInstanceStateResource fakeresource = new GCUBEInstanceStateResource();
//get all IDs for Instance States' collection
String[] ids = State.getDataManager().listAllCollectionResourceIDs(fakeresource.getCollectionName());
for (String id : ids) {
try {
PersistentResource res = State.getDataManager().retrievePropertyResourceFromID(id);
if (now.getTimeInMillis() - res.getLastUpdateTimeinMills() > Sweeper.resourceExpirationTime)
GCUBEInstanceStateResource tempresource = new GCUBEInstanceStateResource();
tempresource.setResourceName(id);
GCUBEXMLResource xmlresource = new GCUBEXMLResource(tempresource);
State.getDataManager().retrieveResourceContent(new GCUBEXMLResource(tempresource));
if (now.getTimeInMillis() - xmlresource.getLastUpdateTimeinMills() > Sweeper.resourceExpirationTime)
// removes the resources from the database
State.getDataManager().retrieveAndDeleteResourceFromID(id);
State.getDataManager().deleteResource(xmlresource);
// break;
} catch (Exception e) {
logger.debug("IC sweeper - the resource " + id + " is no longer available in the storage");
@ -110,8 +115,8 @@ public class Sweeper implements Runnable {
*
*/
public static void cleanRPs() {
// cleanup the RPs collection
State.getDataManager().deleteAllProperties();
// cleanup the RPs collection
State.getDataManager().deleteAllResourcesFromCollection(new GCUBEInstanceStateResource().getCollectionName());
}
/**
@ -124,8 +129,8 @@ public class Sweeper implements Runnable {
Calendar now = new GregorianCalendar();
now.setTimeZone(TimeZone.getTimeZone("GMT"));
List<PersistentResource> toRemove = new ArrayList<PersistentResource>();
for (PersistentResource res : State.deletedResources) {
List<GCUBEXMLResource> toRemove = new ArrayList<GCUBEXMLResource>();
for (GCUBEXMLResource res : State.deletedResources) {
try {
if (now.getTimeInMillis() - res.getLastUpdateTimeinMills() > Sweeper.resourceExpirationTime) {
toRemove.add(res);
@ -135,7 +140,7 @@ public class Sweeper implements Runnable {
}
}// end loop on deletedResources
synchronized (State.deletedResources) {
for (PersistentResource res : toRemove) {
for (GCUBEXMLResource res : toRemove) {
State.deletedResources.remove(res);
}
}// end synch block

View File

@ -3,9 +3,7 @@ package org.gcube.informationsystem.collector.impl.xmlstorage.exist;
import org.xmldb.api.base.XMLDBException;
import org.xmldb.api.base.Collection;
import org.xmldb.api.base.Database;
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.modules.XMLResource;
import org.xmldb.api.modules.CollectionManagementService;
@ -15,11 +13,10 @@ import org.exist.storage.DBBroker;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
import org.gcube.informationsystem.collector.impl.persistence.AggregatorPersistentResource;
import org.gcube.informationsystem.collector.impl.persistence.PersistentResource;
import org.gcube.informationsystem.collector.impl.persistence.PersistentResource.MalformedResourceException;
import org.gcube.informationsystem.collector.impl.persistence.PersistentResource.RESOURCETYPE;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorageManager;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource.MalformedXMLResourceException;
import java.io.BufferedReader;
import java.io.FileReader;
@ -31,10 +28,12 @@ import java.util.concurrent.locks.ReentrantLock;
/**
* A thread safe manager to interact with the XML Storage repository.
*
* RESOURCE the type of the resource to store
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class XMLStorageManager {
public class XMLStorage {
protected static String URI = "xmldb:exist://";
@ -44,7 +43,7 @@ public class XMLStorageManager {
protected static String driver = "org.exist.xmldb.DatabaseImpl";
private static GCUBELog logger = new GCUBELog(XMLStorageManager.class);
private static GCUBELog logger = new GCUBELog(XMLStorage.class);
private Database database;
@ -52,8 +51,6 @@ public class XMLStorageManager {
protected Collection rootCollection;
private Collection profilesRootCollection;
protected Lock lock;
// lock for writing operations
@ -65,15 +62,15 @@ public class XMLStorageManager {
// flag to warn when the DB is locked
private boolean locked = false;
private static final String PROPERTIES_COLLECTION_NAME = "Properties";
//private static final String PROPERTIES_COLLECTION_NAME = "Properties";
protected static String PROFILES_COLLECTION_NAME = "Profiles";
//protected static String PROFILES_COLLECTION_NAME = "Profiles";
enum STATUS {INITIALISED, CLOSED, SHUTDOWN};
private STATUS status = STATUS.CLOSED;
protected static long maxOperationsPerConnection = 1000;
protected long maxOperationsPerConnection = 1000;
protected long operationsCounter = 0;
@ -82,21 +79,31 @@ public class XMLStorageManager {
* Creates a new manager
*
*/
public XMLStorageManager() {
logger.debug("Creating a new XMLStorageManager");
public XMLStorage() {
logger.debug("Creating a new XMLStorage");
lock = new ReentrantLock();
writeLock = lock;
readLock = lock;
}
/**
* Initializes the local XML Storage repository
* @param lock
* Initializes the local XML Storage repository
* @param lock if the storage has to be locked or not during the initalization
*
* @throws Exception
* if the connection to eXist or its initialization fail
* @throws Exception if the connection to eXist or its initialization fail
*/
public void initialize(boolean ... lock) throws XMLStorageNotAvailableException {
this.initialize(this.maxOperationsPerConnection, lock);
}
/**
* Initializes the local XML Storage repository
* @param maxOperationsPerConnection max number of operation per active connection
* @param lock if the storage has to be locked or not during the initalization
*
* @throws Exception if the connection to eXist or its initialization fail
*/
public void initialize(long maxOperationsPerConnection, boolean ... lock) throws XMLStorageNotAvailableException {
if (this.getStatus() == STATUS.INITIALISED) {
logger.warn("XMLStorage already initialized");
@ -109,7 +116,7 @@ public class XMLStorageManager {
try {
logger.info("Initializing XMLStorage...");
// this.printEnv();
maxOperationsPerConnection = Long.valueOf((String) ICServiceContext.getContext().getProperty("maxOperationsPerConnection", true));
this.maxOperationsPerConnection = maxOperationsPerConnection;//Long.valueOf((String) ICServiceContext.getContext().getProperty("maxOperationsPerConnection", true));
// register/create the DB instance
Class<?> cl = Class.forName(driver);
@ -123,21 +130,9 @@ public class XMLStorageManager {
if (this.rootCollection == null) {
logger.error("invalid root collection!");
throw new XMLStorageNotAvailableException("unable to load root collection");
}
logger.info("Initializing the Profiles collection");
this.profilesRootCollection = this.rootCollection.getChildCollection(XMLStorageManager.PROFILES_COLLECTION_NAME);
if (this.profilesRootCollection == null) {
logger.debug("Creating Profiles collection");
this.profilesRootCollection = this.createCollection(this.rootCollection, XMLStorageManager.PROFILES_COLLECTION_NAME);
logger.debug("Profiles collection created");
}
if (this.profilesRootCollection == null) {
throw new XMLStorageNotAvailableException("Unable to load/create Profiles collection");
}
}
this.rootCollection.setProperty("pretty", "true");
this.rootCollection.setProperty("encoding", "UTF-8");
this.profilesRootCollection.setProperty("pretty", "true");
this.profilesRootCollection.setProperty("encoding", "UTF-8");
this.rootCollection.setProperty("encoding", "UTF-8");
this.setStatus(STATUS.INITIALISED);
logger.info("XMLStorage initialized with success");
@ -158,6 +153,33 @@ public class XMLStorageManager {
}
/**
* Creates a collection in the XML storage. If the input includes a full path, collections are created recursively
* @param name the collection to create
* @return the created collection
* @throws XMLDBException
* @throws XMLStorageNotAvailableException
*/
public Collection createCollection(String name) throws XMLDBException, XMLStorageNotAvailableException {
logger.info("Initializing the collection " + name);
String[] subcollections = name.split("/");
Collection parent = this.rootCollection;
for (String subcollection : subcollections) {
Collection child = parent.getChildCollection(subcollection);
if (child == null) {
child = this.createCollection(parent, subcollection);
if (child == null)
throw new XMLStorageNotAvailableException("unable to create collection " + name);
else {
child.setProperty("pretty", "true");
child.setProperty("encoding", "UTF-8");
}
}
parent = child;
}
return parent;
}
/**
* Blocks all the writing operations
*/
@ -201,6 +223,10 @@ public class XMLStorageManager {
return true;
}
private Collection loadCollection(String collectionName) {
return this.loadCollection(this.rootCollection, collectionName);
}
/**
* Loads a collection. If it does not exist, the collection is created.
*
@ -253,10 +279,10 @@ public class XMLStorageManager {
*
* @return the Collection
*/
public Collection loadPropertiesCollection() {
/*public Collection loadPropertiesCollection() {
logger.debug("Loading collection Properties... ");
return this.loadCollection(this.rootCollection, XMLStorageManager.PROPERTIES_COLLECTION_NAME);
}
return this.loadCollection(this.rootCollection, XMLStorage.PROPERTIES_COLLECTION_NAME);
} */
/**
* Loads from the children of the Profile Collection, the collection identified by the given
@ -266,10 +292,10 @@ public class XMLStorageManager {
* the child collection of the Profile collection to load
* @return the Collection
*/
public Collection loadProfileCollection(String collectionName) {
/* public Collection loadProfileCollection(String collectionName) {
logger.debug("Loading collection " + collectionName + "... ");
return this.loadCollection(this.profilesRootCollection, collectionName);
}
}*/
/**
* Loads the parent collection of all collections containing resources profiles. It must be used
@ -277,10 +303,10 @@ public class XMLStorageManager {
*
* @return the Collection
*/
public Collection loadAllProfilesCollection() {
/*public Collection loadAllProfilesCollection() {
logger.debug("Loading all profiles collection... ");
return this.loadCollection(this.rootCollection, XMLStorageManager.PROFILES_COLLECTION_NAME);
}
return this.loadCollection(this.rootCollection, XMLStorage.PROFILES_COLLECTION_NAME);
}*/
/**
* Loads the root collection. It must be used when quering all the information maintained by the
@ -293,7 +319,7 @@ public class XMLStorageManager {
Collection currentCollection = null;
logger.debug("Loading all collections... ");
// return this.loadCollection(this.rootCollection,
// XMLStorageManager.PROFILES_COLLECTION_NAME);
// XMLStorage.PROFILES_COLLECTION_NAME);
try {
currentCollection = DatabaseManager.getCollection(URI + DBBroker.ROOT_COLLECTION, USER, PWD);
} catch (XMLDBException edb) {
@ -304,15 +330,16 @@ public class XMLStorageManager {
}
/**
* Stores a AggregatorPersistentResource in the current collection. If the resource already
* Stores a XMLDBDocument in the current collection. If the resource already
* exists in the storage, it is updated.
*
* @param resource
* the resource to store
* @throws MalformedXMLResourceException
* @throws Exception
* if the storing fails
*/
public void storeResource(PersistentResource resource) throws XMLStorageNotAvailableException, MalformedResourceException {
public void storeResource(GCUBEXMLResource resource) throws XMLStorageNotAvailableException, MalformedXMLResourceException {
this.lock();
if (status != STATUS.INITIALISED) {
@ -320,14 +347,7 @@ public class XMLStorageManager {
throw new XMLStorageNotAvailableException("XMLStorage not initialized");
}
Collection currentCollection = null;
if (resource.getType() == RESOURCETYPE.Profile) {
// the entry contains a gCube resource profile
currentCollection = this.loadProfileCollection(resource.getProfileType());
} else {
// the entry contains generic properties
currentCollection = this.loadPropertiesCollection();
}
Collection currentCollection = this.loadCollection(resource.getCollectionName());
if (currentCollection == null) {
logger.error("Unable to open the Collection");
@ -336,13 +356,14 @@ public class XMLStorageManager {
}
try {
XMLResource document = (XMLResource) currentCollection.createResource(resource.getID(), "XMLResource");
document.setContent(resource.toString());
XMLResource document = (XMLResource) currentCollection.createResource(resource.getResourceName(), "XMLResource");
document.setContent(resource.toString());
logger.debug("Storing/updating resource " + document.getId() + " in collection " + currentCollection.getName() + "...");
logger.trace("Resource content: " + resource.toString());
currentCollection.storeResource(document);
logger.debug("...done");
} catch (XMLDBException edb) {
logger.error("Failed to store resource " + resource.getID());
logger.error("Failed to store resource " + resource.getResourceName());
logger.error("" + edb.errorCode + " " + edb.getMessage(), edb);
} catch (Exception e) {
logger.error("" + e.getMessage(), e);
@ -369,9 +390,10 @@ public class XMLStorageManager {
* @return
* @throws Exception
*/
public AggregatorPersistentResource retrieveResourceFromID(String resourceID) throws Exception {
/* public GCUBEXMLResource retrieveResourceFromID(String resourceID) throws Exception {
XMLResource res = null;
Collection currentCollection = this.loadAllCollections();
String collectionName = currentCollection.getName();
try {
res = (XMLResource) currentCollection.getResource(resourceID);
if (res == null)
@ -380,73 +402,83 @@ public class XMLStorageManager {
logger.error("Failed to retrieve document " + resourceID);
logger.error("" + edb.errorCode + " " + edb.getMessage(), edb);
throw new Exception();
}
return new AggregatorPersistentResource(res);
}
return new GCUBEXMLResource(res, collectionName);
}
*/
/**
* Retrieves a resource from the storage given its ID
* Retrieves a resource's content from the storage
*
* @param resourceID
* @param resource
* @return
* @throws Exception
*/
synchronized public AggregatorPersistentResource retrievePropertyResourceFromID(String resourceID) throws Exception {
synchronized public void retrieveResourceContent(GCUBEXMLResource resource) throws Exception {
XMLResource res = null;
Collection currentCollection = this.loadPropertiesCollection();
Collection currentCollection = this.loadCollection(resource.getCollectionName());
try {
res = (XMLResource) currentCollection.getResource(resourceID);
if (res == null)
logger.warn("Resource " + resourceID + " not found!");
res = (XMLResource) currentCollection.getResource(resource.getResourceName());
if (res == null) {
logger.warn("Resource " + resource.getResourceName() + " not found!");
throw new Exception("Resource " + resource.getResourceName() + " not found!");
}
if (res.getContent() == null) {
logger.warn("Resource content for " + resource.getResourceName() + " not found!");
throw new Exception("Resource content for " + resource.getResourceName() + " not found!");
}
resource.setContent(res.getContent().toString(), true);
} catch (XMLDBException edb) {
logger.error("Failed to retrieve document " + resourceID);
logger.error("Failed to retrieve document " + resource.getResourceName());
logger.error("" + edb.errorCode + " " + edb.getMessage(), edb);
throw new Exception();
} finally {
this.resetCollection(currentCollection);
}
return new AggregatorPersistentResource(res);
}
synchronized public AggregatorPersistentResource retrieveProfile(String profileID, String profileType) throws Exception {
/**
* Checks if the resource does exist in the storage
* @param resource the resource to check
* @return true if the resource is stored, false otherwise
* @throws MalformedXMLResourceException if the input resource is not valid
*/
public boolean checkResource(GCUBEXMLResource resource) throws MalformedXMLResourceException {
XMLResource res = null;
Collection currentCollection = this.loadProfileCollection(profileType);
Collection currentCollection = this.loadCollection(resource.getCollectionName());
try {
res = (XMLResource) currentCollection.getResource(profileID);
if (res == null)
logger.warn("Profile " + profileID + " not found!");
res = (XMLResource) currentCollection.getResource(resource.getResourceName());
} catch (XMLDBException edb) {
logger.error("Failed to retrieve document " + profileID);
logger.error("" + edb.errorCode + " " + edb.getMessage(), edb);
throw new Exception();
logger.warn("Resource " + resource.getResourceName() + " not found!");
} finally {
this.resetCollection(currentCollection);
}
return new AggregatorPersistentResource(res);
return (res == null)? false: true;
}
/**
*
* @param xpathquery
* @return
*/
synchronized public AggregatorPersistentResource executeXPathQuery(String xpathquery) {
synchronized public GCUBEXMLResource executeXPathQuery(String xpathquery) {
AggregatorPersistentResource res = null;
// ArrayList<AggregatorPersistentResource> results = new
// ArrayList<AggregatorPersistentResource>();
GCUBEXMLResource res = null;
// ArrayList<XMLDBDocument> results = new
// ArrayList<XMLDBDocument>();
/*
* try { // get query-service XPathQueryServiceImpl service = (XPathQueryServiceImpl)
* currentCollection.getService("XPathQueryService", "1.0"); // set pretty-printing on
* service.setProperty(OutputKeys.INDENT, "yes"); service.setProperty(OutputKeys.ENCODING,
* "UTF-8"); ResourceSet set = service.query(xpathquery); logger.debug("number of returned
* documents: " + set.getSize()); ResourceIterator i = set.getIterator();
* while(i.hasMoreResources()) { res = new AggregatorPersistentResource((XMLResource)
* while(i.hasMoreResources()) { res = new XMLDBDocument((BaseDAIXResource)
* i.nextResource()); System.out.println("DILIGENT resource " + i + " " + res.toString()); }
*
* for (int i = 0; i < (int) set.getSize(); i++) { res = new
* AggregatorPersistentResource((XMLResource) set.getResource((long) i));
* XMLDBDocument((BaseDAIXResource) set.getResource((long) i));
* System.out.println("DILIGENT resource " + i + " " + res.toString()); } } catch
* (XMLDBException edb) { logger.error("failed to execute Xpath query " + xpathquery);
* edb.printStackTrace(); } catch (Exception e) { logger.error("exception " + xpathquery);
@ -457,30 +489,30 @@ public class XMLStorageManager {
}
/**
* Deletes a WS-ResourceProperties resource identified by the given ID
* Deletes a resource
*/
synchronized public void retrieveAndDeleteResourceFromID(String resourceID) throws Exception {
synchronized public void deleteResource(GCUBEXMLResource resource) throws Exception {
if (resourceID == null) {
logger.warn("Invalid resource ID");
if (resource.getResourceName() == null) {
logger.warn("Invalid resource name");
return;
}
this.lock();
Collection propCollection = this.loadPropertiesCollection();
if (propCollection == null) {
logger.error("Unable to load collection Properties!");
throw new Exception();
Collection collection = this.loadCollection(resource.getCollectionName());
if (collection == null) {
//logger.error("Unable to load collection Properties!");
//throw new Exception();
collection = this.rootCollection;
}
try {
logger.info("Trying to remove resource " + resourceID + " from collection " + propCollection.getName());
deleteResource(resourceID, propCollection, false);
logger.info("Trying to remove resource " + resource.getResourceName() + " from collection " + collection.getName());
deleteResource(resource.getResourceName(), collection, false);
} catch (XMLDBException edb) {
logger.error("Failed to remove the resource from the storage! ");
logger.error("", edb);
throw new Exception();
} finally {
this.resetCollection(propCollection);
this.resetCollection(collection);
this.unlock();
}
@ -489,7 +521,7 @@ public class XMLStorageManager {
/**
* Deletes a Profile resource identified by the given ID
*/
synchronized public void retrieveAndDeleteProfileFromID(String profileID, String profileType) throws Exception {
/* synchronized public void retrieveAndDeleteProfileFromID(String profileID, String profileType) throws Exception {
if (profileID == null) {
logger.warn("Invalid profile ID");
@ -513,7 +545,7 @@ public class XMLStorageManager {
this.unlock();
}
}
}*/
/**
* Deletes the resource with the given ID from the local storage
@ -598,23 +630,28 @@ public class XMLStorageManager {
/**
* Delete the collection named PROPERTIES_COLLECTION_NAME from the storage
*/
public void deleteAllProperties() {
public void deleteAllResourcesFromCollection(String collectionName) {
this.lock();
try {
logger.info("Trying to delete the collection " + XMLStorageManager.PROPERTIES_COLLECTION_NAME + "...");
//logger.info("Trying to delete the collection " + XMLStorage.PROPERTIES_COLLECTION_NAME + "...");
CollectionManagementService mgtService = (CollectionManagementService) rootCollection.getService("CollectionManagementService", "1.0");
mgtService.removeCollection(XMLStorageManager.PROPERTIES_COLLECTION_NAME);
mgtService.removeCollection(collectionName);
logger.info("Collection deleted");
} catch (XMLDBException edb) {
logger.warn("Unable to delete the collection " + XMLStorageManager.PROPERTIES_COLLECTION_NAME + ": " + edb.toString());
logger.warn("Unable to delete the collection " + collectionName + ": " + edb.toString());
} finally {
this.unlock();
}
}
public String[] listAllPropertiesIDs() {
return listAllColletionIDs(this.loadPropertiesCollection());
/**
* Lists all the identifiers of the resources belonging the collection
* @param collectionName the collection name
* @return the list of identifiers
*/
public String[] listAllCollectionResourceIDs(String collectionName) {
return listAllCollectionResourceIDs(this.loadCollection(collectionName));//.loadPropertiesCollection());
}
/**
@ -634,7 +671,7 @@ public class XMLStorageManager {
}
private String[] listAllColletionIDs(Collection collection) {
private String[] listAllCollectionResourceIDs(Collection collection) {
String[] ids = null;
String collectionName = "";
try {
@ -650,7 +687,7 @@ public class XMLStorageManager {
}
protected void checkConnection() {
if (this.operationsCounter > XMLStorageManager.maxOperationsPerConnection) {
if (this.operationsCounter > this.maxOperationsPerConnection) {
logger.info("It's time to reset the connection...");
this.lock();
this.shutdown(false);

View File

@ -0,0 +1,152 @@
package org.gcube.informationsystem.collector.stubs.testsuite.wsdaix;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.axis.message.MessageElement;
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.core.utils.logging.GCUBEClientLog;
import org.gcube.informationsystem.collector.stubs.wsdai.DataResourceUnavailableFaultType;
import org.gcube.informationsystem.collector.stubs.wsdai.InvalidResourceNameFaultType;
import org.gcube.informationsystem.collector.stubs.wsdai.NotAuthorizedFaultType;
import org.gcube.informationsystem.collector.stubs.wsdai.ServiceBusyFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentRequestWrapper;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentResponseWrapperResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentsRequest;
import org.gcube.informationsystem.collector.stubs.wsdaix.AddDocumentsResponse;
import org.gcube.informationsystem.collector.stubs.wsdaix.InvalidCollectionNameFaultType;
import org.gcube.informationsystem.collector.stubs.wsdaix.XMLCollectionAccessPT;
import org.gcube.informationsystem.collector.stubs.wsdaix.XMLWrapperType;
import org.gcube.informationsystem.collector.stubs.wsdaix.service.WsdaixServiceAddressingLocator;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import com.sun.xml.bind.StringInputStream;
/**
*
* Tester for XMLCollectionAccess::addDocuments
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class AddDocumentsTester {
private static GCUBEClientLog logger = new GCUBEClientLog(AddDocumentsTester.class);
/**
* @param args
* 0 - host
* 1 - port
* 2 - scope
* 3 - resourcename
* 4 - collection
* 5 - document name
* 6 - filename
*/
public static void main(String[] args) {
final String portTypeURI = "http://" + args[0] + ":" + args[1] + "/wsrf/services/gcube/informationsystem/collector/wsdaix/XMLCollectionAccess";
try {
AddDocumentsResponse r = addDocuments(portTypeURI,GCUBEScope.getScope(args[2]),
new org.apache.axis.types.URI (args[3]),
new org.apache.axis.types.URI(args[4]),
new String[] { args[5] },
new Document[] {TestDocuments.loadDocument(args[6])} );
logger.info("Number of response wrappers "+ r.getAddDocumentResponseWrapper().length );
String response = null;
for(int i=0;i<r.getAddDocumentResponseWrapper().length;i++) {
if ( r.getAddDocumentResponseWrapper()[i].getDocumentName().equals(args[5]) ) {
response = r.getAddDocumentResponseWrapper()[i].getResponse().toString();
logger.info(response);
}
}
logger.info("Add response " + AddDocumentResponseWrapperResponse._value1.toString());
//logger.info("Add response " + AddDocumentResponseWrapperResponse._value4.toString()); //,sugdenResponse);
} catch (Exception e ) {
logger.error(e.toString());
}
}
/**
* Execute the AddDocuments operation
*
* @param serviceURL the URL of the data service
* @param scope the target scope
* @param resourceName the abstract name of the data resource
* @param collectionURI The URI of the collection to which the documents should be added
* @param documentNames An array of document names to be added
* @param documents The corresponding content of each document
*/
public static AddDocumentsResponse addDocuments(String serviceURL, GCUBEScope scope,
org.apache.axis.types.URI resourceName,
org.apache.axis.types.URI collectionURI, String[] documentNames, Document[] documents)
throws DataResourceUnavailableFaultType, MalformedURLException, RemoteException,
ServiceBusyFaultType, InvalidResourceNameFaultType, InvalidCollectionNameFaultType, NotAuthorizedFaultType {
AddDocumentsRequest request = new AddDocumentsRequest();
request.setDataResourceAbstractName(resourceName);
AddDocumentRequestWrapper[] wrappers = new AddDocumentRequestWrapper[documents.length];
for(int i=0;i<wrappers.length;i++) {
wrappers[i] = new AddDocumentRequestWrapper();
wrappers[i].setDocumentName(documentNames[i]); //document name
XMLWrapperType wrapper = new XMLWrapperType();
MessageElement msgElement = new MessageElement(documents[i].getDocumentElement());
MessageElement msgElement2;
try {
msgElement2 = new MessageElement(createMetadata("Profile", "http://source",
600, "MyGroupKey", "MyKey", "MyEntryKey").getDocumentElement());
} catch (Exception e) {
logger.error("Unable to add document " + documentNames[i], e);
continue;
}
wrapper.set_any(new MessageElement[] {msgElement, msgElement2} );
wrappers[i].setData(wrapper);
}
request.setAddDocumentRequestWrapper(wrappers);
request.setCollectionName(collectionURI);
XMLCollectionAccessPT stubs = null;
try {
stubs = new WsdaixServiceAddressingLocator().getXMLCollectionAccessPTPort(new URL(serviceURL));
stubs = GCUBERemotePortTypeContext.getProxy(stubs, scope);
} catch (Exception e) {
logger.error("Failed to add documentes", e);
}
return stubs.addDocuments(request);
}
private static Document createMetadata(String type, String source,
Integer tt, String groupkey, String key, String entrykey)
throws SAXException, IOException, ParserConfigurationException {
StringBuilder builder = new StringBuilder();
builder.append("<Metadata>");
builder.append("<Type>").append(type).append("</Type>");
builder.append("<Source>").append(source).append("</Source>");
builder.append("<TerminationTime>").append(String.valueOf(tt)).append("</TerminationTime>");
builder.append("<GroupKey>").append(groupkey).append("</GroupKey>");
builder.append("<EntryKey>").append(entrykey).append("</EntryKey>");
builder.append("<Key>").append(key).append("</Key>");
builder.append("</Metadata>");
builder.toString();
return DocumentBuilderFactory
.newInstance()
.newDocumentBuilder()
.parse(new StringInputStream(builder.toString()));
}
}

View File

@ -0,0 +1,13 @@
package org.gcube.informationsystem.collector.stubs.testsuite.wsdaix;
public class RemoveDocumentsTester {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,39 @@
package org.gcube.informationsystem.collector.stubs.testsuite.wsdaix;
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.log4j.Logger;
import org.w3c.dom.*;
/**
*
* Loads the XML documents used in tests.
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class TestDocuments {
private static Logger mLog = Logger.getLogger(TestDocuments.class);
/**
* Loads an XML document with the specified filename
*/
protected static Document loadDocument(String filename) {
try {
File file = new File(filename);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(file);
} catch ( Exception e ) {
mLog.error("Unable to load document: " + filename);
}
return null;
}
}

View File

@ -0,0 +1,31 @@
<Resource version="0.4.x">
<ID>3bb6e850-94d2-11df-8d06-8e825c7c7b8d</ID>
<Type>MetadataCollection</Type>
<Scopes>
<Scope>/d4science.research-infrastructures.eu/FARM/FCPPS</Scope>
</Scopes>
<Profile>
<Description />
<Name>Annotations_Collection</Name>
<IsUserCollection value="true" />
<IsIndexable value="true" />
<IsEditable value="true" />
<CreationTime>2010-07-21T15:14:13+01:00</CreationTime>
<Creator>unknown</Creator>
<NumberOfMembers>0</NumberOfMembers>
<LastUpdateTime>2010-07-21T15:14:29+01:00</LastUpdateTime>
<PreviousUpdateTime>2010-07-21T15:14:29+01:00</PreviousUpdateTime>
<LastModifier>unknown</LastModifier>
<OID>5ec18cb0-94d2-11df-b077-8e28f9a7444e</OID>
<RelatedCollection>
<CollectionID>d14baeb0-f162-11dd-96f7-b87cc0f0b075</CollectionID>
<SecondaryRole>is-annotated-by</SecondaryRole>
</RelatedCollection>
<MetadataFormat>
<SchemaURI>http://gcube.org/AnnotationFrontEnd/AFEAnnotationV2
</SchemaURI>
<Language>en</Language>
<Name>Annotations</Name>
</MetadataFormat>
</Profile>
</Resource>

View File

@ -1,60 +0,0 @@
package org.gcube.informationsystem.collector.stubs.testsuite.xmlcollectionaccess;
import java.net.URL;
import java.rmi.RemoteException;
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.core.utils.logging.GCUBEClientLog;
import org.gcube.informationsystem.collector.stubs.DocumentNotFoundFaultType;
import org.gcube.informationsystem.collector.stubs.GetProfileCriteria;
import org.gcube.informationsystem.collector.stubs.XMLCollectionAccessPortType;
import org.gcube.informationsystem.collector.stubs.service.XMLCollectionAccessServiceLocator;
/**
* Tester for <em>GetProfile</em> operation of the
* <em>gcube/informationsystem/collector/XMLCollectionAccess</em> portType
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class GetProfileTester {
private static GCUBEClientLog logger = new GCUBEClientLog(GetProfileTester.class);
/**
* @param args
*/
public static void main(String[] args) {
if (args.length != 5) {
logger.fatal("Usage: GetProfileTester <host> <port> <Scope> <ID> <profileType>");
return;
}
final String portTypeURI = "http://" + args[0] + ":" + args[1] + "/wsrf/services/gcube/informationsystem/collector/XMLCollectionAccess";
XMLCollectionAccessPortType port = null;
try {
port = new XMLCollectionAccessServiceLocator().getXMLCollectionAccessPortTypePort(new URL(portTypeURI));
port = GCUBERemotePortTypeContext.getProxy(port, GCUBEScope.getScope(args[2]));
} catch (Exception e) {
logger.error("",e);
}
logger.info("Submitting the request...");
String profile;
try {
GetProfileCriteria criteria = new GetProfileCriteria();
criteria.setID(args[3]);
criteria.setProfileType(args[4]);
profile = port.getProfile(criteria);
logger.info("Retrieved profile: \n" + profile);
} catch (DocumentNotFoundFaultType e) {
logger.error("",e);
} catch (RemoteException e) {
logger.error("",e);
}
}
}

View File

@ -1,61 +0,0 @@
package org.gcube.informationsystem.collector.stubs.testsuite.xmlcollectionaccess;
import java.net.URL;
import java.rmi.RemoteException;
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.core.utils.logging.GCUBEClientLog;
import org.gcube.informationsystem.collector.stubs.DocumentNotFoundFaultType;
import org.gcube.informationsystem.collector.stubs.GetResourceCriteria;
import org.gcube.informationsystem.collector.stubs.XMLCollectionAccessPortType;
import org.gcube.informationsystem.collector.stubs.service.XMLCollectionAccessServiceLocator;
/**
* Tester for <em>GetResource</em> operation of the
* <em>gcube/informationsystem/collector/XMLCollectionAccess</em> portType
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class GetResourceTester {
private static GCUBEClientLog logger = new GCUBEClientLog(GetResourceTester.class);
/**
* @param args
*/
public static void main(String[] args) {
if (args.length != 4) {
logger.fatal("Usage: GetResourceTester <host> <port> <Scope> <ID>");
return;
}
final String portTypeURI = "http://" + args[0] + ":" + args[1] + "/wsrf/services/gcube/informationsystem/collector/XMLCollectionAccess";
XMLCollectionAccessPortType port = null;
try {
port = new XMLCollectionAccessServiceLocator().getXMLCollectionAccessPortTypePort(new URL(portTypeURI));
port = GCUBERemotePortTypeContext.getProxy(port, GCUBEScope.getScope(args[2]));
} catch (Exception e) {
logger.error("",e);
}
logger.info("Submitting the request...");
String resource;
try {
GetResourceCriteria criteria = new GetResourceCriteria();
criteria.setID(args[3]);
resource = port.getResource(criteria);
logger.info("Retrieved resource: \n" + resource);
} catch (DocumentNotFoundFaultType e) {
logger.error("",e);
} catch (RemoteException e) {
logger.error("",e);
}
}
}

View File

@ -0,0 +1,72 @@
package org.gcube.informationsystem.collector.test;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.DAIXResource.MalformedResourceException;
import junit.framework.TestCase;
public class GCUBEInstanceStateResourceTest extends TestCase {
private GCUBEInstanceStateResource resource;
protected void setUp() throws Exception {
super.setUp();
resource = new GCUBEInstanceStateResource();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testSetContentString() {
try {
resource.setContent("<ns1:Task xmlns:ns1=\"http://gcube-system.org/namespaces/vremanagement/executor\"/> <ns9:Task xmlns:ns9=\"http://gcube-system.org/namespaces/vremanagement/executor\">");
} catch (MalformedResourceException e) {
e.printStackTrace();
}
}
public void testGetCollectionName() {
assertTrue(resource.getCollectionName() == "Properties");
}
public void testSetCollectionName() {
fail("Not yet implemented");
}
public void testGetContent() {
fail("Not yet implemented");
}
public void testSetContentDocument() {
//resource.setContent(null);
}
public void testSetResourceName() {
resource.setResourceName("InstanceStateTest");
}
public void testGetResourceName() {
this.testSetResourceName();
System.out.println("Resource name is " + resource.getResourceName());
}
public void testGetResourceURI() {
fail("Not yet implemented");
}
public void testSetResourceURI() {
fail("Not yet implemented");
}
public void testToString() {
this.testSetContentString();
System.out.println("Resource content is " + resource.toString());
}
}

View File

@ -0,0 +1,121 @@
package org.gcube.informationsystem.collector.test;
import java.io.StringReader;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import junit.framework.TestCase;
import org.gcube.informationsystem.collector.impl.resources.GCUBEProfileResource;
import org.gcube.informationsystem.collector.impl.resources.DAIXResource.MalformedResourceException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.InputSource;
public class GCUBEProfileResourceTest extends TestCase {
private GCUBEProfileResource resource;
@Before
public void setUp() throws Exception {
resource = new GCUBEProfileResource();
}
@After
public void tearDown() throws Exception {
}
@Test
public void testSetContentString() {
StringBuilder builder = new StringBuilder();
builder.append("<Resource version=\"0.4.x\">");
builder.append("<ID>3bb6e850-94d2-11df-8d06-8e825c7c7b8d</ID>");
builder.append("<Type>MetadataCollection</Type>");
builder.append("<Scopes>");
builder.append("<Scope>/d4science.research-infrastructures.eu/FARM/FCPPS</Scope>");
builder.append("</Scopes>");
builder.append("<Profile>");
builder.append("<Description />");
builder.append("</Profile>");
builder.append("</Resource>");
try {
resource.setContent(builder.toString());
} catch (MalformedResourceException e) {
e.printStackTrace();
}
}
@Test
public void testBaseDAIXResource() {
//fail("Not yet implemented");
}
@Test
public void testGetResourceName() {
//fail("Not yet implemented");
}
@Test
public void testSetResourceName() {
resource.setResourceName("TestResouceName");
}
@Test
public void testGetResourceURI() {
//fail("Not yet implemented");
}
@Test
public void testSetResourceURI() {
//fail("Not yet implemented");
}
@Test
public void testGetContent() {
//fail("Not yet implemented");
}
@Test
public void testSetContentDocument() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader("<Profile><Resource><ID/><Type>GHN</Type></Resource></Profile>");
InputSource source = new InputSource(reader);
resource.setContent(builder.parse(source));
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testSetCollectionName() {
resource.setResourceType("testCollection");
}
@Test
public void testGetCollectionName() {
this.testSetContentString();
try {
System.out.println("Resource collection is " + resource.getCollectionName());
} catch (MalformedResourceException e) {
e.printStackTrace();
}
}
@Test
public void testToString() {
this.testSetContentDocument();
System.out.println("Resource from DOM is: " + resource.toString());
//resource.setContent(null);
this.testSetContentString();
System.out.println("Resource from String is: " + resource.toString());
}
}

View File

@ -0,0 +1,160 @@
package org.gcube.informationsystem.collector.test;
import junit.framework.TestCase;
import org.gcube.informationsystem.collector.impl.resources.BaseDAIXResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEProfileResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource.MalformedXMLResourceException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class GCUBEXMLResourceTest extends TestCase {
private GCUBEXMLResource XMLiresource;
private GCUBEXMLResource XMLpresource;
private GCUBEInstanceStateResource iresource;
private GCUBEProfileResource presource;
@Before
public void setUp() throws Exception {
iresource = new GCUBEInstanceStateResource();
iresource.setResourceName("Instance");
iresource.setContent("<ns1:Task xmlns:ns1=\"http://gcube-system.org/namespaces/vremanagement/executor\"/> <ns9:Task xmlns:ns9=\"http://gcube-system.org/namespaces/vremanagement/executor\"/>");
presource = new GCUBEProfileResource();
presource.setResourceName("Profile");
presource.setContent("<Profile><Resource><ID/><Type>GHN</Type></Resource></Profile>");
XMLiresource = new GCUBEXMLResource(iresource);
XMLpresource = new GCUBEXMLResource(presource);
}
@After
public void tearDown() throws Exception {
}
@Test
public void testGCUBEXMLResourceBaseDAIXResource() {
try {
XMLiresource = new GCUBEXMLResource(iresource);
XMLpresource = new GCUBEXMLResource(presource);
} catch (MalformedXMLResourceException e) {
Assert.fail("failed to create GCUBEXMLResources");
}
}
@Test
public void testGCUBEXMLResourceXMLResourceString() {
//fail("Not yet implemented");
}
@Test
public void testGetCollectionName() {
try {
System.out.println("Instance collection Name " + XMLiresource.getCollectionName() );
System.out.println("Profile collection Name " + XMLpresource.getCollectionName() );
} catch (MalformedXMLResourceException e) {
e.printStackTrace();
}
}
@Test
public void testSetContentWithEnvelop() {
try {
String content = XMLpresource.toString();
System.out.println("Profile Content with envelop " + content);
GCUBEXMLResource temp = new GCUBEXMLResource(new BaseDAIXResource("name"));
temp.setContent(content, true);
System.out.println("New Profile Content with envelop " + temp.toString());
String content2 = XMLiresource.toString();
System.out.println("Instance State Content with envelop " + content2);
GCUBEXMLResource temp2 = new GCUBEXMLResource(new BaseDAIXResource("name"));
temp2.setContent(content2, true);
System.out.println("New Instance State Content with envelop " + temp2.toString());
} catch (MalformedXMLResourceException e) {
Assert.fail("failed to create GCUBEXMLResources");
}
}
@Test
public void testGetResourceName() {
//fail("Not yet implemented");
}
@Test
public void testGetTerminationTime() {
//fail("Not yet implemented");
}
@Test
public void testGetLastUpdateTime() {
//fail("Not yet implemented");
}
@Test
public void testSetTerminationTime() {
//fail("Not yet implemented");
}
@Test
public void testGetLastUpdateTimeinMills() {
//fail("Not yet implemented");
}
@Test
public void testSetGroupKey() {
//fail("Not yet implemented");
}
@Test
public void testGetEntryKey() {
//fail("Not yet implemented");
}
@Test
public void testSetEntryKey() {
//fail("Not yet implemented");
}
@Test
public void testSetSource() {
//fail("Not yet implemented");
}
@Test
public void testGetSource() {
//fail("Not yet implemented");
}
@Test
public void testSetSourceKey() {
//fail("Not yet implemented");
}
@Test
public void testGetSourceKey() {
//fail("Not yet implemented");
}
@Test
public void testSetCompleteSourceKey() {
//fail("Not yet implemented");
}
@Test
public void testGetCompleteSourceKey() {
//fail("Not yet implemented");
}
@Test
public void testToString() {
System.out.println("Instance to string " + XMLiresource.toString() );
System.out.println("Profile to string " + XMLpresource.toString() );
}
}

View File

@ -0,0 +1,77 @@
package org.gcube.informationsystem.collector.test;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.gcube.informationsystem.collector.impl.utils.MetadataReader;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import com.sun.xml.bind.StringInputStream;
import junit.framework.TestCase;
public class MetadataReaderTest extends TestCase {
MetadataReader reader;
protected void setUp() throws Exception {
Document metadata = this.createMetadata("Profile", "MySource", "600", "MyGroup", "MyKey",
"MyEntry");
reader = new MetadataReader(metadata);
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testGetType() {
System.out.println("Type: " + reader.getType());
}
public void testGetSource() {
System.out.println("Source: " + reader.getSource());
}
public void testGetTerminationTime() {
System.out.println("Termination time: " + reader.getTerminationTime().getTime().toString());
}
public void testGetGroupKey() {
System.out.println("Group Key: " + reader.getGroupKey());
}
public void testGetEntryKey() {
System.out.println("Entry Key: " + reader.getEntryKey());
}
public void testGetKey() {
System.out.println("Key: " + reader.getKey());
}
private Document createMetadata(String type, String source,
String tt, String groupkey, String key, String entrykey)
throws SAXException, IOException, ParserConfigurationException {
StringBuilder builder = new StringBuilder();
builder.append("<Metadata>");
builder.append("<Type>").append(type).append("</Type>");
builder.append("<Source>").append(source).append("</Source>");
builder.append("<TerminationTime>").append(tt).append("</TerminationTime>");
builder.append("<GroupKey>").append(groupkey).append("</GroupKey>");
builder.append("<EntryKey>").append(entrykey).append("</EntryKey>");
builder.append("<Key>").append(key).append("</Key>");
builder.append("</Metadata>");
builder.toString();
return DocumentBuilderFactory
.newInstance()
.newDocumentBuilder()
.parse(new StringInputStream(builder.toString()));
}
}

View File

@ -0,0 +1,165 @@
package org.gcube.informationsystem.collector.test;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEProfileResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.gcube.informationsystem.collector.impl.resources.DAIXResource.MalformedResourceException;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource.MalformedXMLResourceException;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.XMLStorageNotAvailableException;
import org.junit.Assert;
import org.xmldb.api.base.XMLDBException;
import junit.framework.TestCase;
public class XMLStorageManagerTest extends TestCase {
private static final String resourceProfileName = "profileName";
private static final String resourceInstanceStateName = "instanceStateName";
XMLStorage storage;
protected void setUp() throws Exception {
super.setUp();
storage = new XMLStorage();
storage.initialize(1000);
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testCreateCollection() {
try {
storage.createCollection("Profiles/RunningInstance");
} catch (XMLDBException e) {
Assert.fail("XMLDB failure" + e.getMessage());
} catch (XMLStorageNotAvailableException e) {
Assert.fail("Storage not available " + e.getMessage());
}
}
public void testShutdown() {
//fail("Not yet implemented");
}
public void testLoadAllCollections() {
}
public void testStoreResource() {
try {
GCUBEXMLResource XMLpresource;
GCUBEProfileResource presource = new GCUBEProfileResource();
presource.setResourceName(resourceProfileName);
presource.setContent("<Profile><Resource><ID/><Type>GHN</Type></Resource></Profile>");
XMLpresource = new GCUBEXMLResource(presource);
storage.storeResource(XMLpresource);
System.out.println("testStoreResource : profile "+ XMLpresource.getResourceName()+ " successfully stored");
GCUBEInstanceStateResource iresource = new GCUBEInstanceStateResource();
iresource.setResourceName(resourceInstanceStateName);
iresource.setContent("<ns1:Task xmlns:ns1=\"http://gcube-system.org/namespaces/vremanagement/executor\"/> <ns9:Task xmlns:ns9=\"http://gcube-system.org/namespaces/vremanagement/executor\"/>");
GCUBEXMLResource XMLiresource = new GCUBEXMLResource(iresource);
storage.storeResource(XMLiresource);
System.out.println("testStoreResource : instance state "+ XMLiresource.getResourceName()+ " successfully stored");
} catch (MalformedResourceException e) {
Assert.fail("Malformed Profile resource");
} catch (XMLStorageNotAvailableException e) {
Assert.fail("Storage not available " + e.getMessage());
} catch (MalformedXMLResourceException e) {
Assert.fail("Malformed XML resource");
}
}
public void testIsLocked() {
}
public void testRetrieveResourceContent() {
//this.testStoreResource();
GCUBEXMLResource XMLresource;
GCUBEProfileResource presource = new GCUBEProfileResource();
presource.setResourceName(resourceProfileName);
presource.setResourceType("GHN");
try {
XMLresource = new GCUBEXMLResource(presource);
storage.retrieveResourceContent(XMLresource);
System.out.println("testRetrieveResourceContent: Retrieved content " + XMLresource.toString());
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Failed to retrieve resource's content");
}
GCUBEInstanceStateResource iresource = new GCUBEInstanceStateResource();
iresource.setResourceName(resourceInstanceStateName);
try {
XMLresource = new GCUBEXMLResource(iresource);
storage.retrieveResourceContent(XMLresource);
System.out.println("testRetrieveResourceContent: Retrieved content " + XMLresource.toString());
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Failed to retrieve resource's content");
}
}
public void testExecuteXPathQuery() {
}
public void testListAllCollectionResourceIDs() {
GCUBEProfileResource presource = new GCUBEProfileResource();
presource.setResourceType("GHN");
try {
System.out.println("testListAllCollectionResourceIDs: Looking in collection " + presource.getCollectionName());
for (String id : storage.listAllCollectionResourceIDs(presource.getCollectionName()))
System.out.println("\ttestListAllCollectionResourceIDs: Found Resource ID " + id);
System.out.println("testListAllCollectionResourceIDs: Looking in collection " + new GCUBEInstanceStateResource().getCollectionName());
for (String id : storage.listAllCollectionResourceIDs(new GCUBEInstanceStateResource().getCollectionName()))
System.out.println("\ttestListAllCollectionResourceIDs: Found Resource ID " + id);
} catch (MalformedResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void testDeleteResource() {
GCUBEProfileResource presource = new GCUBEProfileResource();
presource.setResourceType("GHN");
try {
for (String id : storage.listAllCollectionResourceIDs(presource.getCollectionName())) {
presource.setResourceName(id);
storage.deleteResource(new GCUBEXMLResource(presource));
System.out.println("testDeleteResource: resource " + id + " deleted");
}
this.testListAllCollectionResourceIDs();
} catch (MalformedResourceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
public void testDeleteAllResourcesFromCollection() {
}
public void testGetStatus() {
}
public void testSetStatus() {
}
}