psdi.webclient.system.session

Class WebClientSessionFactory

  • java.lang.Object
    • psdi.webclient.system.session.WebClientSessionFactory


  • public class WebClientSessionFactory
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void cleanupDiscardedSessions()
      This method calls cleanup on all discarded WebClientSessions and clears the list of discarded WebClientSessions
      WebClientSession createSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Creates a new WebClientSession and returns it and also adds the WebClientSession to the WebClientSessionManager stored in the request's HttpSession(stored as a session attribute).
      static WebClientSessionFactory getWebClientSessionFactory()
      Factory method that returns a reference to a WebClientFactory singleton object.
      boolean hasAvailableSessions()
      Returns a boolean on whether or not the factory can create a new session.
      void killSessions()
      Removes and closes all WebCientSessions.
      int sessionCount()
      Returns the total number of WebClientSessions (valid or invalid) in the factory list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getWebClientSessionFactory

        public static WebClientSessionFactory getWebClientSessionFactory()
        Factory method that returns a reference to a WebClientFactory singleton object. If the statically stored WebClientFactory is null a new one is created and returned. Repository
      • hasAvailableSessions

        @TracePrimary
        public boolean hasAvailableSessions()
        Returns a boolean on whether or not the factory can create a new session. Will return true if the number of active WebClientSessions are below the maximum session threshold. By default the threshold is 75 but can be overridden by the webclient.properties property webclient.maxuisessions. This method will loop through the list of sessions and remove any invalid WebClientSessions
        Returns:
        true/false
      • createSession

        public WebClientSession createSession(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response)
        Creates a new WebClientSession and returns it and also adds the WebClientSession to the WebClientSessionManager stored in the request's HttpSession(stored as a session attribute). If the HttpSession doesn't have a WebClientSessionManager this method will create one and add it to the HttpSession. If the request has a predefined uisession id (has a uisessionid parameter), this method will also throw an MXException if the WebClientSessionManager already has a WebClientSession with that same uisessionid. This should never happen but there is a very minimal chance that a user could have two browser windows sharing the same HttpSession and use the same url with a uisessionid at the same time.
        Parameters:
        request -
        response -
        Returns:
        Throws:
        MXException
      • sessionCount

        public int sessionCount()
        Returns the total number of WebClientSessions (valid or invalid) in the factory list. If you only want the count of valid sessions, call hasAvailableSessions first as that method will remove any invalid WCS.
        Returns:
      • killSessions

        public void killSessions()
        Removes and closes all WebCientSessions.
        Parameters:
        sessionId -
      • cleanupDiscardedSessions

        public void cleanupDiscardedSessions()
        This method calls cleanup on all discarded WebClientSessions and clears the list of discarded WebClientSessions