Class SystemUser
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
,HasName
,Notifye
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for internal use onlySystemUser
(String login, Id personId) Constructs a System Person -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
boolean
canChangeLoginTo
(String login) void
changePassword
(char[] currentPassword, char[] newPassword, String newLogin) Change the password.static void
createLoginBlock
(ServerInformation server) createLoginBlock
(String externalServer) static SystemUser
getChangeLog
(SystemUser.SessionLog sessionLog) boolean
static SystemUser
static Locale
getLogicHit
(SystemUser.SessionLog sessionLog) getLogin()
Gets the login name.getName()
Gets the name of the PersonGets the person.Gets the Id of the person.int
static String[]
static String
getPreferencesValue
(int value) getSessionLog
(AbstractPeriod<?> period, boolean reverse, String server) getSessionLog
(AbstractPeriod<?> period, String server) int
static String[]
static String
getStatusValue
(int value) Gets the unique index condition of this object.static void
boolean
isAdmin()
boolean
boolean
isLocked()
static boolean
isLoginAvailable
(String login) boolean
isMemberOf
(SystemUserGroup group) boolean
boolean
isSS()
static boolean
isValidLogin
(String login) boolean
static String[]
links()
static ObjectIterator
<SystemUser> Get the list of entities configured for this user.listExternalUsers
(String fromURL) void
boolean
notify
(String templateName, TransactionManager tm, Object... messageParameters) Create and send a message to this user.static String[]
void
void
saveAsAuditor
(Transaction transaction) void
saveAsExternalUser
(Transaction transaction) void
saveAsProcessUser
(Transaction transaction) void
saveKeyForTOTP
(TransactionManager tm, byte[] keyForTOTP) static String[]
void
void
setLocaleCountry
(String localeCountry) void
setLocaleLanguage
(String localeLanguage) void
void
void
setPerson
(BigDecimal idValue) void
setPreferences
(int preferences) void
setStatus
(int status) toString()
String representation of the instance.void
void
validate()
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions).void
validateChildAttach
(StoredObject child) void
validateChildDetach
(StoredObject child) void
This will be invoked by the system whenever the object is saved to the DB.void
This method will be invoked whenever an existing instance is deleted from the database.void
validateNewPassword
(char[] currentPassword, char[] password) boolean
verify
(char[] password) boolean
verify
(char[] password, boolean ignoreAuthenticator) boolean
verify
(char[] password, int authenticatorCode) boolean
boolean
verifyTOTP
(int totp) Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validateChildAttach, validateChildDetach, validateChildUpdate, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
SystemUser
-
SystemUser
public SystemUser()Constructor for internal use only
-
-
Method Details
-
columns
-
indices
-
getUniqueCondition
Description copied from class:StoredObject
Gets the unique index condition of this object.- Overrides:
getUniqueCondition
in classStoredObject
- Returns:
- Unique index condition.
-
searchColumns
-
browseColumns
-
links
-
protectedColumns
-
getName
-
getPersonId
-
setPerson
-
setPerson
- Parameters:
id
- Id of the person
-
getPerson
-
getLogin
-
setLogin
-
getStatus
-
setStatus
public void setStatus(int status) -
getStatusBitValues
-
getStatusValue
-
getStatusValue
-
saveKeyForTOTP
- Throws:
Exception
-
verifyTOTP
public boolean verifyTOTP(int totp) -
validateNewPassword
- Throws:
SOException
-
changePassword
public void changePassword(char[] currentPassword, char[] newPassword, String newLogin) throws SOException Change the password.- Parameters:
currentPassword
- Current password.newPassword
- New Password.newLogin
- New login (Could be null if no login change required).- Throws:
SOException
- If password can not be set.
-
getPasswordExpiry
-
isPasswordExpired
public boolean isPasswordExpired() -
verifyPasswordUpdate
public boolean verifyPasswordUpdate() -
verify
public boolean verify(char[] password, boolean ignoreAuthenticator) -
verify
public boolean verify(char[] password) -
verify
public boolean verify(char[] password, int authenticatorCode) -
isVerified
public boolean isVerified() -
resetPassword
-
isSS
public boolean isSS() -
isAdmin
public boolean isAdmin() -
isAppAdmin
public boolean isAppAdmin() -
setPreferences
public void setPreferences(int preferences) -
getPreferences
-
getPreferencesBitValues
-
getPreferencesValue
-
getPreferencesValue
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
saveAsProcessUser
- Throws:
Exception
-
saveAsExternalUser
- Throws:
Exception
-
saveAsAuditor
- Throws:
Exception
-
isValidLogin
-
isLoginAvailable
-
canChangeLoginTo
-
validate
Description copied from class:StoredObject
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions). It will be invoked in all cases (while creating new objects and updating/deleting/un-deleting existing objects). If this method raises any exceptions, the process of saving to the DB will be abandoned.
This method is not usually used for validating data (For that purpose,
StoredObject.validateData(TransactionManager)
is recommended). It is mainly used for validating state of the object. Methods such asStoredObject.created()
,StoredObject.updated()
,StoredObject.deleted()
,StoredObject.undeleted()
etc. are used to check the specific states but overridden methods may check for other "application-specific"/"business-specific" states.This method is invoked only after one of the other operation-specific validate method is invoked depending on the save operation -
StoredObject.validateInsert()
,StoredObject.validateUpdate()
,StoredObject.validateDelete()
,StoredObject.validateUndelete()
.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
- Overrides:
validate
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateDelete
Description copied from class:StoredObject
This method will be invoked whenever an existing instance is deleted from the database. So, it will be called within an active transaction. Child classes can override this method to do validation when an existing instance is deleted from the database.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
Also, see
StoredObject.validate()
.- Overrides:
validateDelete
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateChildAttach
- Throws:
Exception
-
validateChildDetach
- Throws:
Exception
-
setLocaleLanguage
-
getLocaleLanguage
-
setLocaleCountry
-
getLocaleCountry
-
setLocale
-
getLocale
-
getLocale
-
toString
Description copied from class:StoredObject
String representation of the instance. Mostly used for logging purposes.- Overrides:
toString
in classStoredObject
- Returns:
- String representation of the instance.
-
listQuickAccessLogic
-
listAutoLogic
-
getExact
-
get
-
list
-
listGroups
-
getConfirmLogout
public boolean getConfirmLogout() -
format
-
isLocked
public boolean isLocked() -
unlock
- Throws:
Exception
-
lock
- Throws:
Exception
-
listEntities
Get the list of entities configured for this user.- Returns:
- List.
-
getSessionLog
-
getSessionLog
public Iterable<SystemUser.SessionLog> getSessionLog(AbstractPeriod<?> period, boolean reverse, String server) -
getChangeLog
-
getLogicHit
-
createLoginBlock
-
createLoginBlock
-
listExternalUsers
-
getAutoLogin
-
isMemberOf
-
notify
Create and send a message to this user.Note: If the template doesn't exist, the default template is used.
-