public class ExternalIds extends Object
The external IDs are either read from NoteDb or retrieved from the cache.
Constructor and Description |
---|
ExternalIds(ExternalIdReader externalIdReader,
com.google.gerrit.server.account.externalids.ExternalIdCache externalIdCache) |
Modifier and Type | Method and Description |
---|---|
com.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.SetMultimap<Account.Id,ExternalId> |
allByAccount()
Returns all external IDs by account.
|
com.google.common.collect.SetMultimap<String,ExternalId> |
allByEmail()
Returns all external IDs by email.
|
Set<ExternalId> |
byAccount(Account.Id accountId)
Returns the external IDs of the specified account.
|
Set<ExternalId> |
byAccount(Account.Id accountId,
org.eclipse.jgit.lib.ObjectId rev)
Returns the external IDs of the specified account.
|
Set<ExternalId> |
byAccount(Account.Id accountId,
String scheme)
Returns the external IDs of the specified account that have the given scheme.
|
Set<ExternalId> |
byAccount(Account.Id accountId,
String scheme,
org.eclipse.jgit.lib.ObjectId rev)
Returns the external IDs of the specified account that have the given scheme.
|
Set<ExternalId> |
byEmail(String email)
Returns the external ID with the given email.
|
com.google.common.collect.SetMultimap<String,ExternalId> |
byEmails(String... emails)
Returns the external IDs for the given emails.
|
Optional<ExternalId> |
get(ExternalId.Key key)
Returns the specified external ID.
|
Optional<ExternalId> |
get(ExternalId.Key key,
org.eclipse.jgit.lib.ObjectId rev)
Returns the specified external ID from the given revision.
|
@Inject public ExternalIds(ExternalIdReader externalIdReader, com.google.gerrit.server.account.externalids.ExternalIdCache externalIdCache)
public com.google.common.collect.ImmutableSet<ExternalId> all() throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public com.google.common.collect.ImmutableSet<ExternalId> all(org.eclipse.jgit.lib.ObjectId rev) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public Optional<ExternalId> get(ExternalId.Key key) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public Optional<ExternalId> get(ExternalId.Key key, org.eclipse.jgit.lib.ObjectId rev) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public Set<ExternalId> byAccount(Account.Id accountId) throws IOException
IOException
public Set<ExternalId> byAccount(Account.Id accountId, String scheme) throws IOException
IOException
public Set<ExternalId> byAccount(Account.Id accountId, org.eclipse.jgit.lib.ObjectId rev) throws IOException
IOException
public Set<ExternalId> byAccount(Account.Id accountId, String scheme, org.eclipse.jgit.lib.ObjectId rev) throws IOException
IOException
public com.google.common.collect.SetMultimap<Account.Id,ExternalId> allByAccount() throws IOException
IOException
public Set<ExternalId> byEmail(String email) throws IOException
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.
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).
IOException
byEmails(String...)
public com.google.common.collect.SetMultimap<String,ExternalId> byEmails(String... emails) throws IOException
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.
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).
IOException
byEmail(String)
public com.google.common.collect.SetMultimap<String,ExternalId> allByEmail() throws IOException
IOException