Class Account
- java.lang.Object
-
- com.google.gerrit.reviewdb.client.Account
-
public final class Account extends Object
Information about a single user.A user may have multiple identities they can use to login to Gerrit (see ExternalId), but in such cases they always map back to a single Account entity.
Entities "owned" by an Account (that is, their primary key contains the
Account.Id
key as part of their key structure):- ExternalId: OpenID identities and email addresses known to be registered to this user. Multiple records can exist when the user has more than one public identity, such as a work and a personal email address.
AccountGroupMember
: membership of the user in a specific human managedAccountGroup
. Multiple records can exist when the user is a member of more than one group.AccountSshKey
: user's public SSH keys, for authentication through the internal SSH daemon. One record per SSH key uploaded by the user, keys are checked in random order until a match is found.DiffPreferencesInfo
: user's preferences for rendering side-to-side and unified diff
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Account.Id
Key local to Gerrit to identify a user.
-
Field Summary
Fields Modifier and Type Field Description protected Account.Id
accountId
protected String
fullName
Full name of the user ("Given-name Surname" style).protected boolean
inactive
Is this user inactive? This is used to avoid showing some users (eg.protected String
preferredEmail
Email address the user prefers to be contacted through.protected Timestamp
registeredOn
Date and time the user registered with the review server.protected String
status
The user-settable status of this account (e.g.protected String
userName
computed the username selected from the identities.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Account()
Account(Account.Id newId, Timestamp registeredOn)
Create a new account.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getFullName()
Get the full name of the user ("Given-name Surname" style).GeneralPreferencesInfo
getGeneralPreferencesInfo()
Account.Id
getId()
Get local id of this account, to link with in other entitiesString
getMetaId()
String
getName(String anonymousCowardName)
Formats an account name.String
getNameEmail(String anonymousCowardName)
Get the name and email address.String
getPreferredEmail()
Email address the user prefers to be contacted through.Timestamp
getRegisteredOn()
Get the date and time the user first registered.String
getStatus()
String
getUserName()
int
hashCode()
boolean
isActive()
void
setActive(boolean active)
void
setFullName(String name)
Set the full name of the user ("Given-name Surname" style).void
setGeneralPreferences(GeneralPreferencesInfo p)
void
setMetaId(String metaId)
void
setPreferredEmail(String addr)
Set the email address the user prefers to be contacted through.void
setStatus(String status)
void
setUserName(String userName)
Update the computed user name property.
-
-
-
Field Detail
-
accountId
protected Account.Id accountId
-
registeredOn
protected Timestamp registeredOn
Date and time the user registered with the review server.
-
fullName
protected String fullName
Full name of the user ("Given-name Surname" style).
-
preferredEmail
protected String preferredEmail
Email address the user prefers to be contacted through.
-
inactive
protected boolean inactive
Is this user inactive? This is used to avoid showing some users (eg. former employees) in auto-suggest.
-
status
protected String status
The user-settable status of this account (e.g. busy, OOO, available)
-
userName
protected String userName
computed the username selected from the identities.
-
-
Constructor Detail
-
Account
protected Account()
-
Account
public Account(Account.Id newId, Timestamp registeredOn)
Create a new account.- Parameters:
newId
- unique id, seeSequences.nextAccountId()
.registeredOn
- when the account was registered.
-
-
Method Detail
-
getId
public Account.Id getId()
Get local id of this account, to link with in other entities
-
getFullName
public String getFullName()
Get the full name of the user ("Given-name Surname" style).
-
setFullName
public void setFullName(String name)
Set the full name of the user ("Given-name Surname" style).
-
getPreferredEmail
public String getPreferredEmail()
Email address the user prefers to be contacted through.
-
setPreferredEmail
public void setPreferredEmail(String addr)
Set the email address the user prefers to be contacted through.
-
getName
public String getName(String anonymousCowardName)
Formats an account name.If the account has a full name, it returns only the full name. Otherwise it returns a longer form that includes the email address.
-
getNameEmail
public String getNameEmail(String anonymousCowardName)
Get the name and email address.Example output:
A U. Thor <[email protected]>
: full populatedA U. Thor (12)
: missing email addressAnonymous Coward <[email protected]>
: missing nameAnonymous Coward (12)
: missing name and email address
-
getRegisteredOn
public Timestamp getRegisteredOn()
Get the date and time the user first registered.
-
getGeneralPreferencesInfo
public GeneralPreferencesInfo getGeneralPreferencesInfo()
-
setGeneralPreferences
public void setGeneralPreferences(GeneralPreferencesInfo p)
-
getMetaId
public String getMetaId()
-
setMetaId
public void setMetaId(String metaId)
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
getStatus
public String getStatus()
-
setStatus
public void setStatus(String status)
-
getUserName
public String getUserName()
- Returns:
- the computed user name for this account
-
setUserName
public void setUserName(String userName)
Update the computed user name property.
-
-