java.lang.Object
com.google.gerrit.server.account.externalids.storage.notedb.ExternalIdsNoteDbImpl
All Implemented Interfaces:
ExternalIds

public class ExternalIdsNoteDbImpl extends Object implements ExternalIds
Class to access external IDs.

The external IDs are either read from NoteDb or retrieved from the cache.

  • Method Details

    • all

      public com.google.common.collect.ImmutableSet<ExternalId> all() throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
      Description copied from interface: ExternalIds
      Returns all external IDs.
      Specified by:
      all in interface ExternalIds
      Throws:
      IOException
      org.eclipse.jgit.errors.ConfigInvalidException
    • all

      public com.google.common.collect.ImmutableSet<ExternalId> all(org.eclipse.jgit.lib.ObjectId rev) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
      Returns all external IDs from the specified revision of the refs/meta/external-ids branch.
      Throws:
      IOException
      org.eclipse.jgit.errors.ConfigInvalidException
    • get

      public Optional<ExternalId> get(ExternalId.Key key) throws IOException
      Description copied from interface: ExternalIds
      Returns the specified external ID.
      Specified by:
      get in interface ExternalIds
      Throws:
      IOException
    • byAccount

      public com.google.common.collect.ImmutableSet<ExternalId> byAccount(Account.Id accountId) throws IOException
      Description copied from interface: ExternalIds
      Returns the external IDs of the specified account.
      Specified by:
      byAccount in interface ExternalIds
      Throws:
      IOException
    • byAccount

      public com.google.common.collect.ImmutableSet<ExternalId> byAccount(Account.Id accountId, String scheme) throws IOException
      Description copied from interface: ExternalIds
      Returns the external IDs of the specified account that have the given scheme.

      Callers to this method should care about accuracy rather than latency. For better latency performance, call ExternalIdCache.byAccount(com.google.gerrit.entities.Account.Id) directly.

      Specified by:
      byAccount in interface ExternalIds
      Throws:
      IOException
    • byAccount

      public com.google.common.collect.ImmutableSet<ExternalId> byAccount(Account.Id accountId, org.eclipse.jgit.lib.ObjectId rev) throws IOException
      Returns the external IDs of the specified account.
      Throws:
      IOException
    • allByAccount

      public com.google.common.collect.ImmutableSetMultimap<Account.Id,ExternalId> allByAccount() throws IOException
      Description copied from interface: ExternalIds
      Returns all external IDs by account.
      Specified by:
      allByAccount in interface ExternalIds
      Throws:
      IOException
    • byEmail

      public com.google.common.collect.ImmutableSet<ExternalId> byEmail(String email) throws IOException
      Returns the external ID with the given email.

      Each email should belong to a single external ID only. This means if more than one external ID is returned there is an inconsistency in the external IDs.

      Callers to this method should care about accuracy rather than latency. For better latency performance, call ExternalIdCache.byEmail(String) directly.

      The external IDs are retrieved from the external ID cache. Each access to the external ID * cache requires reading the SHA1 of the refs/meta/external-ids branch. If external IDs for * multiple emails are needed it is more efficient to use byEmails(String...) as this * method reads the SHA1 of the refs/meta/external-ids branch only once (and not once per email).

      Specified by:
      byEmail in interface ExternalIds
      Throws:
      IOException
      See Also:
    • byEmails

      public com.google.common.collect.ImmutableSetMultimap<String,ExternalId> byEmails(String... emails) throws IOException
      Returns the external IDs for the given emails.

      Each email should belong to a single external ID only. This means if more than one external ID for an email is returned there is an inconsistency in the external IDs.

      Callers to this method should care about accuracy rather than latency. For better latency performance, call ExternalIdCache.byEmails(String...) directly.

      The external IDs are retrieved from the external ID cache. Each access to the external ID cache requires reading the SHA1 of the refs/meta/external-ids branch. If external IDs for multiple emails are needed it is more efficient to use this method instead of byEmail(String) as this method reads the SHA1 of the refs/meta/external-ids branch only once (and not once per email).

      Specified by:
      byEmails in interface ExternalIds
      Throws:
      IOException
      See Also: