Class SessionManager

  • All Implemented Interfaces:
    com.sun.xml.ws.commons.MOMRegistrationAware
    Direct Known Subclasses:
    SessionManagerImpl

    @ManagedObject
    @Description("Session manager used by RM and SC")
    @AMXMetadata(type="WSRMSCSessionManager")
    public abstract class SessionManager
    extends com.sun.xml.ws.commons.AbstractMOMRegistrationAware
    The SessionManager is used to obtain session information This can be implemented using persistent storage mechanisms or using transient storage Even if it is implemented using persistent storage the implementation should take care of backing by a cache which will avoid the overhead of serialization and database operations

    Additionally the SessionManager is responsible for managing the life cycle events for the sessions. It exposes methods to create and terminate the session Periodically the SessionManager will check for sessions who have been inactive for a predefined amount of time and then will terminate those sessions

    Author:
    Bhakti Mehta, Mike Grogan
    • Constructor Detail

      • SessionManager

        public SessionManager()
    • Method Detail

      • getConfig

        public static Properties getConfig()
        Returns:
        the config
      • setConfig

        public static void setConfig​(Properties aConfig)
        Parameters:
        aConfig - the config to set
      • getSession

        public abstract Session getSession​(String key)
        Returns an existing session identified by the Key else null
        Parameters:
        key - The Session key.
      • keys

        @ManagedAttribute
        @Description("The set of valid Session keys")
        public abstract Set<String> keys()
        Returns the Set of valid Session keys.
      • sessions

        @ManagedAttribute
        @Description("The collection of valid Sessions")
        protected abstract Collection<Session> sessions()
      • terminateSession

        public abstract void terminateSession​(String key)
        Removed the Session with the given key.
        Parameters:
        key - The key of the Session to be removed.
      • createSession

        public abstract 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 ctor.
        Parameters:
        key - The Session key to be used.
      • createSession

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

        public abstract Session createSession​(String key,
                                              com.sun.xml.ws.security.SecurityContextTokenInfo sctInfo)
      • createSession

        public abstract Session createSession​(String key)
        Creates a Session with the given key, using an instance of java.util.Hashtable asa holder for user-defined data.
        Parameters:
        key - The Session key to be used.
      • saveSession

        public abstract void saveSession​(String key)
        Saves the state of the Session with the given key.
        Parameters:
        key - The key of the session to be saved
      • getSecurityContext

        public abstract com.sun.xml.ws.security.IssuedTokenContext getSecurityContext​(String key,
                                                                                      boolean checkExpiry)
        Return the valid SecurityContext for matching key
        Parameters:
        key - The key of the security context to be looked
        expiryCheck - indicates whether to check the token expiry or not, As in case of renew we don't need to check token expiry
      • addSecurityContext

        public abstract void addSecurityContext​(String key,
                                                com.sun.xml.ws.security.IssuedTokenContext itctx)
        Add the SecurityContext with key in local cache
        Parameters:
        key - The key of the security context to be stored
        itctx - The IssuedTokenContext to be stored
      • removeSessionManager

        public static void removeSessionManager​(com.sun.xml.ws.api.server.WSEndpoint endpoint)
      • getSessionManager

        public static SessionManager getSessionManager​(com.sun.xml.ws.api.server.WSEndpoint endpoint,
                                                       boolean isSC,
                                                       Properties props)
        Returns the single instance of SessionManager Use the usual services mechanism to find implementing class. If not found, use com.sun.xml.ws.runtime.util.SessionManager by default.
        Returns:
        The value of the manager field.
      • getSessionManager

        public static SessionManager getSessionManager​(com.sun.xml.ws.api.server.WSEndpoint endpoint,
                                                       Properties props)