org.apache.synapse.endpoints.dispatch
Interface Dispatcher

All Known Implementing Classes:
AbstractDispatcher, HttpSessionDispatcher, SimpleClientSessionDispatcher, SoapSessionDispatcher

public interface Dispatcher

Defines the behavior of session dispatchers. There can be two dispatcher types. Server initiated session dispatchers and client initiated session dispatchers. In the former one, server generates the session ID and sends it to the client in the first RESPONSE. In the later case, client should generate the session ID and send it to the server in the first REQUEST. A dispatcher object will be created for each session affinity load balance endpoint.


Method Summary
 List<Endpoint> getEndpoints(SessionInformation sessionInformation)
          Returns the endpoint sequence associated with current session with out root
 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.
 

Method Detail

getSession

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. 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

void updateSession(MessageContext synCtx)
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

void unbind(MessageContext synCtx)
Removes the session belonging to the given message context.

Parameters:
synCtx - MessageContext containing an session ID.

isServerInitiatedSession

boolean isServerInitiatedSession()
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.

getEndpoints

List<Endpoint> getEndpoints(SessionInformation sessionInformation)
Returns the endpoint sequence associated with current session with out root

Parameters:
sessionInformation - Current Session information
Returns:
Endpoint sequence

removeSessionID

void removeSessionID(MessageContext syCtx)
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.