public class ExternalIdsBatchUpdate
extends java.lang.Object
For NoteDb all updates will result in a single commit to the refs/meta/external-ids branch.
This means callers can prepare many updates by invoking replace(ExternalId, ExternalId)
multiple times and when commit(ReviewDb, String)
is invoked a
single NoteDb commit is created that contains all the prepared updates.
Constructor and Description |
---|
ExternalIdsBatchUpdate(GitRepositoryManager repoManager,
AllUsersName allUsersName,
org.eclipse.jgit.lib.PersonIdent serverIdent) |
Modifier and Type | Method and Description |
---|---|
void |
commit(ReviewDb db,
java.lang.String commitMessage)
Commits this batch.
|
void |
replace(ExternalId extIdToDelete,
ExternalId extIdToAdd)
Adds an external ID replacement to the batch.
|
@Inject public ExternalIdsBatchUpdate(GitRepositoryManager repoManager, AllUsersName allUsersName, org.eclipse.jgit.lib.PersonIdent serverIdent)
public void replace(ExternalId extIdToDelete, ExternalId extIdToAdd)
The actual replacement is only done when commit(ReviewDb, String)
is invoked.
public void commit(ReviewDb db, java.lang.String commitMessage) throws java.io.IOException, com.google.gwtorm.server.OrmException, org.eclipse.jgit.errors.ConfigInvalidException
This means external ID replacements which were prepared by invoking replace(ExternalId, ExternalId)
are now executed. Deletion of external IDs is done before
adding the new external IDs. This means if an external ID is specified for deletion and an
external ID with the same key is specified to be added, the old external ID with that key is
deleted first and then the new external ID is added (so the external ID for that key is
replaced).
For NoteDb a single commit is created that contains all the external ID updates.
java.io.IOException
com.google.gwtorm.server.OrmException
org.eclipse.jgit.errors.ConfigInvalidException