Package com.google.gerrit.server.update
Interface ChangeContext
-
- All Superinterfaces:
Context
public interface ChangeContext extends Context
Context for performing theBatchUpdateOp.updateChange(com.google.gerrit.server.update.ChangeContext)
phase.A single
ChangeContext
corresponds to updating a single change; if aBatchUpdate
spans multiple changes, then multipleChangeContext
instances will be created.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
deleteChange()
InstructBatchUpdate
to delete this change.default Change
getChange()
ChangeNotes
getNotes()
Get the up-to-date notes for this change.ChangeUpdate
getUpdate(PatchSet.Id psId)
Get an update for this change at a given patch set.-
Methods inherited from interface com.google.gerrit.server.update.Context
getAccount, getAccountId, getIdentifiedUser, getNotify, getProject, getRepoView, getRevWalk, getTimeZone, getUser, getWhen
-
-
-
-
Method Detail
-
getUpdate
ChangeUpdate getUpdate(PatchSet.Id psId)
Get an update for this change at a given patch set.A single operation can modify changes at different patch sets. Commits in the NoteDb graph within this update are created in patch set order.
To get the current patch set ID, use
PatchSetUtil.current(com.google.gerrit.server.notedb.ChangeNotes)
.- Parameters:
psId
- patch set ID.- Returns:
- handle for change updates.
-
getNotes
ChangeNotes getNotes()
Get the up-to-date notes for this change.The change data is read within the same transaction that
BatchUpdateOp.updateChange(ChangeContext)
is executing.- Returns:
- notes for this change.
-
deleteChange
void deleteChange()
InstructBatchUpdate
to delete this change.If called, all other updates are ignored.
-
getChange
default Change getChange()
- Returns:
- change corresponding to
getNotes()
.
-
-