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 TypeMethodDescriptionvoid
close()
void
executeAllAsyncUpdates
(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.boolean
isEmpty()
Returns whether any updates are queued.void
queueAllDraftUpdates
(com.google.common.collect.ListMultimap<String, ChangeDraftUpdate> updaters) Queues all provided updates for later execution.void
Extracts 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, wait
Methods 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:ChangeDraftUpdateExecutor
Queues 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:
queueAllDraftUpdates
in interfaceChangeDraftUpdateExecutor
- Throws:
IOException
-
queueDeletionForChangeDrafts
Description copied from interface:ChangeDraftUpdateExecutor
Extracts 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:
queueDeletionForChangeDrafts
in 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 theBatchRefUpdate
object is returned,BatchUpdateListener.afterUpdateRefs()
can be fired by the caller.- Specified by:
executeAllSyncUpdates
in 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:ChangeDraftUpdateExecutor
Execute all previously queued async updates.- Specified by:
executeAllAsyncUpdates
in 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:ChangeDraftUpdateExecutor
Returns whether any updates are queued.- Specified by:
isEmpty
in interfaceChangeDraftUpdateExecutor
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-