Interface WebSessionInfo

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean canChangePassword()
      Returns whether the password can be changed.
      void changePassword​(java.lang.String newP)
      Deprecated.
      void changePassword​(java.lang.String oldP, java.lang.String newP)
      Changes the password for the session.
      void clone​(WebIServerSession otherSession)
      Create an @WebIServerSession object based on the given @WebIServerSession.
      void closeSession()
      Closes the session used to communicate with the Intelligence Server.
      java.lang.String createIdentityToken​(int howMuchState)
      Create an identity token from an existing session to be shared across application
      java.util.Locale getDisplayLocale()
      Returns the display locale, which is meant to be used for the strings that will displayed to the user.
      WebObjectsFactory getFactory()
      Returns the WebObjectsFactory instance associated with the current WebSessionInfo instance.
      java.util.Locale getLocale()
      Returns the current locale setting used for number and date representations.
      int getLocaleID()
      Returns the current locale of this object in the format of a Windows locale ID.
      java.lang.String getLogin()
      Returns the current login property.
      java.lang.String getMasterSessionIdByRememberMeToken​(java.lang.String iToken)
      get the master session ID from the auth remember me token from the client as cookie
      int getRememberMeTimeout()
      get the auth remember me timeout for the master session Id
      java.lang.String getRememberMeToken()
      get the auth remember me token for the master session Id for the client to use as cookie
      java.lang.String getSessionID()
      Returns the session ID which is currently set on this object.
      java.lang.String getSessionID​(boolean create)
      Returns the session ID of this object.
      WebSessionInfoList getSessionList()
      This method will return the WebSessionInfoList object that this session belongs to.
      int getSessionType()
      Returns the type of session for this WebSessionInfo object.
      java.util.TimeZone getTimeZone()
      Returns the current time zone settings of this object.
      java.lang.String getTimeZoneID()
      Returns the current time zone settings of this object.
      WebObjectInfo getUserInfo()
      Retrieves the WebObjectInfo information about the user corresponding to this session.
      WebObjectInfo getUserInfo​(boolean populate)
      Retrieves the WebObjectInfo information about the user corresponding to this session.
      boolean isActive()
      This method will return whether the current session is the active session within its list.
      boolean isAlive()
      Returns true if the current session is alive on the I-Server.
      boolean isAlive​(boolean iExtendTimeout)
      Returns true if the current session is alive on the I-Server.
      boolean isDirty()
      Returns true if the session state changed since last restoreState call.
      boolean isRestoredFromIdToken()
      Get the boolean value indicating whether the session is being restored from identityToken.
      boolean isRestoredFromSessionRecovery()
      Get the boolean value indicating whether the session is being restored from session recovery filter.
      void reconnect()
      Creates a new session regardless of whether the current session is alive or not.
      void refresh()
      If the current session is alive does nothing, otherwise creates a new session.
      boolean restoreSessionState​(java.lang.String state, boolean encryptionEnabled)
      use restoreState(String) instead for most use cases.
      boolean restoreStateFromIdentityToken​(java.lang.String identityToken)
      Restore session from a previously created identity token
      java.lang.String saveSessionState​(int howMuchState, boolean encryptionEnabled)
      Use saveState(int) instead for most use cases.
      void setActive()
      This method will set the current session as the active session.
      void setDirty​(boolean value)
      Sets the dirty flag.
      void setDisplayLocale​(java.util.Locale displayLocale)
      Sets the display locale, which is meant to be used for the strings that will displayed to the user.
      void setLocale​(java.util.Locale locale)
      Configures the number and date locale setting of this object.
      void setLocaleID​(int localeID)
      Configures the number and date locale setting of this object as a Windows locale ID.
      void setLogin​(java.lang.String l)
      Sets the login which will be used in any methods which require that parameter while communicating with the Intelligence Server.
      void setPassword​(java.lang.String p)
      Sets the user password which will be passed to the backend Server when creating a session.
      void setRestoredFromIdToken​(boolean isRestoredFromIdToken)
      Set the boolean value indicating whether the session is being restored from identityToken.
      void setRestoredFromSessionRecovery​(boolean isRestoredFromSessionRecovery)
      Set the boolean value indicating whether the session is being restored from session recovery filter.
      void setSessionID​(java.lang.String sessionID)
      Sets the sesssion ID, which will be used to tell the backend Server the credentials of the currently logged-in user.
      void setTimeZone​(java.util.TimeZone timezone)
      Sets the current time zone settings of this object.
      void setTimeZoneID​(java.lang.String timezoneID)
      Sets the current time zone settings of this object.
      java.lang.String updateRememberMeToken​(java.lang.String iToken, java.lang.String iMasterSessionId)
      update the auth remember me token associated with the master session Id with a new token for the client to use as a cookie
    • Field Detail

      • DEFAULT_TIME_ZONE

        static final java.util.TimeZone DEFAULT_TIME_ZONE
    • Method Detail

      • getSessionType

        int getSessionType()
        Returns the type of session for this WebSessionInfo object.
        Returns:
        The type of session corresponding to EnumWebSessionType.
      • getSessionID

        java.lang.String getSessionID()
                               throws WebObjectsException
        Returns the session ID which is currently set on this object. When there is no session ID exists on this object, a new session ID will be created. The session ID is an identifier which is used in most communications to the server which tells the server the credentials of the user currently logged in. This value can be set manually by calling setSessionID, or will be automatically created from user's credentials provided in this object.
        Returns:
        The currently set session ID.
        Throws:
        WebObjectsException - Thrown when error occurs during get the session id.
        See Also:
        setSessionID(java.lang.String)
      • getSessionID

        java.lang.String getSessionID​(boolean create)
                               throws WebObjectsException
        Returns the session ID of this object. If create is set to false, this object will return its session ID as it is; if create is set to true, and there is no session ID exists, this object will create a new ID and return it. The session ID is an identifier which is used in most communications to the server which tells the server the credentials of the user currently logged in. This value can be set manually by calling setSessionID, or will be automatically created from user's credentials provided in this object.
        Returns:
        The currently set session ID.
        Throws:
        WebObjectsException - Thrown when error occurs during get the session id.
        See Also:
        setSessionID(java.lang.String)
      • getRememberMeTimeout

        int getRememberMeTimeout()
        get the auth remember me timeout for the master session Id
        Returns:
        the remember me timeout for the client to set as cookie maxAge, it returns null if the master session Id is not in the map
      • getRememberMeToken

        java.lang.String getRememberMeToken()
        get the auth remember me token for the master session Id for the client to use as cookie
        Returns:
        the auth remember me token for the client to use as cookie, it returns null if the master session Id is not in the map
      • getMasterSessionIdByRememberMeToken

        java.lang.String getMasterSessionIdByRememberMeToken​(java.lang.String iToken)
        get the master session ID from the auth remember me token from the client as cookie
        Parameters:
        iToken - the auth remember me token past in from client
        Returns:
        Agumented Maseter Session Id string, it returns null if the auth remember me token is not in the map
      • updateRememberMeToken

        java.lang.String updateRememberMeToken​(java.lang.String iToken,
                                               java.lang.String iMasterSessionId)
        update the auth remember me token associated with the master session Id with a new token for the client to use as a cookie
        Parameters:
        iToken - the auth remember me token past in from client
        iMasterSessionId - the master session Id in augmented string format, i.e., EB4EE159DB2847128BB2707A01771F0510.23.10.150:1033@34954$MASTER
        Returns:
        the new auth remember me token, it returns null if the auth remember me token is not in the map
      • setSessionID

        void setSessionID​(java.lang.String sessionID)
        Sets the sesssion ID, which will be used to tell the backend Server the credentials of the currently logged-in user.
        Parameters:
        sessionID - The session ID to be used when communicating with the server.
        See Also:
        getSessionID()
      • getLocaleID

        int getLocaleID()
        Returns the current locale of this object in the format of a Windows locale ID.
        Returns:
        The Windows locale ID which corresponds to the current locale of this object.
        See Also:
        setLocaleID(int)
      • setLocaleID

        void setLocaleID​(int localeID)
        Configures the number and date locale setting of this object as a Windows locale ID.
        Parameters:
        localeID - The locale ID of the current locale.
        See Also:
        getLocaleID()
      • getLocale

        java.util.Locale getLocale()
        Returns the current locale setting used for number and date representations.
        Returns:
        The number and date Locale.
        See Also:
        setLocale(Locale), setLocaleID(int)
      • setLocale

        void setLocale​(java.util.Locale locale)
        Configures the number and date locale setting of this object.
        Parameters:
        locale - The locale of the current object.
        See Also:
        getLocale()
      • getTimeZoneID

        java.lang.String getTimeZoneID()
        Returns the current time zone settings of this object. This time zone will be used to format any time related string.
        Returns:
        An int number, which represents current time zone ID. The available ID list can be retrieved by calling getAvailableTimeZoneIDs() from DateTimeConverter object.
      • setTimeZoneID

        void setTimeZoneID​(java.lang.String timezoneID)
        Sets the current time zone settings of this object. This time zone will be used to format any time related string.
        Parameters:
        timezoneID - The ID for the time zone. The available time zone ID list can be retrieved by calling getAvailableTimeZoneIDs() from DateTimeConverter object.
      • getTimeZone

        java.util.TimeZone getTimeZone()
        Returns the current time zone settings of this object. This time zone will be used to format any time related string.
        Returns:
        A TimeZone object for current time zone setting.
      • setTimeZone

        void setTimeZone​(java.util.TimeZone timezone)
        Sets the current time zone settings of this object. This time zone will be used to format any time related string.
        Parameters:
        timezone - The time zone to set.
      • getLogin

        java.lang.String getLogin()
        Returns the current login property. However, this property is typically not saved and restored in the web application lifecycle, and therefore may not be be available in other web pages after logging in. This value will be used in any methods which require a login to communicate with the Intelligence Server.
        Returns:
        The current login property.
        See Also:
        setLogin(java.lang.String)
      • setLogin

        void setLogin​(java.lang.String l)
        Sets the login which will be used in any methods which require that parameter while communicating with the Intelligence Server.
        Parameters:
        l - The login to use when communicating with the Intelligence Server.
        See Also:
        getLogin()
      • setPassword

        void setPassword​(java.lang.String p)
        Sets the user password which will be passed to the backend Server when creating a session.
        Parameters:
        password - The password to use when contacting the backend Server.
      • changePassword

        @Deprecated
        void changePassword​(java.lang.String newP)
                     throws WebObjectsException
        Deprecated.
        Changes the password that will be used in the session.
        Parameters:
        newP - The value of the new password.
        Throws:
        WebObjectsException - thrown if an error occured while changing the password.
      • changePassword

        void changePassword​(java.lang.String oldP,
                            java.lang.String newP)
                     throws WebObjectsException
        Changes the password for the session. This new password will be propagated to any sessions in the list which are in the same cluster and have the same login.
        Parameters:
        oldP - The old password. The user should be prompted for this before allowing a password change, even if they are
        newP -
        Throws:
        WebObjectsException
        Since:
        MicroStrategy Web 8.0.1
      • canChangePassword

        boolean canChangePassword()
        Returns whether the password can be changed.
        Returns:
        boolean true if the password can be changed through changePassword(java.lang.String) method.
        Since:
        MicroStrategy Web 8.0.0
      • closeSession

        void closeSession()
                   throws WebObjectsException
        Closes the session used to communicate with the Intelligence Server.
        Throws:
        WebObjectsException - thrown if the sessionID is invalid.
      • getUserInfo

        WebObjectInfo getUserInfo​(boolean populate)
                           throws WebObjectsException
        Retrieves the WebObjectInfo information about the user corresponding to this session. If uninitialized, and populate is false, null will be returned.
        Parameters:
        populate - whether to make a round trip to the Intelligence Server
        Throws:
        WebObjectsException - if the user information retrieval ended in an error condition on the I-Server.
      • isAlive

        boolean isAlive()
                 throws WebObjectsException
        Returns true if the current session is alive on the I-Server. Resolution is as follows:
        1. If no session ID exists, return false - no further action.
        2. Otherwise, check to see if we're connected to the I-Server. If not, we may connect if auto-connect is configured.
        3. Test connection to I-Server.
        4. If no error was encountered, we return true.
        Returns:
        true if the current session is alive on the I-Server.
        Throws:
        WebObjectsException
      • isAlive

        boolean isAlive​(boolean iExtendTimeout)
                 throws WebObjectsException
        Returns true if the current session is alive on the I-Server. Resolution is as follows:
        1. If no session ID exists, return false - no further action.
        2. Otherwise, check to see if we're connected to the I-Server. If not, we may connect if auto-connect is configured.
        3. Test connection to I-Server.
        4. If no error was encountered, we return true.
        Parameters:
        This - parameter gives the caller an option if it wants to extend the session time out or
        Returns:
        true if the current session is alive on the I-Server.
        Throws:
        WebObjectsException
      • isDirty

        boolean isDirty()
        Returns true if the session state changed since last restoreState call.
        Returns:
        true if the session state changed since last restoreState call.
      • setDirty

        void setDirty​(boolean value)
        Sets the dirty flag.
        Parameters:
        value - the flag value.
      • getDisplayLocale

        java.util.Locale getDisplayLocale()
        Returns the display locale, which is meant to be used for the strings that will displayed to the user. This is not the locale that is sent to the Intelligence Server when creating the session.
        Returns:
        The current display locale.
        Since:
        MicroStrategy Web 7.5.2
      • setDisplayLocale

        void setDisplayLocale​(java.util.Locale displayLocale)
        Sets the display locale, which is meant to be used for the strings that will displayed to the user. This is not the locale that is sent to the Intelligence Server when creating the session.
        Parameters:
        displayLocale - The java.util.Locale object representing the display locale.
        Since:
        MicroStrategy Web 7.5.2
      • getSessionList

        WebSessionInfoList getSessionList()
        This method will return the WebSessionInfoList object that this session belongs to. Every session has a 1:1 relationship with a session list object.
        Returns:
        The WebSessionInfoList object that this session belongs to.
        Since:
        MicroStrategy Web 8.0.1
      • setActive

        void setActive()
        This method will set the current session as the active session. This means that any requests to the Intelligence Server within the WebObjectsFactory linked with the owner WebSessionInfoList object will be sent using this session's information.
        Since:
        MicroStrategy Web 8.0.1
      • isActive

        boolean isActive()
        This method will return whether the current session is the active session within its list. The active session will be the session that is used for all Intelligence Server requests.
        Returns:
        True if this session is the active session, false otherwise.
        Since:
        MicroStrategy Web 8.0.1
      • saveSessionState

        java.lang.String saveSessionState​(int howMuchState,
                                          boolean encryptionEnabled)
        Use saveState(int) instead for most use cases. This method allows to override the default encryption option (mainly for internal use) while serializing session state This allows caller to use its own encryption later.
        Parameters:
        howMuchState - how much state information to save (EnumWebPersistableState).
        encryptionEnabled - whether to encrypt the data or not.
        Returns:
      • restoreSessionState

        boolean restoreSessionState​(java.lang.String state,
                                    boolean encryptionEnabled)
        use restoreState(String) instead for most use cases. This method allows to override the default encryption option while deserializing session state when serialization was done without encryption.
        Parameters:
        state -
        encryptionEnabled -
        Returns:
      • createIdentityToken

        java.lang.String createIdentityToken​(int howMuchState)
                                      throws WebObjectsException
        Create an identity token from an existing session to be shared across application
        Parameters:
        howMuchState -
        Returns:
        Throws:
        WebObjectsException
      • restoreStateFromIdentityToken

        boolean restoreStateFromIdentityToken​(java.lang.String identityToken)
                                       throws WebObjectsException
        Restore session from a previously created identity token
        Parameters:
        identityToken -
        Returns:
        Throws:
        WebObjectsException
      • isRestoredFromIdToken

        boolean isRestoredFromIdToken()
        Get the boolean value indicating whether the session is being restored from identityToken. If so, in the webAppManagerImpl.java, we will not check the enabledLoginMode
        Returns:
      • setRestoredFromIdToken

        void setRestoredFromIdToken​(boolean isRestoredFromIdToken)
        Set the boolean value indicating whether the session is being restored from identityToken. If so, in the webAppManagerImpl.java, we will not check the enabledLoginMode
        Parameters:
        isRestoredFromIdToken -
      • isRestoredFromSessionRecovery

        boolean isRestoredFromSessionRecovery()
        Get the boolean value indicating whether the session is being restored from session recovery filter. If so, in the WebAppSessionManagerImpl.java, we will not close the session
        Returns:
      • setRestoredFromSessionRecovery

        void setRestoredFromSessionRecovery​(boolean isRestoredFromSessionRecovery)
        Set the boolean value indicating whether the session is being restored from session recovery filter. If so, in the WebAppSessionManagerImpl.java, we will not close the session