Package com.logicaldoc.core.security
Class User
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.security.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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final longFields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidgetCity()getEmail()intintlong[]String[]getKey()getName()When the password was modifiedintintIf the password expires or notlonggetQuota()intThe source from which the user has been createdgetState()intgetType()Retrieves this user's groupThe name of the group associated to this user, that is '_user_'+idbooleanChecks 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()voidvoidvoidsetCertExpire(Date certExpire) voidvoidsetCountry(String cnt) voidsetCreation(Date creation) voidsetDateFormat(String dateFormat) voidsetDateFormatLong(String dateFormatLong) voidsetDateFormatShort(String dateFormatShort) voidsetDecodedPassword(String pwd) Sets the password and encode itvoidsetDefaultWorkspace(Long defaultWorkspace) voidsetDocsGrid(String docsGrid) voidvoidvoidsetEmailSignature(String emailSignature) voidsetEmailSignature2(String emailSignature2) voidsetEnabled(int enabled) voidsetEnforceWorkingTime(int enforceWorkingTime) voidvoidsetFirstName(String firstName) voidvoidsetHitsGrid(String hitsGrid) voidsetIpBlackList(String ipBlackList) voidsetIpWhiteList(String ipWhiteList) voidvoidsetLanguage(String lang) voidsetLastEnabled(Date lastEnabled) voidvoidsetMaxInactivity(Integer maxInactivity) voidvoidsetPassword(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) voidvoidvoidsetTelephone(String phone) voidsetTelephone2(String telephone2) voidsetTimeZone(String timeZone) voidsetType(int type) voidsetUserGroups(Set<UserGroup> userGroups) voidsetUsername(String uname) voidsetWelcomeScreen(Integer welcomeScreen) voidsetWorkingTimes(Set<WorkingTime> workingTimes) toString()Methods inherited from class com.logicaldoc.core.PersistentObject
equals, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, hashCode, 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:
-
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
-
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
-
getGroupIds
public long[] getGroupIds() -
getGroupNames
-
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
-
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
-
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() -
getCreation
-
setCreation
-
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
-