<module name="sandesha2" class="org.apache.sandesha2.SandeshaModule">

    <Description>
        This module implements WS-ReliableMessaging for Axis2. This implements both the WSRM submitted spec and up to the version CD4 of the new WSRM 1.1 spec.
    </Description>
    
    <InFlow>
        <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
            <!-- Global In handler should come before addressing dispatching -->
            <order phase="Dispatch" phaseFirst="true"/>
        </handler>
        <handler name="MessageContextCorrectionHandler" class="org.apache.sandesha2.handlers.MessageContextCorrectionHandler">
            <!-- A handler which handle the duplicate messages -->
            <order phase="Transport"/>
        </handler> 
        
           <handler name="SequenceIDDispatcher" class="org.apache.sandesha2.handlers.SequenceIDDispatcher">
            <order phase="Addressing" before="AddressingBasedDispatcher"  />
        </handler> 
        
        <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
            <order phase="RMPhase"/>
        </handler>
    </InFlow>

    <OutFlow>        
        <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
            <order phase="RMPhase"/>
        </handler>   
    </OutFlow>
    
    <InFaultFlow>        
        <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
            <!-- Global In handler should come before instance dispatching -->
            <order phase="Dispatch" before="InstanceDispatcher" />
        </handler> 
        <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
            <order phase="RMPhase"/>
        </handler>
    </InFaultFlow>
    
    <OutFaultFlow>        
        <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
            <order phase="RMPhase"/>
        </handler>   
    </OutFaultFlow>

    <operation name="Sandesha2OperationInOnly" mep="http://www.w3.org/2006/01/wsdl/in-only">
        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
        
        <!-- namespaces for the 2005-02 spec -->
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</actionMapping>

        <!--  For interopability purposes. Some WSRM implementations tend to send this as the LastMessage -->
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage</actionMapping>

        <!-- namespaces for the 2007-02 spec -->
        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknowledgement</actionMapping>        
        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/fault</actionMapping>
<actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/AckRequested</actionMapping>
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</actionMapping>
     </operation>
 
     <operation name="Sandesha2OperationInOut" mep="http://www.w3.org/2006/01/wsdl/in-out">
   <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
        <!-- namespaces for the 2005-02 spec -->
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</actionMapping>
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested</actionMapping>
             
        
        <!-- namespaces for the 2007-02 spec -->
        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence</actionMapping>
        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequence</actionMapping>
        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence</actionMapping>
        <actionMapping>http://docs.oasis-open.org/ws-rx/wsmc/200702/MakeConnection</actionMapping>
    </operation>

    <operation name="Sandesha2OperationOutOnly" mep="http://www.w3.org/2006/01/wsdl/out-only">
        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
    </operation>
    <operation name="Sandesha2OperationOutIn" mep="http://www.w3.org/2006/01/wsdl/out-in">
        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
    </operation>

		<operation name="Sandesha2OperationDuplicateInOnly" mep="http://www.w3.org/2006/01/wsdl/in-only">
        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
    </operation>

    <operation name="Sandesha2OperationDuplicateInOut" mep="http://www.w3.org/2006/01/wsdl/in-out">
        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
    </operation>

   <supported-policy-namespaces namespaces="http://ws.apache.org/sandesha2/policy" />

	<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
			xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
			xmlns:sandesha2="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
		<sandesha2:RMAssertion>
			<wsp:Policy>
				<sandesha2:AcknowledgementInterval>3000</sandesha2:AcknowledgementInterval>
	
				<sandesha2:RetransmissionInterval>6000</sandesha2:RetransmissionInterval>
	      
	      <!-- '-1' conveys that there is no limit to the max. number of retransmissions.-->
				<sandesha2:MaximumRetransmissionCount>10</sandesha2:MaximumRetransmissionCount>
	
				<sandesha2:ExponentialBackoff>false</sandesha2:ExponentialBackoff>
	
				<sandesha2:InactivityTimeout>60</sandesha2:InactivityTimeout>

				<sandesha2:InactivityTimeoutMeasure>seconds</sandesha2:InactivityTimeoutMeasure>

          <!-- Once a sequence has been marked as deleted, or timed out, this is the length of time that the
               sequence will remain before all sequence state is totally removed -->
                <sandesha2:SequenceRemovalTimeout>600</sandesha2:SequenceRemovalTimeout>

                <sandesha2:SequenceRemovalTimeoutMeasure>seconds</sandesha2:SequenceRemovalTimeoutMeasure>

				<sandesha2:InvokeInOrder>true</sandesha2:InvokeInOrder>
	      
	      <!-- These will not be overriden by service level policies -->
				<sandesha2:MessageTypesToDrop>none</sandesha2:MessageTypesToDrop>  
	                              
	      <!-- This will not be overriden by service level policies -->
				<sandesha2:StorageManagers>
	
					<sandesha2:InMemoryStorageManager>
					  org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
					</sandesha2:InMemoryStorageManager>
	
					<sandesha2:PermanentStorageManager>
					  org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
					</sandesha2:PermanentStorageManager>
	
				</sandesha2:StorageManagers>
	      
	      <!-- This will not be overriden by service level policies -->
				<sandesha2:SecurityManager>org.apache.sandesha2.security.dummy.DummySecurityManager</sandesha2:SecurityManager>
				<sandesha2:ContextManager>org.apache.sandesha2.context.DummyContextManager</sandesha2:ContextManager>
				
				<sandesha2:MakeConnection>
				  <sandesha2:Enabled>true</sandesha2:Enabled>
				  <sandesha2:UseRMAnonURI>true</sandesha2:UseRMAnonURI>
				</sandesha2:MakeConnection>
				
				<!-- <sandesha2:UseMessageSerialization>true</sandesha2:UseMessageSerialization> -->
				
				<sandesha2:EnforceRM>false</sandesha2:EnforceRM>
			</wsp:Policy>
		</sandesha2:RMAssertion>
	</wsp:Policy>


    <!-- Parameters that will be copied when creating related MessageContexts -->
    <parameter name="propertiesToCopyFromReferenceMessage" locked="false">TransportURL,WSAddressingVersion,disableAddressingForOutMessages,rampartPolicy,RECV_RESULTS,PROXY</parameter>
    <parameter name="propertiesToCopyFromReferenceRequestMessage" locked="false">WSAddressingVersion,RECV_RESULTS,rampartPolicy</parameter>

</module>
