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 SummaryFieldsFields inherited from class com.logicaldoc.core.PersistentObjectDELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidbooleangetCity()getEmail()intintintgetKey()intgetName()When the password was modifiedintintIf the password expires or notlonggetQuota()The 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 groupbooleanChecks if the user is expired nowbooleanChecks if the user falls in his working timebooleanisMemberOf(String groupName) booleanvoidremoveGroup(long groupId) voidremoveGroupMemberships(String source) Removes the user from All groups except it's user's own group.voidreset()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(int enabled) voidsetEnforceWorkingTime(int enforceWorkingTime) voidsetEvalFormEnabled(int evalFormEnabled) voidvoidsetFirstName(String firstName) voidvoidsetHitsGrid(String hitsGrid) voidsetIpBlackList(String ipBlackList) voidsetIpWhiteList(String ipWhiteList) voidvoidsetLanguage(String lang) voidsetLastEnabled(Date lastEnabled) voidsetLastLogin(Date lastLogin) voidsetLegals(int legals) voidvoidsetMaxInactivity(Integer maxInactivity) voidvoidsetOrganizationalUnit(String organizationalUnit) voidsetPassword(String pwd) voidsetPasswordChanged(Date passwordChanged) voidsetPasswordExpired(int passwordExpired) voidsetPasswordExpires(int passwordExpires) voidsetPasswordmd4(String passwordmd4) voidsetPostalcode(String pc) voidsetQuota(long quota) voidvoidsetSearchPref(String searchPref) voidsetSecondFactor(String secondFactor) 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.PersistentObjectgetCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
- 
Field Details- 
USERID_ADMINpublic static final long USERID_ADMIN- See Also:
 
- 
USERID_SYSTEMpublic static final long USERID_SYSTEM- See Also:
 
 
- 
- 
Constructor Details- 
Userpublic User()
 
- 
- 
Method Details- 
getEvalFormEnabledpublic int getEvalFormEnabled()
- 
setEvalFormEnabledpublic void setEvalFormEnabled(int evalFormEnabled) 
- 
getCompany
- 
setCompany
- 
getType
- 
setType
- 
setTypepublic void setType(int type) 
- 
getRepass
- 
setRepass
- 
getUsername
- 
getPassword
- 
getName
- 
getFullName
- 
getInitials
- 
getFirstName
- 
getStreet
- 
getPostalcode
- 
getCity
- 
getCountry
- 
getLanguage
- 
getEmail
- 
getTelephone
- 
isAdminpublic 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
- 
removeGrouppublic void removeGroup(long groupId) 
- 
removeGroupMembershipsRemoves 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
- 
setDecodedPasswordSets 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
- 
resetpublic void reset()
- 
toString- Overrides:
- toStringin class- PersistentObject
 
- 
getGroups
- 
setGroups
- 
getUserGroupNameThe name of the group associated to this user, that is '_user_'+id- Returns:
- name of the group that represents this user
 
- 
getUserGroupRetrieves this user's group- Returns:
- the group
- Throws:
- PersistenceException- Error in the data layer
 
- 
getEnabledpublic int getEnabled()
- 
setEnabledpublic void setEnabled(int enabled) 
- 
getState
- 
setState
- 
getTelephone2
- 
setTelephone2
- 
getLocale
- 
setLocale
- 
getPasswordChangedWhen the password was modified- Returns:
- when the password has been altered
 
- 
setPasswordChanged
- 
getPasswordExpirespublic int getPasswordExpires()If the password expires or not- Returns:
- 1 if the password expires, 0 otherwise
 
- 
setPasswordExpirespublic void setPasswordExpires(int passwordExpires) 
- 
getSourceThe source from which the user has been created- Returns:
- the source
- See Also:
 
- 
setSource
- 
setSourcepublic void setSource(int source) 
- 
getQuotapublic long getQuota()
- 
setQuotapublic void setQuota(long quota) 
- 
getWelcomeScreen
- 
setWelcomeScreen
- 
getIpWhiteList
- 
setIpWhiteList
- 
getIpBlackList
- 
setIpBlackList
- 
getPasswordExpiredpublic int getPasswordExpired()
- 
setPasswordExpiredpublic void setPasswordExpired(int passwordExpired) 
- 
getPasswordmd4
- 
setPasswordmd4
- 
getDecodedPassword
- 
getEmailSignature
- 
setEmailSignature
- 
clearPasswordpublic void clearPassword()
- 
getDefaultWorkspace
- 
setDefaultWorkspace
- 
getEmail2
- 
setEmail2
- 
getEmailSignature2
- 
setEmailSignature2
- 
getUserGroups
- 
setUserGroups
- 
getCertExpire
- 
setCertExpire
- 
getCertDN
- 
setCertDN
- 
getSecondFactor
- 
setSecondFactor
- 
getKey
- 
setKey
- 
isReadonlypublic boolean isReadonly()
- 
getDocsGrid
- 
setDocsGrid
- 
getHitsGrid
- 
setHitsGrid
- 
getAvatar
- 
setAvatar
- 
getDateFormat
- 
setDateFormat
- 
getDateFormatShort
- 
setDateFormatShort
- 
getDateFormatLong
- 
setDateFormatLong
- 
getSearchPref
- 
setSearchPref
- 
getExpire
- 
setExpire
- 
getLastEnabled
- 
setLastEnabled
- 
isExpiredpublic 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
 
- 
isInWorkingTimepublic 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
 
- 
getEnforceWorkingTimepublic int getEnforceWorkingTime()
- 
setEnforceWorkingTimepublic void setEnforceWorkingTime(int enforceWorkingTime) 
- 
getWorkingTimes
- 
setWorkingTimes
- 
getMaxInactivity
- 
setMaxInactivity
- 
getTimeZone
- 
setTimeZone
- 
getLastLogin
- 
setLastLogin
- 
getDepartment
- 
setDepartment
- 
getOrganizationalUnit
- 
setOrganizationalUnit
- 
getBuilding
- 
setBuilding
- 
getLegalspublic int getLegals()
- 
setLegalspublic void setLegals(int legals) 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- PersistentObject
 
- 
equals- Overrides:
- equalsin class- PersistentObject
 
 
-