Interface ISession


  • public interface ISession
    Provides the Session interface.
    • Method Detail

      • getId

        java.util.UUID getId()
        Returns session id.
        Returns:
        the session id
      • createContext

        IContext createContext()
        Create a new context.
        Returns:
        the created context
      • createContext

        IContext createContext​(IContext.ExecutionType executionType)
        Create a new context for executionType.
        Parameters:
        executionType - the execution type for the context
        Returns:
        the created context
      • getUser

        IUser getUser​(IContext context)
        Returns the user for this session (if any).
        Parameters:
        context - the current context
        Returns:
        the user of this session if it exists, or null otherwise
      • getUserName

        java.lang.String getUserName()
        Returns the user name for this session.
        Returns:
        the user's name
      • getUserId

        IMendixIdentifier getUserId()
        Returns the used identifier for this session.
        Returns:
        the user's identifier
      • getUserRolesNames

        java.util.Set<java.lang.String> getUserRolesNames()
        Returns the user's role names for this session.
        Returns:
        the role names
      • getGrantableRoleNames

        java.util.Set<java.lang.String> getGrantableRoleNames()
        Returns the role names the user for this session can be granted.
        Returns:
        the role names
      • isSystemSession

        boolean isSystemSession()
        Returns whether this session is a system session.
        Returns:
        true if this session is a system session, false otherwise
      • getTimeZone

        java.util.TimeZone getTimeZone()
        Returns the time zone of this session's user.
        Returns:
        the time zone
      • setTimeZone

        void setTimeZone​(java.lang.Integer timezoneOffset)
        Overrides the timezone by a simple timezone based on an offset. Does not take into account daylight savings time. Used for setting timezone obtained from browser with Javascript.
        Parameters:
        timezoneOffset - the timezone offset in negative amount of minutes from UTC, like how Javascript supplies it. See http://www.w3schools.com/jsref/jsref_gettimezoneoffset.asp
      • getUserAgent

        java.lang.String getUserAgent()
        Returns the user agent for this session.
        Returns:
        the user agent
      • setUserAgent

        void setUserAgent​(java.lang.String userAgent)
        Sets the user agent for this session to userAgent.
        Parameters:
        userAgent - the user agent to set
      • isInteractive

        boolean isInteractive()
        Returns whether this session can be used interactively ('real' user), defaults to true.
        Returns:
        true if this session is interactive, false otherwise
      • destroy

        @Deprecated
        void destroy()
        Deprecated.
        Destroys this session, so that the garbage collector can reclaim memory held by this session. This will delete all auto-committed objects for this session (if any).

        This method has been deprecated and should not be called. Instead, Core.logout(ISession) should be called.

      • getMendixObject

        IMendixObject getMendixObject()
        Returns the IMendixObject for this session.
        Returns:
        the Mendix object
      • getLastActive

        java.util.Date getLastActive()
        Returns the last active date and time for this session.
        Returns:
        the last active date and time
      • getCsrfToken

        java.lang.String getCsrfToken()
        Returns the CSRF token for this session.
        Returns:
        the CSRF token