Class SessionService


  • @Singleton
    public class SessionService
    extends Object
    This class represents a Session Service.
    • Method Detail

      • newInternalSession

        public InternalSession newInternalSession​(String domain,
                                                  boolean stateless,
                                                  boolean checkCts)
      • destroySession

        public void destroySession​(Session requester,
                                   SessionID sessionToDestroy)
                            throws SessionException
        Destroy a Internal Session, depending on the value of the user's permissions. Performs no action if the sessionID cannot be matched.
        Parameters:
        requester - The requesting Session.
        sessionToDestroy - The session to destroy.
        Throws:
        SessionException - If the user has insufficient permissions.
      • destroyAuthenticationSession

        public void destroyAuthenticationSession​(SessionID sessionID)
        Destroy a Internal Session, whose session id has been specified.
        Parameters:
        sessionID -
      • checkSessionExists

        public boolean checkSessionExists​(SessionID sessionId)
                                   throws SessionException
        Check whether a session identified by {code sessionId} can be retrieved.
        Parameters:
        sessionId - the session ID to check.
        Returns:
        returns true if the session is local
        Throws:
        SessionException - if the session could not be accessed.
      • getMatchingSessions

        public Collection<PartialSession> getMatchingSessions​(Session caller,
                                                              CrestQuery crestQuery)
                                                       throws SessionException
        Returns partial (stateful) sessions matching the provided CREST query. The resultset size is limited by the "iplanet-am-session-max-session-list-size" attribute. The returned sessions are only "partial" sessions, meaning that they do not represent the full session state.
        Parameters:
        caller - The session that initiated the query request. May not be null.
        crestQuery - The CREST query based on which we should look for matching sessions. May not be null.
        Returns:
        The collection of matching partial sessions.
        Throws:
        SessionException - If the request fails.
        See Also:
        SessionOperations.getMatchingSessions(CrestQuery)
      • addSessionListener

        public void addSessionListener​(Session session,
                                       String url)
                                throws SessionException
        Adds listener to a Internal Sessions.
        Parameters:
        session - Session
        url -
        Throws:
        SessionException - Session is null OR the Session is invalid
      • setExternalProperty

        public void setExternalProperty​(SSOToken clientToken,
                                        SessionID sessionId,
                                        String name,
                                        String value)
                                 throws SessionException
        Sets external property in the Internal Session as long as it is not protected
        Parameters:
        clientToken - - Token of the client setting external property.
        sessionId -
        name -
        value -
        Throws:
        SessionException
      • isSuperUser

        public boolean isSuperUser​(String uuid)
        Returns true if the user is super user
        Parameters:
        uuid - the uuid of the login user
      • getAMServerID

        public static String getAMServerID()
        Gets the AM Server ID.
        Returns:
        the AM Server Id or null if WebtopNaming was unable to detmin the ID of this server.