Class AbstractChangeUpdate

java.lang.Object
com.google.gerrit.server.notedb.AbstractChangeUpdate
Direct Known Subclasses:
ChangeDraftNotesUpdate, ChangeUpdate, RobotCommentUpdate

public abstract class AbstractChangeUpdate extends Object
A single delta related to a specific patch-set of a change.
  • Field Details

    • noteUtil

      protected final ChangeNoteUtil noteUtil
    • accountId

      protected final Account.Id accountId
    • realAccountId

      protected final Account.Id realAccountId
    • authorIdent

      protected final org.eclipse.jgit.lib.PersonIdent authorIdent
    • when

      protected final Instant when
    • serverIdent

      protected final org.eclipse.jgit.lib.PersonIdent serverIdent
    • psId

      protected PatchSet.Id psId
  • Method Details

    • getId

      public Change.Id getId()
    • getNotes

      public ChangeNotes getNotes()
      Returns notes for the state of this change prior to this update. If this update is part of a series managed by a NoteDbUpdateManager, then this reflects the state prior to the first update in the series. A null return value can only happen when the change is being rebuilt from NoteDb. A change that is in the process of being created will result in a non-null return value from this method, but a null return value from AbstractChangeNotes.getRevision().
    • getChange

      public Change getChange()
    • getWhen

      public Instant getWhen()
    • getPatchSetId

      public PatchSet.Id getPatchSetId()
    • setPatchSetId

      public void setPatchSetId(PatchSet.Id psId)
    • getAccountId

      public Account.Id getAccountId()
    • getNullableAccountId

      public Account.Id getNullableAccountId()
    • getRealAccountId

      public Account.Id getRealAccountId()
    • isEmpty

      public abstract boolean isEmpty()
      Whether no updates have been done.
    • getProjectName

      protected abstract Project.NameKey getProjectName()
      Returns the NameKey for the project where the update will be stored, which is not necessarily the same as the change's project.
    • getRefName

      protected abstract String getRefName()
    • setParentCommit

      protected void setParentCommit(org.eclipse.jgit.lib.CommitBuilder cb, org.eclipse.jgit.lib.ObjectId parentCommitId)
    • bypassMaxUpdates

      protected boolean bypassMaxUpdates()
      Whether to allow bypassing the check that an update does not exceed the max update count on an object.
    • applyImpl

      protected abstract org.eclipse.jgit.lib.CommitBuilder applyImpl(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectInserter ins, org.eclipse.jgit.lib.ObjectId curr) throws IOException
      Create a commit containing the contents of this update.
      Parameters:
      ins - inserter to write to; callers should not flush.
      Returns:
      a new commit builder representing this commit, or null to indicate the meta ref should be deleted as a result of this update. The parent, author, and committer fields in the return value are always overwritten. The tree ID may be unset by this method, which indicates to the caller that it should be copied from the parent commit. To indicate that this update is a no-op (but this could not be determined by isEmpty()), return the sentinel NO_OP_UPDATE.
      Throws:
      IOException - if a lower-level error occurred.
    • allowWriteToNewRef

      public boolean allowWriteToNewRef()