com.webmethods.caf.wsclient.session.impl
Class WSClientSessionManager

java.lang.Object
  extended by com.webmethods.caf.wsclient.session.impl.WSClientSessionManager
All Implemented Interfaces:
IWSClientSessionManager

public class WSClientSessionManager
extends Object
implements IWSClientSessionManager

Manage a set of sessions associated with a specific endpoint/credential pair The sessions are organized into session pools that reuse or dynamically create new sessions as they are needed


Constructor Summary
WSClientSessionManager()
           
 
Method Summary
 void clearAllSessions()
          Allows you to clear out all sessions
 void fireOnProxyContextCreated(ProxyContext context)
           
 void fireOnSessionCreated(IWSClientSession session)
           
protected static AuthCredentials getAuthCredentials(IWSClientProxy clientProxy)
           
protected static String getBrowserSessionID()
           
 IWSClientSession getSession(IWSClientProxy clientProxy)
          Given the current proxy, get or create a new session.
 IWSClientSessionPool getSessionPool(IWSClientProxy clientProxy)
           
static String getSessionPoolID(IWSClientProxy clientProxy)
          Create a sessionPoolID based upon the endpoint and the authcredentials
protected static String getSessionPoolID(IWSClientProxy clientProxy, AuthCredentials authCredentials)
           
 void invalidateSessionsForHost(String hostURL)
          Invalidate any sessions for a specific host URL.
 void registerListener(IWSSessionListener sessionListener)
          Register a new IWSSessionListener
 void unregisterListener(IWSSessionListener sessionListener)
          Unregister a IWSSessionListener
 void updateSessionPoolCredentials(IWSClientProxy clientProxy, AuthCredentials oldAuthCred, AuthCredentials newAuthCred)
          Update a session pool in the Session Manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSClientSessionManager

public WSClientSessionManager()
Method Detail

getSessionPool

public IWSClientSessionPool getSessionPool(IWSClientProxy clientProxy)
Specified by:
getSessionPool in interface IWSClientSessionManager

getSession

public IWSClientSession getSession(IWSClientProxy clientProxy)
Description copied from interface: IWSClientSessionManager
Given the current proxy, get or create a new session. This is an alternate mechanism that directly gets the session without retrieving an intermediate session pool object

Specified by:
getSession in interface IWSClientSessionManager
Parameters:
clientProxy - the IWSClientProxy proxy of the web service interface to invoke
Returns:
the IWSClientSession object associated with this proxy

updateSessionPoolCredentials

public void updateSessionPoolCredentials(IWSClientProxy clientProxy,
                                         AuthCredentials oldAuthCred,
                                         AuthCredentials newAuthCred)
Description copied from interface: IWSClientSessionManager
Update a session pool in the Session Manager. This method may be necessary when the ClientProxy associated with the session has updated it's AuthCredentials, as this info is used to uniquely identify the proxy when doing a session pool lookup

Specified by:
updateSessionPoolCredentials in interface IWSClientSessionManager
Parameters:
clientProxy - the IWSClientProxy proxy of the web service interface to invoke
oldAuthCred - the original AuthCredentials to update
newAuthCred - the new AuthCredentials for use by the session

registerListener

public void registerListener(IWSSessionListener sessionListener)
Description copied from interface: IWSClientSessionManager
Register a new IWSSessionListener

Specified by:
registerListener in interface IWSClientSessionManager

unregisterListener

public void unregisterListener(IWSSessionListener sessionListener)
Description copied from interface: IWSClientSessionManager
Unregister a IWSSessionListener

Specified by:
unregisterListener in interface IWSClientSessionManager

invalidateSessionsForHost

public void invalidateSessionsForHost(String hostURL)
Description copied from interface: IWSClientSessionManager
Invalidate any sessions for a specific host URL. NOTE: the default implementation calls this method when a transport level exception occurs with a web service invocation. This is to prevent further invocation failures when an existing session is later used on a sticky-session load balancer.

Specified by:
invalidateSessionsForHost in interface IWSClientSessionManager

clearAllSessions

public void clearAllSessions()
Description copied from interface: IWSClientSessionManager
Allows you to clear out all sessions

Specified by:
clearAllSessions in interface IWSClientSessionManager

fireOnProxyContextCreated

public void fireOnProxyContextCreated(ProxyContext context)
Specified by:
fireOnProxyContextCreated in interface IWSClientSessionManager

fireOnSessionCreated

public void fireOnSessionCreated(IWSClientSession session)
Specified by:
fireOnSessionCreated in interface IWSClientSessionManager

getSessionPoolID

public static String getSessionPoolID(IWSClientProxy clientProxy)
Create a sessionPoolID based upon the endpoint and the authcredentials

Parameters:
clientProxy - the IWSClientProxy instance that will be invoked on this session

getSessionPoolID

protected static String getSessionPoolID(IWSClientProxy clientProxy,
                                         AuthCredentials authCredentials)

getAuthCredentials

protected static AuthCredentials getAuthCredentials(IWSClientProxy clientProxy)

getBrowserSessionID

protected static String getBrowserSessionID()