Class User
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.security.user.User
- All Implemented Interfaces:
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:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final long
static final long
Fields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
getCity()
getEmail()
int
int
getKey()
getName()
When the password was modifiedint
int
If the password expires or notlong
getQuota()
int
The source from which the user has been createdgetState()
int
getType()
Retrieves this user's groupThe name of the group associated to this user, that is '_user_'+idboolean
isAdmin()
Checks if the user is member of the admin groupboolean
Checks if the user is expired nowboolean
Checks if the user falls in his working timeboolean
isMemberOf
(String groupName) boolean
void
removeGroup
(long groupId) void
removeGroupMemberships
(String source) Removes the user from All groups except it's user's own group.void
reset()
void
void
setBuilding
(String building) void
void
setCertExpire
(Date certExpire) void
void
setCompany
(String company) void
setCountry
(String cnt) void
setDateFormat
(String dateFormat) void
setDateFormatLong
(String dateFormatLong) void
setDateFormatShort
(String dateFormatShort) void
setDecodedPassword
(String pwd) Sets the password and encode itvoid
setDefaultWorkspace
(Long defaultWorkspace) void
setDepartment
(String department) void
setDocsGrid
(String docsGrid) void
void
void
setEmailSignature
(String emailSignature) void
setEmailSignature2
(String emailSignature2) void
setEnabled
(int enabled) void
setEnforceWorkingTime
(int enforceWorkingTime) void
void
setFirstName
(String firstName) void
void
setHitsGrid
(String hitsGrid) void
setIpBlackList
(String ipBlackList) void
setIpWhiteList
(String ipWhiteList) void
void
setLanguage
(String lang) void
setLastEnabled
(Date lastEnabled) void
setLastLogin
(Date lastLogin) void
void
setMaxInactivity
(Integer maxInactivity) void
void
setOrganizationalUnit
(String organizationalUnit) void
setPassword
(String pwd) void
setPasswordChanged
(Date passwordChanged) void
setPasswordExpired
(int passwordExpired) void
setPasswordExpires
(int passwordExpires) void
setPasswordmd4
(String passwordmd4) void
setPostalcode
(String pc) void
setQuota
(long quota) void
void
setSearchPref
(String searchPref) void
setSecondFactor
(String secondFactor) void
setSource
(int source) void
void
void
setTelephone
(String phone) void
setTelephone2
(String telephone2) void
setTimeZone
(String timeZone) void
setType
(int type) void
setUserGroups
(Set<UserGroup> userGroups) void
setUsername
(String uname) void
setWelcomeScreen
(Integer welcomeScreen) void
setWorkingTimes
(Set<WorkingTime> workingTimes) toString()
Methods inherited from class com.logicaldoc.core.PersistentObject
equals, getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, hashCode, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
-
Field Details
-
TYPE_DEFAULT
public static final int TYPE_DEFAULT- See Also:
-
TYPE_SYSTEM
public static final int TYPE_SYSTEM- See Also:
-
TYPE_READONLY
public static final int TYPE_READONLY- See Also:
-
SOURCE_DEFAULT
public static final int SOURCE_DEFAULT- See Also:
-
SOURCE_LDAP
public static final int SOURCE_LDAP- See Also:
-
SOURCE_SAML
public static final int SOURCE_SAML- See Also:
-
USERID_ADMIN
public static final long USERID_ADMIN- See Also:
-
USERID_SYSTEM
public static final long USERID_SYSTEM- See Also:
-
-
Constructor Details
-
User
public User()
-
-
Method Details
-
getCompany
-
setCompany
-
getType
public int getType() -
setType
public void setType(int type) -
getRepass
-
setRepass
-
getUsername
-
getPassword
-
getName
-
getFullName
-
getInitials
-
getFirstName
-
getStreet
-
getPostalcode
-
getCity
-
getCountry
-
getLanguage
-
getEmail
-
getTelephone
-
isAdmin
public boolean isAdmin()Checks if the user is member of the admin group- Returns:
- true only if the user belongs to the admin group
-
isMemberOf
-
addGroup
-
removeGroup
public void removeGroup(long groupId) -
removeGroupMemberships
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
-
setPassword
-
setDecodedPassword
Sets the password and encode it- Parameters:
pwd
- The password in readable format- Throws:
NoSuchAlgorithmException
- Cripting error
-
setName
-
setFirstName
-
setStreet
-
setPostalcode
-
setCity
-
setCountry
-
setLanguage
-
setEmail
-
setTelephone
-
reset
public void reset() -
toString
- Overrides:
toString
in classPersistentObject
-
getGroups
-
setGroups
-
getUserGroupName
The name of the group associated to this user, that is '_user_'+id- Returns:
- name of the group that represents this user
-
getUserGroup
Retrieves this user's group- Returns:
- the group
- Throws:
PersistenceException
- Error in the data layer
-
getEnabled
public int getEnabled() -
setEnabled
public void setEnabled(int enabled) -
getState
-
setState
-
getTelephone2
-
setTelephone2
-
getLocale
-
setLocale
-
getPasswordChanged
When the password was modified- Returns:
- when the password has been altered
-
setPasswordChanged
-
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:
-
setSource
public void setSource(int source) -
getQuota
public long getQuota() -
setQuota
public void setQuota(long quota) -
getWelcomeScreen
-
setWelcomeScreen
-
getIpWhiteList
-
setIpWhiteList
-
getIpBlackList
-
setIpBlackList
-
getPasswordExpired
public int getPasswordExpired() -
setPasswordExpired
public void setPasswordExpired(int passwordExpired) -
getPasswordmd4
-
setPasswordmd4
-
getDecodedPassword
-
getEmailSignature
-
setEmailSignature
-
clearPassword
public void clearPassword() -
getDefaultWorkspace
-
setDefaultWorkspace
-
getEmail2
-
setEmail2
-
getEmailSignature2
-
setEmailSignature2
-
getUserGroups
-
setUserGroups
-
getCertExpire
-
setCertExpire
-
getCertDN
-
setCertDN
-
getSecondFactor
-
setSecondFactor
-
getKey
-
setKey
-
isReadonly
public boolean isReadonly() -
getDocsGrid
-
setDocsGrid
-
getHitsGrid
-
setHitsGrid
-
getAvatar
-
setAvatar
-
getDateFormat
-
setDateFormat
-
getDateFormatShort
-
setDateFormatShort
-
getDateFormatLong
-
setDateFormatLong
-
getSearchPref
-
setSearchPref
-
getExpire
-
setExpire
-
getLastEnabled
-
setLastEnabled
-
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) -
getWorkingTimes
-
setWorkingTimes
-
getMaxInactivity
-
setMaxInactivity
-
getTimeZone
-
setTimeZone
-
getLastLogin
-
setLastLogin
-
getDepartment
-
setDepartment
-
getOrganizationalUnit
-
setOrganizationalUnit
-
getBuilding
-
setBuilding
-