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 TypeMethodDescriptionvoidvoidbooleangetCity()getEmail()intintintgetKey()getName()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) 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.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
-
getEvalFormEnabled
public int getEvalFormEnabled() -
setEvalFormEnabled
public void setEvalFormEnabled(int evalFormEnabled) -
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- Cripting error
-
setName
-
setFirstName
-
setStreet
-
setPostalcode
-
setCity
-
setCountry
-
setLanguage
-
setEmail
-
setTelephone
-
reset
public void reset() -
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
-
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
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
-
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
-
hashCode
public int hashCode()- Overrides:
hashCodein classPersistentObject
-
equals
- Overrides:
equalsin classPersistentObject
-