Class SystemUser
- All Implemented Interfaces:
Displayable,StringFiller,HasId,HasName,Notifye
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic 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[]booleanDetermines if the current user has access to a specified logic class.booleanChecks if the user has access to the specified logic by its name.booleancanChangeLoginTo(String login) voidchangePassword(char[] currentPassword, char[] newPassword, String newLogin) Change the password.static voidcreateLoginBlock(ServerInformation server) createLoginBlock(String externalServer) static SystemUsergetChangeLog(SystemUser.SessionLog sessionLog) booleanstatic SystemUserstatic LocalegetLogicHit(SystemUser.SessionLog sessionLog) getLogin()Gets the login name.getName()Gets the name of the PersonGets the person.Gets the Id of the person.intstatic String[]static StringgetPreferencesValue(int value) getSessionLog(AbstractPeriod<?> period, boolean reverse, String server) getSessionLog(AbstractPeriod<?> period, String server) intstatic String[]static StringgetStatusValue(int value) Gets the unique index condition of this object.static voidbooleanisAdmin()booleanbooleanisLocked()static booleanisLoginAvailable(String login) booleanisMemberOf(SystemUserGroup group) booleanbooleanisSS()static booleanisValidLogin(String login) booleanstatic String[]links()static ObjectIterator<SystemUser> Get the list of entities configured for this user.listExternalUsers(String fromURL) voidbooleannotify(String templateName, TransactionManager tm, Object... messageParameters) Create and send a message to this user.static String[]voidvoidsaveAsAuditor(Transaction transaction) voidsaveAsExternalUser(Transaction transaction) voidsaveAsProcessUser(Transaction transaction) voidsaveKeyForTOTP(TransactionManager tm, byte[] keyForTOTP) static String[]voidvoidsetLocaleCountry(String localeCountry) voidsetLocaleLanguage(String localeLanguage) voidvoidSet person.voidSet person.voidsetPerson(BigDecimal idValue) voidsetPreferences(int preferences) voidsetStatus(int status) toString()String representation of the instance.voidvoidvalidate()The system invokes this method internally whenever the object gets saved to the DB (that means, while doing transactions).voidvalidateChildAttach(StoredObject child) voidvalidateChildDetach(StoredObject child) voidThe system will invoke this whenever the object is saved to the DB.voidThis method will be invoked whenever an existing instance is deleted from the database.voidvalidateNewPassword(char[] currentPassword, char[] password) booleanverify(char[] password) booleanverify(char[] password, boolean ignoreAuthenticator) booleanverify(char[] password, int authenticatorCode) booleanbooleanverifyTOTP(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, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getActor, getAttachment, getAttachmentId, getChildren, getContemporaryOf, 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, listDeletedIds, 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, loadAttributesFrom, 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, 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:StoredObjectGets the unique index condition of this object.- Overrides:
getUniqueConditionin classStoredObject- Returns:
- Unique index condition.
-
searchColumns
-
browseColumns
-
links
-
protectedColumns
-
getName
-
getPersonId
-
setPerson
-
setPerson
-
setPerson
-
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:StoredObjectThe system will invoke this whenever the object is saved to the DB. It will be invoked in all cases while creating new objects and updating/deleting/undeleting 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:
validateDatain 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:StoredObjectThe system invokes this method internally 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/undeleting 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 the 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-methods 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:
validatein classStoredObject- Throws:
Exception- By raising an exception from this method, the current transaction can be abandoned.
-
validateDelete
Description copied from class:StoredObjectThis 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:
validateDeletein 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:StoredObjectString representation of the instance. Mostly used for logging purposes.- Overrides:
toStringin 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.
-
canAccess
Determines if the current user has access to a specified logic class.- Parameters:
logicClass- The class object representing the logic to be checked for access.- Returns:
- True if the user has access to the specified logic class, otherwise false.
-
canAccess
Checks if the user has access to the specified logic by its name.- Parameters:
logicName- The name of the logic to check access for.- Returns:
- True if the user has access to the specified logic, otherwise false.
-