Class UserRecord
java.lang.Object
uk.ac.manchester.spinnaker.alloc.model.UserRecord
The description and model of a user. POJO class. Some things are stated to be
 not settable despite having setters; they're settable in instances of
 this class but the service itself will not respect being asked to change
 them.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate an empty instance.UserRecord(Row row) Inflate the result of aSQLQueries.GET_USER_DETAILSquery (or anything else that includes the same columns) into an object.
- 
Method SummaryModifier and TypeMethodDescriptionNote that no API that sets a user's information using aUserRecordallows setting the groups that user is a member of at the same time.@Null Instant@Null Instant@NotNull(message="a trust level must be given") TrustLevel@Null Integer@NotBlank StringvoidSet up some defaults used when a user is being created.booleanbooleansanitise()Forces correct shrouding of information.voidsetEnabled(Boolean enabled) voidvoidsetHasPassword(Boolean hasPassword) voidsetInternal(boolean internal) voidvoidsetOpenIdSubject(String subject) voidsetPassword(String password) voidsetTrustLevel(TrustLevel trustLevel) voidvoidsetUserName(String userName) 
- 
Constructor Details- 
UserRecordpublic UserRecord()Create an empty instance.
- 
UserRecordInflate the result of aSQLQueries.GET_USER_DETAILSquery (or anything else that includes the same columns) into an object. Doesn't include inflating the groups that the user is a member of.- Parameters:
- row- The row with the result.
 
 
- 
- 
Method Details- 
getUserId- Returns:
- The user identifier. Read-only; cannot be set by the service.
 
- 
setUserId- Parameters:
- userId- The user identifier. Read-only within the administration interface; cannot be set by the service.
 
- 
getUserName- Returns:
- The user's username.
 
- 
setUserName- Parameters:
- userName- The user's username.
 
- 
getPassword- Returns:
- The user's unencrypted password. Never returned by the service, but may be written.
 
- 
setPassword- Parameters:
- password- The user's unencrypted password. Never returned by the service, but may be written.
 
- 
getHasPassword- Returns:
- Whether the user has a password set. If they don't, they'll have to log in by other mechanisms (e.g., HBP/EBRAINS OpenID Connect).
 
- 
setHasPassword- Parameters:
- hasPassword- Whether the user has a password set. If they don't, they'll have to log in by other mechanisms (e.g., HBP/EBRAINS OpenID Connect).
 
- 
getEnabled- Returns:
- Whether this account is enabled. Disabled accounts cannot log into the service until explicitly enabled.
 
- 
setEnabled- Parameters:
- enabled- Whether this account is enabled. Disabled accounts cannot log into the service until explicitly enabled.
 
- 
getLocked- Returns:
- Whether this account is temporarily locked. Locked accounts
         should unlock automatically after 24 hours. Can be explicitly set
         to falseto force an unlock.
 
- 
setLocked- Parameters:
- locked- Whether this account is temporarily locked. Locked accounts should unlock automatically after 24 hours. Can be explicitly set to- falseto force an unlock.
 
- 
getTrustLevel@NotNull(message="a trust level must be given") public @NotNull(message="a trust level must be given") TrustLevel getTrustLevel()- Returns:
- The permissions of the account.
 
- 
setTrustLevel- Parameters:
- trustLevel- The permissions of the account.
 
- 
getLastSuccessfulLogin- Returns:
- The time that the last successful login was. Read-only; cannot be set via the admin API.
 
- 
getLastFailedLogin- Returns:
- The time that the last failed login was. Read-only; cannot be set via the admin API.
 
- 
getGroupsNote that no API that sets a user's information using aUserRecordallows setting the groups that user is a member of at the same time.- Returns:
- The groups that the user is a member of. May be nullif this information is not being reported.
 
- 
setGroups- Parameters:
- groups- The groups that the user is a member of.
 
- 
getOpenIdSubject- Returns:
- The OpenID subject that this user relates to, if known.
 
- 
setOpenIdSubject- Parameters:
- subject- The OpenID subject that this user relates to.
 
- 
isInternalpublic boolean isInternal()- Returns:
- Whether this is an internal user.
 
- 
setInternalpublic void setInternal(boolean internal) - Parameters:
- internal- Whether this is an internal user.
 
- 
isExternallyAuthenticatedpublic boolean isExternallyAuthenticated()- Returns:
- Whether this represents a request to use external authentication (instead of just not setting the password).
 
- 
sanitiseForces correct shrouding of information.- Returns:
- the object (for convenience)
 
- 
initCreationDefaultspublic void initCreationDefaults()Set up some defaults used when a user is being created.
 
-