org.apache.synapse.endpoints.dispatch
Class SimpleClientSessionDispatcher

java.lang.Object
  extended by org.apache.synapse.endpoints.dispatch.AbstractDispatcher
      extended by org.apache.synapse.endpoints.dispatch.SimpleClientSessionDispatcher
All Implemented Interfaces:
Dispatcher

public class SimpleClientSessionDispatcher
extends AbstractDispatcher

This dispatcher is implemented to demonstrate a sample client session. It will detect sessions based on the soap header of the request message. Therefore, above header has to be included in the request soap messages by the client who wants to initiate and maintain a session.


Field Summary
 
Fields inherited from class org.apache.synapse.endpoints.dispatch.AbstractDispatcher
log
 
Constructor Summary
SimpleClientSessionDispatcher()
           
 
Method Summary
 SessionInformation getSession(MessageContext synCtx)
          Dispatcher should check the session id pattern in the synapseMessageContext and return the matching endpoint for that session id, if available.
 boolean isServerInitiatedSession()
          Determine whether the session supported by the implementing dispatcher is initiated by the server (e.g.
 void removeSessionID(MessageContext syCtx)
          Remove the session Id - To clear out session information from current message
 void unbind(MessageContext synCtx)
          Removes the session belonging to the given message context.
 void updateSession(MessageContext synCtx)
          Updates the session maps.
 
Methods inherited from class org.apache.synapse.endpoints.dispatch.AbstractDispatcher
extractSessionID, extractSessionID, getEndpoints, removeSessionID, removeSessionID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleClientSessionDispatcher

public SimpleClientSessionDispatcher()
Method Detail

getSession

public SessionInformation getSession(MessageContext synCtx)
Description copied from interface: Dispatcher
Dispatcher should check the session id pattern in the synapseMessageContext and return the matching endpoint for that session id, if available. If the session id in the given synapseMessageContext is not found it should return null.

Parameters:
synCtx - client -> esb message context.
Returns:
Endpoint Endpoint associated with this session.

updateSession

public void updateSession(MessageContext synCtx)
Description copied from interface: Dispatcher
Updates the session maps. This will be called in the first client -> synapse -> server flow for client initiated sessions. For server initiated sessions, this will be called in the first server -> synapse -> client flow.

Parameters:
synCtx - SynapseMessageContext

unbind

public void unbind(MessageContext synCtx)
Description copied from interface: Dispatcher
Removes the session belonging to the given message context.

Parameters:
synCtx - MessageContext containing an session ID.

isServerInitiatedSession

public boolean isServerInitiatedSession()
Description copied from interface: Dispatcher
Determine whether the session supported by the implementing dispatcher is initiated by the server (e.g. soap session) or by the client. This can be used for optimizing session updates.

Returns:
true, if the session is initiated by the server. false, otherwise.

removeSessionID

public void removeSessionID(MessageContext syCtx)
Description copied from interface: Dispatcher
Remove the session Id - To clear out session information from current message

Parameters:
syCtx - MessageContext containing an session ID


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.