Class WSClientSession

java.lang.Object
com.webmethods.caf.wsclient.session.impl.WSClientSession
All Implemented Interfaces:
IWSClientSession

public class WSClientSession extends Object implements IWSClientSession
Wraps a Proxy context for sessions
  • Field Details

    • m_expired

      protected boolean m_expired
    • m_busy

      protected boolean m_busy
    • m_cookieInterceptor

      protected com.webmethods.caf.wsclient.session.impl.WSClientSession.CookieInterceptor m_cookieInterceptor
  • Constructor Details

    • WSClientSession

      public WSClientSession(IWSClientSessionPool clientSessionPool, AuthCredentials authCredentials, String hostURL, String id)
      Create a new session instance. This constructor is not commonly used, as sessions are usually constructed by a (@see IWSClientSessionPool.createSession())
      Parameters:
      clientSessionPool - the IWSClientSessionPool that manages this pool
      authCredentials - the AuthCredentials used to authenticate this session with web service provider
      hostURL - the web service endpoint URL as a string
      id - the session ID to assign to this session
    • WSClientSession

      public WSClientSession(IWSClientSessionPool clientSessionPool, AuthCredentials authCredentials, String hostURL, String id, boolean pooledSession)
      Create a new session instance. This constructor is not commonly used, as sessions are usually constructed by a (@see IWSClientSessionPool.createSession())
      Parameters:
      clientSessionPool - the IWSClientSessionPool that manages this pool
      authCredentials - the AuthCredentials used to authenticate this session with web service provider
      hostURL - the web service endpoint URL as a string
      id - the session ID to assign to this session
      pooledSession - whether this is a pooled session, if true any cookies returned by the call will subsequently used by other sessions sharing that pool
  • Method Details

    • getID

      public String getID()
      Description copied from interface: IWSClientSession
      The unique ID that describes this session
      Specified by:
      getID in interface IWSClientSession
    • getHostURL

      public String getHostURL()
      Description copied from interface: IWSClientSession
      Get the configured endPoint for this session (and ProxyContext)
      Specified by:
      getHostURL in interface IWSClientSession
      Returns:
      the endpoint URL of the web service to invoke
    • getProxyContext

      public electric.glue.context.ProxyContext getProxyContext()
      Description copied from interface: IWSClientSession
      Get the context created for this Session. Every time this is called, it will create a new proxy context
      Specified by:
      getProxyContext in interface IWSClientSession
    • isExpired

      public boolean isExpired()
      Description copied from interface: IWSClientSession
      Has this session been flagged for expiration
      Specified by:
      isExpired in interface IWSClientSession
      Returns:
      true if the session has expired
    • isBusy

      public boolean isBusy()
      Description copied from interface: IWSClientSession
      Is this session currently servicing a web service request
      Specified by:
      isBusy in interface IWSClientSession
      Returns:
      true if the session is busy and is not available to handle another request
    • setBusy

      public void setBusy(boolean newVal)
      Description copied from interface: IWSClientSession
      Mark this session as busy and not available to handle another request
      Specified by:
      setBusy in interface IWSClientSession
      Parameters:
      newVal - true if the session is busy
    • setAuthCredentials

      public void setAuthCredentials(AuthCredentials authCredentials)
      Description copied from interface: IWSClientSession
      Set the AuthCredentials of the session
      Specified by:
      setAuthCredentials in interface IWSClientSession
    • getAuthCredentials

      public AuthCredentials getAuthCredentials()
      Description copied from interface: IWSClientSession
      Get the AuthCredentials used by the session to authenicate web service requests.
      Specified by:
      getAuthCredentials in interface IWSClientSession
    • setExpired

      public void setExpired(boolean newVal)
      Description copied from interface: IWSClientSession
      Mark this session as expired
      Specified by:
      setExpired in interface IWSClientSession
      Parameters:
      newVal - true if this session is no longer valid
    • notEmptyString

      @Deprecated public static boolean notEmptyString(String str)
      Deprecated.
    • getSessionCookies

      public electric.http.cookies.ClientCookie[] getSessionCookies()
      Description copied from interface: IWSClientSession
      Get any the ClientCookie[] associated with this session
      Specified by:
      getSessionCookies in interface IWSClientSession
      Returns:
      ClientCookie[] or null
    • setSessionCookies

      public void setSessionCookies(electric.http.cookies.ClientCookie[] sessionCookies)
      Description copied from interface: IWSClientSession
      Set the session's client cookies
      Specified by:
      setSessionCookies in interface IWSClientSession
      Parameters:
      sessionCookies - - an array of ClientCookie objects
    • setSessionCookieMap

      public void setSessionCookieMap(Map<String,String> cookies)
      Description copied from interface: IWSClientSession
      set the cookies
      Specified by:
      setSessionCookieMap in interface IWSClientSession
      Parameters:
      cookies - as a map of strings
    • getSessionCookieMap

      public Map<String,String> getSessionCookieMap()
      Description copied from interface: IWSClientSession
      Retirve the session cookies as a map
      Specified by:
      getSessionCookieMap in interface IWSClientSession
      Returns:
      map of cookies
    • getContext

      public electric.util.Context getContext()