Class ExternalIdsNoteDbImpl
- All Implemented Interfaces:
ExternalIds
The external IDs are either read from NoteDb or retrieved from the cache.
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet<ExternalId>
all()
Returns all external IDs.com.google.common.collect.ImmutableSet<ExternalId>
all
(org.eclipse.jgit.lib.ObjectId rev) Returns all external IDs from the specified revision of the refs/meta/external-ids branch.com.google.common.collect.ImmutableSetMultimap<Account.Id,
ExternalId> Returns all external IDs by account.com.google.common.collect.ImmutableSet<ExternalId>
byAccount
(Account.Id accountId) Returns the external IDs of the specified account.com.google.common.collect.ImmutableSet<ExternalId>
byAccount
(Account.Id accountId, String scheme) Returns the external IDs of the specified account that have the given scheme.com.google.common.collect.ImmutableSet<ExternalId>
byAccount
(Account.Id accountId, org.eclipse.jgit.lib.ObjectId rev) Returns the external IDs of the specified account.com.google.common.collect.ImmutableSet<ExternalId>
Returns the external ID with the given email.com.google.common.collect.ImmutableSetMultimap<String,
ExternalId> Returns the external IDs for the given emails.get
(ExternalId.Key key) Returns the specified external ID.
-
Method Details
-
all
public com.google.common.collect.ImmutableSet<ExternalId> all() throws IOException, org.eclipse.jgit.errors.ConfigInvalidExceptionDescription copied from interface:ExternalIds
Returns all external IDs.- Specified by:
all
in interfaceExternalIds
- 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
Description copied from interface:ExternalIds
Returns the specified external ID.- Specified by:
get
in interfaceExternalIds
- 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 interfaceExternalIds
- 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 interfaceExternalIds
- 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 IOExceptionDescription copied from interface:ExternalIds
Returns all external IDs by account.- Specified by:
allByAccount
in interfaceExternalIds
- Throws:
IOException
-
byEmail
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 interfaceExternalIds
- 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 interfaceExternalIds
- Throws:
IOException
- See Also:
-