Class WSClientSessionManager
java.lang.Object
com.webmethods.caf.wsclient.session.impl.WSClientSessionManager
- All Implemented Interfaces:
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Allows you to clear out all sessionsvoid
fireOnProxyContextCreated
(electric.glue.context.ProxyContext context) void
fireOnSessionCreated
(IWSClientSession session) protected static AuthCredentials
getAuthCredentials
(IWSClientProxy clientProxy) protected static String
getSession
(IWSClientProxy clientProxy) Given the current proxy, get or create a new session.getSessionPool
(IWSClientProxy clientProxy) getSessionPool
(IWSClientProxy clientProxy, String userAgent) static String
getSessionPoolID
(IWSClientProxy clientProxy) protected static String
getSessionPoolID
(IWSClientProxy clientProxy, AuthCredentials authCredentials, String userAgent) static String
getSessionPoolID
(IWSClientProxy clientProxy, String userAgent) Create a sessionPoolID based upon the endpoint and the authcredentialsvoid
invalidateSessionsForHost
(String hostURL) Invalidate any sessions for a specific host URL.void
registerListener
(IWSSessionListener sessionListener) Register a newIWSSessionListener
void
unregisterListener
(IWSSessionListener sessionListener) Unregister aIWSSessionListener
void
updateSessionPoolCredentials
(IWSClientProxy clientProxy, AuthCredentials oldAuthCred, AuthCredentials newAuthCred) Update a session pool in the Session Manager.
-
Constructor Details
-
WSClientSessionManager
public WSClientSessionManager()
-
-
Method Details
-
getSessionPool
- Specified by:
getSessionPool
in interfaceIWSClientSessionManager
-
getSessionPool
- Specified by:
getSessionPool
in interfaceIWSClientSessionManager
- Parameters:
clientProxy
- theIWSClientProxy
proxy of the web service interface to invokeuserAgent
- Axis2 or Glue- Returns:
-
getSession
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 interfaceIWSClientSessionManager
- Parameters:
clientProxy
- theIWSClientProxy
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 interfaceIWSClientSessionManager
- Parameters:
clientProxy
- theIWSClientProxy
proxy of the web service interface to invokeoldAuthCred
- the originalAuthCredentials
to updatenewAuthCred
- the newAuthCredentials
for use by the session
-
registerListener
Description copied from interface:IWSClientSessionManager
Register a newIWSSessionListener
- Specified by:
registerListener
in interfaceIWSClientSessionManager
-
unregisterListener
Description copied from interface:IWSClientSessionManager
Unregister aIWSSessionListener
- Specified by:
unregisterListener
in interfaceIWSClientSessionManager
-
invalidateSessionsForHost
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 interfaceIWSClientSessionManager
-
clearAllSessions
public void clearAllSessions()Description copied from interface:IWSClientSessionManager
Allows you to clear out all sessions- Specified by:
clearAllSessions
in interfaceIWSClientSessionManager
-
fireOnProxyContextCreated
public void fireOnProxyContextCreated(electric.glue.context.ProxyContext context) - Specified by:
fireOnProxyContextCreated
in interfaceIWSClientSessionManager
-
fireOnSessionCreated
- Specified by:
fireOnSessionCreated
in interfaceIWSClientSessionManager
-
getSessionPoolID
-
getSessionPoolID
Create a sessionPoolID based upon the endpoint and the authcredentials- Parameters:
clientProxy
- theIWSClientProxy
instance that will be invoked on this session
-
getSessionPoolID
protected static String getSessionPoolID(IWSClientProxy clientProxy, AuthCredentials authCredentials, String userAgent) -
getAuthCredentials
-
getBrowserSessionID
-