Package com.google.gerrit.server.notedb
Class NoteDbUtil
- java.lang.Object
-
- com.google.gerrit.server.notedb.NoteDbUtil
-
public class NoteDbUtil extends Object
-
-
Method Summary
All Methods Static 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)
static Optional<Account.Id>
parseIdent(org.eclipse.jgit.lib.PersonIdent ident)
Returns an AccountId for the given email address.static Optional<Account.Id>
parseIdent(org.eclipse.jgit.lib.PersonIdent ident, String serverId, ExternalIdCache externalIdCache)
Returns an AccountId for the given email address and the current serverId.
-
-
-
Method Detail
-
parseIdent
public static Optional<Account.Id> parseIdent(org.eclipse.jgit.lib.PersonIdent ident)
Returns an AccountId for the given email address.
-
parseIdent
public static Optional<Account.Id> parseIdent(org.eclipse.jgit.lib.PersonIdent ident, String serverId, ExternalIdCache externalIdCache) throws org.eclipse.jgit.errors.ConfigInvalidException
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:
ident
- the accountId@serverId identityserverId
- the Gerrit's serverIdexternalIdCache
- reference to the cache for looking up the external ids- 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. - Throws:
org.eclipse.jgit.errors.ConfigInvalidException
- when the lookup of the external-id failed
-
extractHostPartFromPersonIdent
public static String extractHostPartFromPersonIdent(org.eclipse.jgit.lib.PersonIdent ident)
-
-