Class User

  • All Implemented Interfaces:
    Serializable

    public class User
    extends PersistentObject
    implements Serializable
    This class represents a user. A user can be member of any number of groups, but it is always member of a special group named '_user_'+id. When a new user is created this special group of type 'user' is also created.
    Version:
    1.0
    Author:
    Michael Scholz, Marco Meschieri
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_DEFAULT

        public static int TYPE_DEFAULT
      • TYPE_SYSTEM

        public static int TYPE_SYSTEM
      • TYPE_READONLY

        public static int TYPE_READONLY
      • SOURCE_DEFAULT

        public static int SOURCE_DEFAULT
      • SOURCE_LDAP

        public static int SOURCE_LDAP
    • Constructor Detail

      • User

        public User()
    • Method Detail

      • getType

        public int getType()
      • setType

        public void setType​(int type)
      • getRepass

        public String getRepass()
      • setRepass

        public void setRepass​(String repass)
      • getUsername

        public String getUsername()
      • getPassword

        public String getPassword()
      • getName

        public String getName()
      • getFullName

        public String getFullName()
      • getInitials

        public String getInitials()
      • getFirstName

        public String getFirstName()
      • getStreet

        public String getStreet()
      • getPostalcode

        public String getPostalcode()
      • getCity

        public String getCity()
      • getCountry

        public String getCountry()
      • getLanguage

        public String getLanguage()
      • getEmail

        public String getEmail()
      • getTelephone

        public String getTelephone()
      • getGroupIds

        public long[] getGroupIds()
      • getGroupNames

        public String[] getGroupNames()
      • isMemberOf

        public boolean isMemberOf​(String groupName)
      • addGroup

        public void addGroup​(Group group)
      • removeGroup

        public void removeGroup​(long groupId)
      • removeGroupMemberships

        public void removeGroupMemberships​(String source)
        Removes the user from All groups except it's user's own group. You can restrict the deletion to a specified source
        Parameters:
        source - the source
      • setUsername

        public void setUsername​(String uname)
      • setPassword

        public void setPassword​(String pwd)
      • setDecodedPassword

        public void setDecodedPassword​(String pwd)
        Sets the password and encode it
        Parameters:
        pwd - The password in readable format
      • setName

        public void setName​(String name)
      • setFirstName

        public void setFirstName​(String firstName)
      • setStreet

        public void setStreet​(String str)
      • setPostalcode

        public void setPostalcode​(String pc)
      • setCity

        public void setCity​(String ct)
      • setCountry

        public void setCountry​(String cnt)
      • setLanguage

        public void setLanguage​(String lang)
      • setEmail

        public void setEmail​(String mail)
      • setTelephone

        public void setTelephone​(String phone)
      • reset

        public void reset()
      • getGroups

        public Set<Group> getGroups()
      • setGroups

        public void setGroups​(Set<Group> groups)
      • getUserGroupName

        public String getUserGroupName()
        The name of the group associated to this user, that is '_user_'+id
        Returns:
        name of the group that represents this user
      • getUserGroup

        public Group getUserGroup()
        Retrieves this user's group
        Returns:
        the group
      • getEnabled

        public int getEnabled()
      • setEnabled

        public void setEnabled​(int enabled)
      • getState

        public String getState()
      • setState

        public void setState​(String state)
      • getTelephone2

        public String getTelephone2()
      • setTelephone2

        public void setTelephone2​(String telephone2)
      • getLocale

        public Locale getLocale()
      • setLocale

        public void setLocale​(Locale locale)
      • getPasswordChanged

        public Date getPasswordChanged()
        When the password was modified
        Returns:
        when the password has been altered
      • setPasswordChanged

        public void setPasswordChanged​(Date passwordChanged)
      • getPasswordExpires

        public int getPasswordExpires()
        If the password expires or not
        Returns:
        1 if the password expires, 0 otherwise
      • setPasswordExpires

        public void setPasswordExpires​(int passwordExpires)
      • getSource

        public int getSource()
        The source from which the user has been created
        Returns:
        the source
        See Also:
        SOURCE_DEFAULT, SOURCE_LDAP
      • setSource

        public void setSource​(int source)
      • getQuota

        public long getQuota()
      • setQuota

        public void setQuota​(long quota)
      • getWelcomeScreen

        public Integer getWelcomeScreen()
      • setWelcomeScreen

        public void setWelcomeScreen​(Integer welcomeScreen)
      • getIpWhiteList

        public String getIpWhiteList()
      • setIpWhiteList

        public void setIpWhiteList​(String ipWhiteList)
      • getIpBlackList

        public String getIpBlackList()
      • setIpBlackList

        public void setIpBlackList​(String ipBlackList)
      • getPasswordExpired

        public int getPasswordExpired()
      • setPasswordExpired

        public void setPasswordExpired​(int passwordExpired)
      • getPasswordmd4

        public String getPasswordmd4()
      • setPasswordmd4

        public void setPasswordmd4​(String passwordmd4)
      • getDecodedPassword

        public String getDecodedPassword()
      • getEmailSignature

        public String getEmailSignature()
      • setEmailSignature

        public void setEmailSignature​(String emailSignature)
      • clearPassword

        public void clearPassword()
      • getDefaultWorkspace

        public Long getDefaultWorkspace()
      • setDefaultWorkspace

        public void setDefaultWorkspace​(Long defaultWorkspace)
      • getEmail2

        public String getEmail2()
      • setEmail2

        public void setEmail2​(String email2)
      • getEmailSignature2

        public String getEmailSignature2()
      • setEmailSignature2

        public void setEmailSignature2​(String emailSignature2)
      • setUserGroups

        public void setUserGroups​(Set<UserGroup> userGroups)
      • getCertExpire

        public Date getCertExpire()
      • setCertExpire

        public void setCertExpire​(Date certExpire)
      • getCertDN

        public String getCertDN()
      • setCertDN

        public void setCertDN​(String certDN)
      • getSecondFactor

        public String getSecondFactor()
      • setSecondFactor

        public void setSecondFactor​(String secondFactor)
      • getKey

        public String getKey()
      • setKey

        public void setKey​(String key)
      • isReadonly

        public boolean isReadonly()
      • getCreation

        public Date getCreation()
      • setCreation

        public void setCreation​(Date creation)
      • getDocsGrid

        public String getDocsGrid()
      • setDocsGrid

        public void setDocsGrid​(String docsGrid)
      • getHitsGrid

        public String getHitsGrid()
      • setHitsGrid

        public void setHitsGrid​(String hitsGrid)
      • getAvatar

        public String getAvatar()
      • setAvatar

        public void setAvatar​(String avatar)
      • getDateFormat

        public String getDateFormat()
      • setDateFormat

        public void setDateFormat​(String dateFormat)
      • getDateFormatShort

        public String getDateFormatShort()
      • setDateFormatShort

        public void setDateFormatShort​(String dateFormatShort)
      • getDateFormatLong

        public String getDateFormatLong()
      • setDateFormatLong

        public void setDateFormatLong​(String dateFormatLong)
      • getSearchPref

        public String getSearchPref()
      • setSearchPref

        public void setSearchPref​(String searchPref)
      • getExpire

        public Date getExpire()
      • setExpire

        public void setExpire​(Date expire)
      • getLastEnabled

        public Date getLastEnabled()
      • setLastEnabled

        public void setLastEnabled​(Date lastEnabled)
      • isExpired

        public boolean isExpired()
        Checks if the user is expired now
        Returns:
        true only if an expiration date has been specified and the current date is after it
      • isInWorkingTime

        public boolean isInWorkingTime()
        Checks if the user falls in his working time
        Returns:
        true only if at least a working time slot matches the current time
      • getEnforceWorkingTime

        public int getEnforceWorkingTime()
      • setEnforceWorkingTime

        public void setEnforceWorkingTime​(int enforceWorkingTime)
      • setWorkingTimes

        public void setWorkingTimes​(Set<WorkingTime> workingTimes)
      • getMaxInactivity

        public Integer getMaxInactivity()
      • setMaxInactivity

        public void setMaxInactivity​(Integer maxInactivity)
      • getTimeZone

        public String getTimeZone()
      • setTimeZone

        public void setTimeZone​(String timeZone)