psdi.webclient.system.session

Class WebClientSessionManager

  • java.lang.Object
    • psdi.webclient.system.session.WebClientSessionManager
  • All Implemented Interfaces:
    java.io.Serializable, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener


    public class WebClientSessionManager
    extends java.lang.Object
    implements javax.servlet.http.HttpSessionBindingListener, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • WebClientSessionManager

        public WebClientSessionManager()
    • Method Detail

      • getWebClientSessionManager

        public static WebClientSessionManager getWebClientSessionManager(javax.servlet.http.HttpSession session)
        Return the WebClientSessionManager for the passed in HttpSession if it has one. If it doesn't, it will return null, and also means the HtpSession has no WebClientSessions
      • hasSessions

        public boolean hasSessions()
        Returns a boolean true if the manager has any valid WebClientSessions and false if it doesn't
        Returns:
      • hasMultipleSessions

        public boolean hasMultipleSessions()
        Returns a boolean true if the manager has more than one valid WebClientSessions and false if it doesn't
        Returns:
      • getWebClientSession

        public WebClientSession getWebClientSession(java.lang.String uisessionid)
        Returns the WebClientSession associated with a particular id
        Parameters:
        uisessionid - - id to look for
        Returns:
        WebClientSession if found or null
      • getWebClientSessionIds

        public java.lang.String[] getWebClientSessionIds()
        Returns an array of WebClientSession Ids being managed
      • getWebClientSession

        public WebClientSession getWebClientSession(javax.servlet.http.HttpServletRequest request)
                                             throws MXException
        Returns the WebClientSession associated with the request. Will return null if the request doesn't have a uisessionid or the manager doesn't have a WebClientSession for the associated uisessionid. Throws an MXException if the WebClientSession timed out.
        Parameters:
        request - - HttpServletRequest used to get the uisessionid
        Returns:
        WebClientSession if found or null
        Throws:
        MXExcption - if WebClientSession timed out.
        MXException
      • removeWebClientSession

        public boolean removeWebClientSession(WebClientSession wcs)
        Removes the passed in WebClientSession from the session list and closes it, The WebclientSession is removed from the master list of WebClientSession in he WebClientSessionFactory
        Parameters:
        wcs -
        Returns:
      • removeWebClientSession

        public boolean removeWebClientSession(WebClientSession wcs,
                                              boolean closeSession)
      • valueBound

        public void valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
        Specified by:
        valueBound in interface javax.servlet.http.HttpSessionBindingListener
      • valueUnbound

        public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
        Specified by:
        valueUnbound in interface javax.servlet.http.HttpSessionBindingListener
      • preserveMXSession

        public void preserveMXSession()
      • hasAvailableSessions

        public boolean hasAvailableSessions()
        Returns true if the total number of WebClientSession in this WebClientSessionManager is less than the maximum number of sessions allowed per HttpSession. The maximum number allowed is defined by the system property mxe.webclient.maxUiSessionPerHttpSession. If the property doesn't exist the default is 10.
      • getWebClientSessionCount

        public int getWebClientSessionCount()
      • getSessionInvalidated

        public boolean getSessionInvalidated()
      • setLostSessionId

        public void setLostSessionId(java.lang.String lostSessionId)