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
FieldsFields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidUsed to remove credentials informations from as security measure in case some malicious code could get it from this beanbooleangetCity()getEmail()getKey()getName()When the password was modifiedlonggetQuota()longThe source from which the user has been createdgetState()getType()Retrieves this user's groupThe name of the group associated to this user, that is '_user_'+idinthashCode()booleanisAdmin()Checks if the user is member of the admin groupbooleanbooleanbooleanbooleanChecks if the user is expired nowbooleanChecks if the user falls in his working timebooleanisLegals()booleanisMemberOf(String groupName) booleanbooleanIf the password expires or notbooleanvoidremoveGroup(long groupId) voidremoveGroupMemberships(String source) Removes the user from All groups except it's user's own group.voidvoidsetBuilding(String building) voidvoidsetCertExpire(Date certExpire) voidvoidsetCompany(String company) voidsetCountry(String cnt) voidsetDateFormat(String dateFormat) voidsetDateFormatLong(String dateFormatLong) voidsetDateFormatShort(String dateFormatShort) voidsetDecodedPassword(String pwd) Sets the password and encode itvoidsetDefaultWorkspace(Long defaultWorkspace) voidsetDepartment(String department) voidsetDocsGrid(String docsGrid) voidvoidvoidsetEmailSignature(String emailSignature) voidsetEmailSignature2(String emailSignature2) voidsetEnabled(boolean enabled) voidsetEnforceWorkingTime(boolean enforceWorkingTime) voidsetEvalFormEnabled(boolean evalFormEnabled) voidvoidsetFirstName(String firstName) voidvoidsetHitsGrid(String hitsGrid) voidsetIpBlackList(String ipBlackList) voidsetIpWhiteList(String ipWhiteList) voidvoidsetLanguage(String lang) voidsetLastEnabled(Date lastEnabled) voidsetLastLogin(Date lastLogin) voidsetLegals(boolean legals) voidvoidsetMaxInactivity(Integer maxInactivity) voidvoidsetOrganizationalUnit(String organizationalUnit) voidsetPassword(String pwd) voidsetPasswordChanged(Date passwordChanged) voidsetPasswordExpired(boolean passwordExpired) voidsetPasswordExpires(boolean passwordExpires) voidsetPasswordmd4(String passwordmd4) voidsetPostalcode(String pc) voidsetQuota(long quota) voidvoidsetSearchPref(String searchPref) voidsetSecondFactor(String secondFactor) voidsetSessionsQuota(long sessionsQuota) voidsetSource(int source) voidsetSource(UserSource source) voidvoidvoidsetTelephone(String phone) voidsetTelephone2(String telephone2) voidsetTimeZone(String timeZone) voidsetType(int type) voidvoidsetUserGroups(Set<UserGroup> userGroups) voidsetUsername(String uname) voidsetWelcomeScreen(Integer welcomeScreen) voidsetWorkingTimes(Set<WorkingTime> workingTimes) toString()Methods inherited from class com.logicaldoc.core.PersistentObject
getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
-
Field Details
-
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
-
setType
-
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- Crypting error
-
setName
-
setFirstName
-
setStreet
-
setPostalcode
-
setCity
-
setCountry
-
setLanguage
-
setEmail
-
setTelephone
-
getSessionsQuota
public long getSessionsQuota() -
setSessionsQuota
public void setSessionsQuota(long sessionsQuota) -
toString
- Overrides:
toStringin 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
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getState
-
setState
-
getTelephone2
-
setTelephone2
-
getLocale
-
setLocale
-
getPasswordChanged
When the password was modified- Returns:
- when the password has been altered
-
setPasswordChanged
-
isPasswordExpires
public boolean isPasswordExpires()If the password expires or not- Returns:
- true if the password expires, false otherwise
-
setPasswordExpires
public void setPasswordExpires(boolean passwordExpires) -
getSource
The source from which the user has been created- Returns:
- the source
- See Also:
-
setSource
-
setSource
public void setSource(int source) -
getQuota
public long getQuota() -
setQuota
public void setQuota(long quota) -
getWelcomeScreen
-
setWelcomeScreen
-
getIpWhiteList
-
setIpWhiteList
-
getIpBlackList
-
setIpBlackList
-
getPasswordmd4
-
setPasswordmd4
-
getDecodedPassword
-
getEmailSignature
-
setEmailSignature
-
clearPassword
public void clearPassword()Used to remove credentials informations from as security measure in case some malicious code could get it from this bean -
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
-
getWorkingTimes
-
setWorkingTimes
-
getMaxInactivity
-
setMaxInactivity
-
getTimeZone
-
setTimeZone
-
getLastLogin
-
setLastLogin
-
getDepartment
-
setDepartment
-
getOrganizationalUnit
-
setOrganizationalUnit
-
getBuilding
-
setBuilding
-
isLegals
public boolean isLegals() -
setLegals
public void setLegals(boolean legals) -
isPasswordExpired
public boolean isPasswordExpired() -
setPasswordExpired
public void setPasswordExpired(boolean passwordExpired) -
isEnforceWorkingTime
public boolean isEnforceWorkingTime() -
setEnforceWorkingTime
public void setEnforceWorkingTime(boolean enforceWorkingTime) -
isEvalFormEnabled
public boolean isEvalFormEnabled() -
setEvalFormEnabled
public void setEvalFormEnabled(boolean evalFormEnabled) -
hashCode
public int hashCode()- Overrides:
hashCodein classPersistentObject
-
equals
- Overrides:
equalsin classPersistentObject
-