Package com.google.gerrit.server.notedb
Class ChangeDraftNotesUpdate.Executor
java.lang.Object
com.google.gerrit.server.notedb.ChangeDraftNotesUpdate.Executor
- All Implemented Interfaces:
ChangeDraftUpdateExecutor,AutoCloseable
- Enclosing class:
ChangeDraftNotesUpdate
public static class ChangeDraftNotesUpdate.Executor
extends Object
implements ChangeDraftUpdateExecutor, AutoCloseable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.google.gerrit.server.ChangeDraftUpdateExecutor
ChangeDraftUpdateExecutor.AbstractFactory -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidexecuteAllAsyncUpdates(org.eclipse.jgit.lib.PersonIdent refLogIdent, String refLogMessage, org.eclipse.jgit.transport.PushCertificate pushCert) Execute all previously queued async updates.Optional<org.eclipse.jgit.lib.BatchRefUpdate> executeAllSyncUpdates(boolean dryRun, org.eclipse.jgit.lib.PersonIdent refLogIdent, String refLogMessage) Note this method does not fireBatchUpdateListener.beforeUpdateRefs(org.eclipse.jgit.lib.BatchRefUpdate)events.booleanisEmpty()Returns whether any updates are queued.voidqueueAllDraftUpdates(com.google.common.collect.ListMultimap<String, ChangeDraftUpdate> updaters) Queues all provided updates for later execution.voidExtracts all drafts (of all authors) for the given change and queue their deletion.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.gerrit.server.ChangeDraftUpdateExecutor
canRunAsync, filterTypedUpdates
-
Method Details
-
queueAllDraftUpdates
public void queueAllDraftUpdates(com.google.common.collect.ListMultimap<String, ChangeDraftUpdate> updaters) throws IOExceptionDescription copied from interface:ChangeDraftUpdateExecutorQueues all provided updates for later execution.The updates are queued to either run synchronously just after change repositories updates, or to run asynchronously afterwards, based on
ChangeDraftUpdateExecutor.canRunAsync(java.util.Collection<? extends com.google.gerrit.server.ChangeDraftUpdate>).- Specified by:
queueAllDraftUpdatesin interfaceChangeDraftUpdateExecutor- Throws:
IOException
-
queueDeletionForChangeDrafts
Description copied from interface:ChangeDraftUpdateExecutorExtracts all drafts (of all authors) for the given change and queue their deletion.See
ChangeDraftUpdateExecutor.canRunAsync(java.util.Collection<? extends com.google.gerrit.server.ChangeDraftUpdate>)for whether the deletions are scheduled as synchronous or asynchronous.- Specified by:
queueDeletionForChangeDraftsin interfaceChangeDraftUpdateExecutor- Throws:
IOException
-
executeAllSyncUpdates
public Optional<org.eclipse.jgit.lib.BatchRefUpdate> executeAllSyncUpdates(boolean dryRun, org.eclipse.jgit.lib.PersonIdent refLogIdent, String refLogMessage) throws IOException Note this method does not fireBatchUpdateListener.beforeUpdateRefs(org.eclipse.jgit.lib.BatchRefUpdate)events. However, since theBatchRefUpdateobject is returned,BatchUpdateListener.afterUpdateRefs()can be fired by the caller.- Specified by:
executeAllSyncUpdatesin interfaceChangeDraftUpdateExecutor- Parameters:
dryRun- whether this is a dry run - i.e. no updates should be maderefLogIdent- user to log as the update creatorrefLogMessage- message to put in the updates log- Returns:
- the executed update, if supported by the implementing class
- Throws:
IOException- in case of an update failure.
-
executeAllAsyncUpdates
public void executeAllAsyncUpdates(org.eclipse.jgit.lib.PersonIdent refLogIdent, String refLogMessage, org.eclipse.jgit.transport.PushCertificate pushCert) Description copied from interface:ChangeDraftUpdateExecutorExecute all previously queued async updates.- Specified by:
executeAllAsyncUpdatesin interfaceChangeDraftUpdateExecutor- Parameters:
refLogIdent- user to log as the update creatorrefLogMessage- message to put in the updates logpushCert- to use for the update
-
isEmpty
public boolean isEmpty()Description copied from interface:ChangeDraftUpdateExecutorReturns whether any updates are queued.- Specified by:
isEmptyin interfaceChangeDraftUpdateExecutor
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-