public class BatchUpdate extends Object implements AutoCloseable
An update operation can be divided into three phases:
BatchRefUpdate
.
Similarly, all post-update steps, such as sending email, must run only after all storage mutations have completed.
Modifier and Type | Class and Description |
---|---|
static interface |
BatchUpdate.Factory |
Modifier and Type | Method and Description |
---|---|
BatchUpdate |
addOp(Change.Id id,
BatchUpdateOp op) |
BatchUpdate |
addRepoOnlyOp(RepoOnlyOp op) |
void |
close() |
void |
execute() |
void |
execute(BatchUpdateListener listener) |
static void |
execute(Collection<BatchUpdate> updates,
BatchUpdateListener listener,
boolean dryrun) |
Map<String,org.eclipse.jgit.transport.ReceiveCommand> |
getRefUpdates() |
BatchUpdate |
insertChange(InsertChangeOp op) |
static com.google.inject.Module |
module() |
BatchUpdate |
setNotify(NotifyResolver.Result notify)
Set the default notification settings for all changes in the batch.
|
BatchUpdate |
setNotifyHandling(Change.Id changeId,
NotifyHandling notifyHandling)
Override the
NotifyHandling on a per-change basis. |
BatchUpdate |
setOnSubmitValidators(OnSubmitValidators onSubmitValidators)
Add a validation step for intended ref operations, which will be performed at the end of
RepoOnlyOp.updateRepo(RepoContext) step. |
BatchUpdate |
setPushCertificate(org.eclipse.jgit.transport.PushCertificate pushCert) |
BatchUpdate |
setRefLogMessage(String refLogMessage) |
BatchUpdate |
setRepository(org.eclipse.jgit.lib.Repository repo,
org.eclipse.jgit.revwalk.RevWalk revWalk,
org.eclipse.jgit.lib.ObjectInserter inserter) |
public static com.google.inject.Module module()
public static void execute(Collection<BatchUpdate> updates, BatchUpdateListener listener, boolean dryrun) throws UpdateException, RestApiException
UpdateException
RestApiException
public void close()
close
in interface AutoCloseable
public void execute(BatchUpdateListener listener) throws UpdateException, RestApiException
UpdateException
RestApiException
public void execute() throws UpdateException, RestApiException
UpdateException
RestApiException
public BatchUpdate setRepository(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevWalk revWalk, org.eclipse.jgit.lib.ObjectInserter inserter)
public BatchUpdate setPushCertificate(org.eclipse.jgit.transport.PushCertificate pushCert)
public BatchUpdate setRefLogMessage(String refLogMessage)
public BatchUpdate setNotify(NotifyResolver.Result notify)
notify
- notification settings.public BatchUpdate setNotifyHandling(Change.Id changeId, NotifyHandling notifyHandling)
NotifyHandling
on a per-change basis.
Only the handling enum can be overridden; all changes share the same value for NotifyResolver.Result.accounts()
.
changeId
- change ID.notifyHandling
- notify handling.public BatchUpdate setOnSubmitValidators(OnSubmitValidators onSubmitValidators)
RepoOnlyOp.updateRepo(RepoContext)
step.public BatchUpdate addOp(Change.Id id, BatchUpdateOp op)
public BatchUpdate addRepoOnlyOp(RepoOnlyOp op)
public BatchUpdate insertChange(InsertChangeOp op) throws IOException
IOException