Class SessionManagerImpl

All Implemented Interfaces:
MOMRegistrationAware

public class SessionManagerImpl extends SessionManager
In memory implementation of SessionManager
Author:
Mike Grogan
  • Constructor Details

    • SessionManagerImpl

      public SessionManagerImpl(WSEndpoint endpoint, boolean isSC)
      Creates a new instance of SessionManagerImpl
    • SessionManagerImpl

      public SessionManagerImpl(WSEndpoint endpoint, boolean isSC, Properties config)
      Creates a new instance of SessionManagerImpl
  • Method Details

    • getSession

      public Session getSession(String key)
      Returns an existing session identified by the Key else null
      Specified by:
      getSession in class SessionManager
      Parameters:
      key - The Session key.
      Returns:
      The Session with the given key. null if none exists.
    • keys

      public Set<String> keys()
      Returns the Set of valid Session keys.
      Specified by:
      keys in class SessionManager
      Returns:
      The Set of keys.
    • sessions

      protected Collection<Session> sessions()
      Specified by:
      sessions in class SessionManager
      Returns:
      The Collection of valid Sessions.
    • terminateSession

      public void terminateSession(String key)
      Removed the Session with the given key.
      Specified by:
      terminateSession in class SessionManager
      Parameters:
      key - The key of the Session to be removed.
    • createSession

      public Session createSession(String key, Class<?> clasz)
      Creates a Session with the given key, using a new instance of the specified Class as a holder for user-defined data. The specified Class must have a default constructor.
      Specified by:
      createSession in class SessionManager
      Parameters:
      key - The Session key to be used.
      Returns:
      The new Session.. null if the given class cannot be instantiated.
    • createSession

      public Session createSession(String key, Object obj)
      Creates a Session with the given key, using the specified Object as a holder for user-defined data.
      Specified by:
      createSession in class SessionManager
      Parameters:
      key - The Session key to be used.
      obj - The object to use as a holder for user data in the session.
      Returns:
      The new Session.
    • createSession

      public Session createSession(String key, SecurityContextTokenInfo sctInfo)
      Specified by:
      createSession in class SessionManager
    • createSession

      public Session createSession(String key)
      Creates a Session with the given key, using an instance of synchronized java.util.Map<String, String> a sa holder for user-defined data.
      Specified by:
      createSession in class SessionManager
      Parameters:
      key - The Session key to be used.
      Returns:
      The new Session.
    • saveSession

      public void saveSession(String key)
      Does nothing in this implementation.
      Specified by:
      saveSession in class SessionManager
      Parameters:
      key - The key of the session to be saved
    • getSecurityContext

      public IssuedTokenContext getSecurityContext(String key, boolean checkExpiry)
      Return the valid SecurityContext for matching key
      Specified by:
      getSecurityContext in class SessionManager
      Parameters:
      key - The key of the security context to be looked
      checkExpiry - indicates whether to check the token expiry or not, As in case of renew we don't need to check token expiry
      Returns:
      IssuedTokenContext for security context key
    • addSecurityContext

      public void addSecurityContext(String key, IssuedTokenContext itctx)
      Add the SecurityContext with key in local cache
      Specified by:
      addSecurityContext in class SessionManager
      Parameters:
      key - The key of the security context to be stored
      itctx - The IssuedTokenContext to be stored