Package com.google.gerrit.server.notedb
Class ChangeNotes
java.lang.Object
com.google.gerrit.server.notedb.AbstractChangeNotes<ChangeNotes>
com.google.gerrit.server.notedb.ChangeNotes
View of a single
Change
based on the log of its notes branch.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.google.gerrit.server.notedb.AbstractChangeNotes
AbstractChangeNotes.Args, AbstractChangeNotes.LoadHandle
-
Field Summary
Fields inherited from class com.google.gerrit.server.notedb.AbstractChangeNotes
args
-
Constructor Summary
ConstructorsConstructorDescriptionChangeNotes
(AbstractChangeNotes.Args args, Change change, boolean shouldExist, RefCache refs) ChangeNotes
(AbstractChangeNotes.Args args, Change change, boolean shouldExist, RefCache refs, org.eclipse.jgit.lib.ObjectId metaSha1) -
Method Summary
Modifier and TypeMethodDescriptionboolean
com.google.common.collect.ImmutableList
<Account.Id> Returns a list of all users who have ever been a reviewer on this change.Gets the approvals of all patch sets.com.google.common.collect.ImmutableSet
<AttentionSetUpdate> Returns the most recent update (i.e.com.google.common.collect.ImmutableList
<AttentionSetUpdate> Returns all updates for the attention set.com.google.common.collect.ImmutableList
<ChangeMessage> Returns all change messages, in chronological order, oldest first.com.google.common.collect.ImmutableSet
<Comment.Key> Returns the key-value pairs that are attached to this changecom.google.common.collect.ImmutableList
<HumanComment> getDraftComments
(Account.Id author) com.google.common.collect.ImmutableList
<HumanComment> getDraftComments
(Account.Id author, Change.Id virtualId) com.google.common.collect.ImmutableList
<HumanComment> getDraftComments
(Account.Id author, org.eclipse.jgit.lib.Ref ref) com.google.common.collect.ImmutableSet
<String> Returns an ImmutableSet of all hashtags for this change sorted in alphabetical order.com.google.common.collect.ImmutableListMultimap
<org.eclipse.jgit.lib.ObjectId, HumanComment> Returns inline comments on each revision.ReturnsOptional
value of time when the change was merged.org.eclipse.jgit.lib.ObjectId
com.google.common.collect.ImmutableSortedMap
<PatchSet.Id, PatchSet> Returns reviewers that were modified during this change's current WIP phase.Returns reviewers by email that were modified during this change's current WIP phase.Returns the NameKey for the project where the notes should be stored, which is not necessarily the same as the change's project.Returns name of the reference storing this configuration.Returns reviewers that do not currently have a Gerrit account and were added by email.com.google.common.collect.ImmutableList
<ReviewerStatusUpdate> com.google.common.collect.ImmutableListMultimap
<org.eclipse.jgit.lib.ObjectId, RobotComment> com.google.common.collect.ImmutableList
<SubmitRecord> Returns submit records stored during the most recent submit; only for changes that were actually submitted.com.google.common.collect.ImmutableList
<SubmitRequirementResult> Returns the evaluated submit requirements for the change.int
protected void
Load default values for any instance variables when NoteDb is disabled.protected void
onLoad
(AbstractChangeNotes.LoadHandle handle) Set up the metadata, parsing any state from the loaded revision.static org.eclipse.jgit.errors.ConfigInvalidException
parseException
(Change.Id changeId, String fmt, Object... args) protected org.eclipse.jgit.lib.ObjectId
readRef
(org.eclipse.jgit.lib.Repository repo) Methods inherited from class com.google.gerrit.server.notedb.AbstractChangeNotes
getChangeId, getRevision, load, load, loadRevision, openHandle, reload, self
-
Constructor Details
-
ChangeNotes
public ChangeNotes(AbstractChangeNotes.Args args, Change change, boolean shouldExist, RefCache refs, org.eclipse.jgit.lib.ObjectId metaSha1) -
ChangeNotes
public ChangeNotes(AbstractChangeNotes.Args args, Change change, boolean shouldExist, RefCache refs)
-
-
Method Details
-
parseException
-
getChange
-
getMetaId
public org.eclipse.jgit.lib.ObjectId getMetaId() -
getServerId
-
getPatchSets
-
getApprovals
Gets the approvals of all patch sets. -
getReviewers
-
getReviewersByEmail
Returns reviewers that do not currently have a Gerrit account and were added by email. -
getPendingReviewers
Returns reviewers that were modified during this change's current WIP phase. -
getPendingReviewersByEmail
Returns reviewers by email that were modified during this change's current WIP phase. -
getReviewerUpdates
-
getAttentionSet
Returns the most recent update (i.e. status) per user. -
getAttentionSetUpdates
Returns all updates for the attention set. -
getCustomKeyedValues
Returns the key-value pairs that are attached to this change -
getSubmitRequirementsResult
public com.google.common.collect.ImmutableList<SubmitRequirementResult> getSubmitRequirementsResult()Returns the evaluated submit requirements for the change. We only intend to store submit requirements in NoteDb for closed changes. For closed changes, the results represent the state of evaluating submit requirements for this change when it was merged or abandoned.- Throws:
UnsupportedOperationException
- if submit requirements are requested for an open change.
-
getHashtags
Returns an ImmutableSet of all hashtags for this change sorted in alphabetical order. -
getAllPastReviewers
Returns a list of all users who have ever been a reviewer on this change. -
getSubmitRecords
Returns submit records stored during the most recent submit; only for changes that were actually submitted. -
getChangeMessages
Returns all change messages, in chronological order, oldest first. -
getHumanComments
public com.google.common.collect.ImmutableListMultimap<org.eclipse.jgit.lib.ObjectId,HumanComment> getHumanComments()Returns inline comments on each revision. -
getCommentKeys
-
getUpdateCount
public int getUpdateCount() -
getMergedOn
ReturnsOptional
value of time when the change was merged. -
getDraftComments
-
getDraftComments
public com.google.common.collect.ImmutableList<HumanComment> getDraftComments(Account.Id author, org.eclipse.jgit.lib.Ref ref) -
getDraftComments
public com.google.common.collect.ImmutableList<HumanComment> getDraftComments(Account.Id author, Change.Id virtualId) -
getRobotComments
public com.google.common.collect.ImmutableListMultimap<org.eclipse.jgit.lib.ObjectId,RobotComment> getRobotComments() -
getRobotCommentNotes
-
containsCommentPublished
-
getRefName
Description copied from class:AbstractChangeNotes
Returns name of the reference storing this configuration.- Specified by:
getRefName
in classAbstractChangeNotes<ChangeNotes>
-
getCurrentPatchSet
-
onLoad
protected void onLoad(AbstractChangeNotes.LoadHandle handle) throws NoSuchChangeException, IOException Description copied from class:AbstractChangeNotes
Set up the metadata, parsing any state from the loaded revision.- Specified by:
onLoad
in classAbstractChangeNotes<ChangeNotes>
- Throws:
NoSuchChangeException
IOException
-
loadDefaults
protected void loadDefaults()Description copied from class:AbstractChangeNotes
Load default values for any instance variables when NoteDb is disabled.- Specified by:
loadDefaults
in classAbstractChangeNotes<ChangeNotes>
-
getProjectName
Description copied from class:AbstractChangeNotes
Returns the NameKey for the project where the notes should be stored, which is not necessarily the same as the change's project.- Specified by:
getProjectName
in classAbstractChangeNotes<ChangeNotes>
-
readRef
protected org.eclipse.jgit.lib.ObjectId readRef(org.eclipse.jgit.lib.Repository repo) throws IOException - Overrides:
readRef
in classAbstractChangeNotes<ChangeNotes>
- Throws:
IOException
-