Managing State

From GCube System
Revision as of 20:49, 28 March 2008 by Manuele.simi (Talk | contribs) (New page: == How to publish the state == === GCUBEProvider === Import GCUBEProvider WSDL inside the Stateful WSDL: <pre> <definitions name="Stateful" targetNamespace="http://acme.org/sample".... xml...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to publish the state

GCUBEProvider

Import GCUBEProvider WSDL inside the Stateful WSDL:

<definitions name="Stateful" targetNamespace="http://acme.org/sample"....
xmlns:provider=http://gcube-system.org/namespaces/common/core/porttypes/GCUBEProvider />

<import namespace=http://gcube-system.org/namespaces/common/core/porttypes/GCUBEProvider   
location="../gcube/common/core/providers/GCUBEProvider.wsdl"/>

...

</definition>

Include the GCUBEProvider in the list of providers on service WSDD:

 
<parameter name="providers" value="GCUBEProvider"/>

WS-Resource Property document

Declare the WS-Resource Property document in the Stateful WSDL:

<definitions name="Stateful"
    targetNamespace="http://acme.org/sample" ...>

   <types>
	<xsd:schema targetNamespace="http://acme.org/sample">    	
	    <xsd:import namespace="http://gcube-system.org/namespaces/common/core/types" schemaLocation="../gcube/common/core/types/GCUBETypes.xsd"/>
	    	
  		<xsd:element name="aboutSF" type="coretypes:VOID" />
		<xsd:element name="aboutSFResponse" type="xsd:string" />		
		
		<xsd:element name="Name" type="xsd:string"/>
        <xsd:element name="Visits" type="xsd:int"/>
        
            <xsd:element name="StatefulResourceProperties">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element ref="tns:Name" minOccurs="1" maxOccurs="1"/>
                        <xsd:element ref="tns:Visits" minOccurs="1" maxOccurs="1"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element> 	
            
	</xsd:schema>
    </types>

Port-Type definitions

Extend the Stateful port-type with the GCUBEProvider and declare in the port-type definition the Resource Property document:

<portType name="StatefulPortType"
    wsrp:ResourceProperties="tns:StatefulResourceProperties"
        wsdlpp:extends="provider:GCUBEProvider">
 ...
 </portType>

Publication Profile

Provide a Publication Profile:

<ServiceGroupRegistrationParameters
    xmlns:sgc="http://mds.globus.org/servicegroup/client"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
    xmlns:agg="http://mds.globus.org/aggregator/types"
    xmlns="http://mds.globus.org/servicegroup/client">
    
    
    <!-- Specifies that the registration will be renewed every 30
        seconds -->
    <RefreshIntervalSecs>60</RefreshIntervalSecs>
    
    
    <!-- <Content> specifies registration specific information -->
    <Content xsi:type="agg:AggregatorContent"
        xmlns:agg="http://mds.globus.org/aggregator/types">
        
        <agg:AggregatorConfig>
            <agg:GetMultipleResourcePropertiesPollType 
                xmlns:tutorial="http://acme.org/sample"
                xmlns:provider="http://gcube-system.org/namespaces/common/core/porttypes/GCUBEProvider">
                
                <agg:PollIntervalMillis>60000</agg:PollIntervalMillis>
                
                <agg:ResourcePropertyNames>tutorial:Name</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>tutorial:Visits</agg:ResourcePropertyNames>
                
                <agg:ResourcePropertyNames>provider:RI</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>provider:ServiceID</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>provider:ServiceName</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>provider:ServiceClass</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>provider:VO</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>provider:GHN</agg:ResourcePropertyNames>
                <agg:ResourcePropertyNames>provider:Scope</agg:ResourcePropertyNames>
                
            </agg:GetMultipleResourcePropertiesPollType>
        </agg:AggregatorConfig>

        <agg:AggregatorData/>
        
    </Content>
    
</ServiceGroupRegistrationParameters>

Include the Publication Profile resource on the stateful JNDI section:


How to persist the state

--Manuele.simi 21:49, 28 March 2008 (EET)