Package com.iizix.user
Class UserInfoBase
java.lang.Object
com.iizix.user.UserInfoBase
- Direct Known Subclasses:
- BasicUserInfo
The base of user information in the database. The implementing subclass in the server extends from this class.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- final longThe 'created' time in milliseconds since the epoch.- final StringThe 'email', never- null(max 254 chars).- final longThe unique ID.The unpacked 'lang_codes' as language codes the user wishes to use.- static final intThe maximum length of the user name.- final StringThe 'user_name', never- null(max 254 chars).- final StringThe 'user_name_lower', lower case using Locale.ENGLISH of 'user_name', never- null(max 254 chars).
- Constructor SummaryConstructorsModifierConstructorDescription- protected- UserInfoBase- (long id, String userName, String userNameLower, String email, String langCode, long created) Constructor for the user info base.
- Method SummaryModifier and TypeMethodDescription- abstract UserLocaleStringChecks if the user is allowed to change his password.- final booleanChecks for equality.Gets the cached and current user details.- getDetails- (boolean reload) Gets the (cached and current) user details.- getDetails- (Connection conn, boolean reload) Gets the user details.- abstract UserLocaleStringGets the 'disabled' reason, null for user not disabled.- abstract intGets the 'fail_count' value, zero for never.- abstract longGets the 'last_fail' time in milliseconds since the epoch, 0 for never.- abstract longGets the 'last_login' time in milliseconds since the epoch, 0 for never.- abstract booleanReturns if the password must be changed upon next login.
- Field Details- MAXIMUM_USER_NAME_LENGTHpublic static final int MAXIMUM_USER_NAME_LENGTHThe maximum length of the user name.- See Also:
 
- idpublic final long idThe unique ID.
- userNameThe 'user_name', never- null(max 254 chars).
- userNameLowerThe 'user_name_lower', lower case using Locale.ENGLISH of 'user_name', never- null(max 254 chars).
- emailThe 'email', never- null(max 254 chars).
- langCodesThe unpacked 'lang_codes' as language codes the user wishes to use. The value is- nullif there are no language codes. The list is unmodifiable.
- createdpublic final long createdThe 'created' time in milliseconds since the epoch.
 
- Constructor Details- UserInfoBaseprotected UserInfoBase- (long id, String userName, String userNameLower, String email, String langCode, long created) Constructor for the user info base.- Parameters:
- id- The unique user ID.
- userName- The user name, never- null.
- userNameLower- The user name in lower case, never- null.
- email- The email, never- null.
- langCode- The language codes, comma separated,- nullfor none.
- created- The creation date (milliseconds since the epoch).
 
 
- Method Details- equalsChecks for equality. Checks only if two user ID's are equal.
- mustChangePasswordpublic abstract boolean mustChangePassword()Returns if the password must be changed upon next login.- Returns:
- Flag to change the password.
 
- canChangePasswordChecks if the user is allowed to change his password. Note that this does not check if the user id disabled: please do so using- getDisabledReason().- Returns:
- nullif allowed and user can change his password, otherwise a- UserLocaleStringinstance for the reason of the password being fixed and that it can never be changed.
 
- getLastLoginpublic abstract long getLastLogin()Gets the 'last_login' time in milliseconds since the epoch, 0 for never.
- getLastFailpublic abstract long getLastFail()Gets the 'last_fail' time in milliseconds since the epoch, 0 for never.
- getFailCountpublic abstract int getFailCount()Gets the 'fail_count' value, zero for never.
- getDisabledReasonGets the 'disabled' reason, null for user not disabled.- Returns:
- The user 'disabled' reason, or nullfor user not disabled.
 
- getDetailsGets the cached and current user details. Details are e.g. fax number, profile picture.- Returns:
- A new read-only copy of the details with name as key and the value for it.
 
- getDetailsGets the (cached and current) user details. Details are e.g. fax number, profile picture.- Note: If you have a JDBC connection, use - getDetails(Connection, boolean)instead for efficiency.- Parameters:
- reload- Reload flag from database.
- Returns:
- If reload is false, a cached read-only map with the details name as key and the value for it, otherwise a fresh copy of the details from the database.
- Throws:
- SQLException- For SQL errors.
 
- getDetailsGets the user details. Details are e.g. fax number, profile picture. If not previously loaded, the "reload" flag is ignored and the details are loaded.- Parameters:
- conn- The connection, null for cached values only.
- reload- Reload flag, i.e. instructs a full reload of all details from the database.
- Returns:
- A cached read-only map with the details name as key and the value for it.
- Throws:
- SQLException- For SQL errors.