Class ExternalIdNotes.ExternalIdNotesLoader
- java.lang.Object
-
- com.google.gerrit.server.account.externalids.ExternalIdNotes.ExternalIdNotesLoader
-
- Direct Known Subclasses:
ExternalIdNotes.Factory
,ExternalIdNotes.FactoryNoReindex
- Enclosing class:
- ExternalIdNotes
public abstract static class ExternalIdNotes.ExternalIdNotesLoader extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected AllUsersName
allUsersName
protected AuthConfig
authConfig
protected ExternalIdCache
externalIdCache
protected ExternalIdFactory
externalIdFactory
protected com.google.gerrit.metrics.MetricMaker
metricMaker
protected DynamicMap<ExternalIdUpsertPreprocessor>
upsertPreprocessors
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExternalIdNotesLoader(ExternalIdCache externalIdCache, com.google.gerrit.metrics.MetricMaker metricMaker, AllUsersName allUsersName, DynamicMap<ExternalIdUpsertPreprocessor> upsertPreprocessors, ExternalIdFactory externalIdFactory, AuthConfig authConfig)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ExternalIdNotes
load(org.eclipse.jgit.lib.Repository allUsersRepo)
Loads the external ID notes from the current tip of therefs/meta/external-ids
branch.abstract ExternalIdNotes
load(org.eclipse.jgit.lib.Repository allUsersRepo, org.eclipse.jgit.lib.ObjectId rev)
Loads the external ID notes from the specified revision of therefs/meta/external-ids
branch.protected abstract void
reindexAccount(Account.Id id)
void
updateExternalIdCacheAndMaybeReindexAccounts(ExternalIdNotes externalIdNotes, Collection<Account.Id> accountsToSkipForReindex)
Updates the external ID cache.
-
-
-
Field Detail
-
externalIdCache
protected final ExternalIdCache externalIdCache
-
metricMaker
protected final com.google.gerrit.metrics.MetricMaker metricMaker
-
allUsersName
protected final AllUsersName allUsersName
-
upsertPreprocessors
protected final DynamicMap<ExternalIdUpsertPreprocessor> upsertPreprocessors
-
externalIdFactory
protected final ExternalIdFactory externalIdFactory
-
authConfig
protected final AuthConfig authConfig
-
-
Constructor Detail
-
ExternalIdNotesLoader
protected ExternalIdNotesLoader(ExternalIdCache externalIdCache, com.google.gerrit.metrics.MetricMaker metricMaker, AllUsersName allUsersName, DynamicMap<ExternalIdUpsertPreprocessor> upsertPreprocessors, ExternalIdFactory externalIdFactory, AuthConfig authConfig)
-
-
Method Detail
-
load
public abstract ExternalIdNotes load(org.eclipse.jgit.lib.Repository allUsersRepo) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
Loads the external ID notes from the current tip of therefs/meta/external-ids
branch.- Parameters:
allUsersRepo
- the All-Users repository- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
load
public abstract ExternalIdNotes load(org.eclipse.jgit.lib.Repository allUsersRepo, org.eclipse.jgit.lib.ObjectId rev) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
Loads the external ID notes from the specified revision of therefs/meta/external-ids
branch.- Parameters:
allUsersRepo
- the All-Users repositoryrev
- the revision from which the external ID notes should be loaded, ifnull
the external ID notes are loaded from the current tip, ifObjectId.zeroId()
it's assumed that therefs/meta/external-ids
branch doesn't exist and the loaded external IDs will be empty- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
updateExternalIdCacheAndMaybeReindexAccounts
public void updateExternalIdCacheAndMaybeReindexAccounts(ExternalIdNotes externalIdNotes, Collection<Account.Id> accountsToSkipForReindex) throws IOException
Updates the external ID cache. Subclasses of typeExternalIdNotes.Factory
will also reindex the accounts for which external IDs were modified, while subclasses of typeExternalIdNotes.FactoryNoReindex
will skip this.Must only be called after committing changes.
- Parameters:
externalIdNotes
- the committed updates that should be applied to the cache. This first and last element must be the updates commited first and last, respectively.accountsToSkipForReindex
- accounts that should not be reindexed. This is to avoid double reindexing when updated accounts will already be reindexed by ReindexAfterRefUpdate.- Throws:
IOException
-
reindexAccount
protected abstract void reindexAccount(Account.Id id)
-
-