Package com.google.gerrit.server.notedb
Class NoteDbUtil
- java.lang.Object
-
- com.google.gerrit.server.notedb.NoteDbUtil
-
public class NoteDbUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description NoteDbUtil(String serverId, ExternalIdCache externalIdCache)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
extractHostPartFromPersonIdent(org.eclipse.jgit.lib.PersonIdent ident)
static String
formatTime(org.eclipse.jgit.lib.PersonIdent ident, Timestamp t)
Optional<Account.Id>
parseIdent(String email)
Returns an AccountId for the given email address and the current serverId.Optional<Account.Id>
parseIdent(org.eclipse.jgit.lib.PersonIdent ident)
Returns an AccountId for the given person's identity and the current serverId.
-
-
-
Constructor Detail
-
NoteDbUtil
@Inject public NoteDbUtil(String serverId, ExternalIdCache externalIdCache)
-
-
Method Detail
-
parseIdent
public Optional<Account.Id> parseIdent(org.eclipse.jgit.lib.PersonIdent ident)
Returns an AccountId for the given person's identity and the current serverId. Reverse lookup the AccountId using the ExternalIdCache if the account has a foreign serverId.- Parameters:
ident
- the accountId@serverId identity- Returns:
- a defined accountId if the account was found,
Account.UNKNOWN_ACCOUNT_ID
if the lookup via external-id did not return any account, or an empty value if the identity was malformed.
-
parseIdent
public Optional<Account.Id> parseIdent(String email)
Returns an AccountId for the given email address and the current serverId. Reverse lookup the AccountId using the ExternalIdCache if the account has a foreign serverId.- Parameters:
email
- the accountId@serverId email identity- Returns:
- a defined accountId if the account was found,
Account.UNKNOWN_ACCOUNT_ID
if the lookup via external-id did not return any account, or an empty value if the identity was malformed.
-
extractHostPartFromPersonIdent
public static String extractHostPartFromPersonIdent(org.eclipse.jgit.lib.PersonIdent ident)
-
-