Class User

  • All Implemented Interfaces:
    java.io.Serializable

    public class User
    extends java.lang.Object
    implements java.io.Serializable
    Bean used to store user-information in the current session.
    See Also:
    Serialized Form
    • Constructor Detail

      • User

        public User​(com.saperion.users.UserName userName,
                    int uid,
                    boolean isPresent,
                    AuthenticationInformation auth,
                    com.saperion.users.UserFlags userFlags,
                    int mandantId)
        Literal constructor.
        Parameters:
        userName - The users name
        uid - The users unique id
        isPresent - Whether the user is present
        auth - The information how the user logged in.
        mandantId - MandantId
        userFlags - flags for the user
      • User

        public User​(com.saperion.intf.SaUserInfo userInfo,
                    AuthenticationInformation auth)
        Creates a new user from a userinfo object.
        Parameters:
        userInfo - detailed user information
        auth - The information how the user logged in
      • User

        public User​(AuthenticationInformation auth)
        Creates a new user with only the authentication information set.
        Parameters:
        auth - authentication information
    • Method Detail

      • getName

        public com.saperion.users.UserName getName()
        Returns:
        the name of the user
      • getId

        public int getId()
        Returns:
        the unique id of the user
      • getMandantId

        public int getMandantId()
        Returns:
        the unique id of the mandant
      • isPresent

        public boolean isPresent()
        Returns:
        whether the user is present
      • setPresent

        public void setPresent​(boolean isPresent)
        Sets the present-property.
        Parameters:
        isPresent - if the user is present or not
      • getAuthenticationInformation

        public AuthenticationInformation getAuthenticationInformation()
        Returns:
        the information how the user logged in
      • getFlags

        public com.saperion.users.UserFlags getFlags()
        Returns:
        detailed information about user options
      • invalidUser

        public static User invalidUser()
        Returns:
        an invalid user instance
      • mergeShortName

        public User mergeShortName​(java.lang.String shortName)
        Parameters:
        shortName - the new short name
        Returns:
        an User instance that equals this in every member expcept the displayname (and the login name) which is given.
      • mergePassword

        public User mergePassword​(java.lang.String newPassword)
        Parameters:
        newPassword - The new password
        Returns:
        A User instance that equals is in every member except for the password.
      • setWfAllowSubstAccess

        public void setWfAllowSubstAccess​(boolean accessEnabled)
        Sets whether the user's substitute has access to the users workflow-inbox.
        Parameters:
        accessEnabled - if the substitute has access
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isTechnical

        public boolean isTechnical()
        Returns:
        true if this is a technical user
      • setTechnical

        public void setTechnical​(boolean technical)
        Sets the technical property.
        Parameters:
        technical - set to true if this is a technical user
      • getCurrentSession

        public com.saperion.connector.authentication.Session getCurrentSession()
        Returns:
        The current user session
      • setCurrentSession

        public void setCurrentSession​(com.saperion.connector.authentication.Session currentSession)
        Set the current session
        Parameters:
        currentSession -
      • getActiveSessions

        public java.util.List<com.saperion.connector.authentication.Session> getActiveSessions()
        Returns:
        The other active Sessions of the user
      • addActiveSession

        public void addActiveSession​(com.saperion.connector.authentication.Session activeSession)
        Add the given Session to active session list
        Parameters:
        activeSession -