Class NoteDbUtil


  • public class NoteDbUtil
    extends Object
    • 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 identity
        serverId - the Gerrit's serverId
        externalIdCache - 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)
      • formatTime

        public static String formatTime​(org.eclipse.jgit.lib.PersonIdent ident,
                                        Timestamp t)