public class PatchLineCommentsUtil extends Object
These methods either query for and update PatchLineComments in the NoteDb or ReviewDb, depending on the state of the NotesMigration.
Constructor and Description |
---|
PatchLineCommentsUtil(GitRepositoryManager repoManager,
AllUsersNameProvider allUsersProvider,
DraftCommentNotes.Factory draftFactory,
NotesMigration migration) |
Modifier and Type | Method and Description |
---|---|
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
byPatchSet(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes,
com.google.gerrit.reviewdb.client.PatchSet.Id psId) |
void |
deleteComments(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeUpdate update,
Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
draftByAuthor(com.google.gerrit.reviewdb.server.ReviewDb db,
com.google.gerrit.reviewdb.client.Account.Id author) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
draftByChange(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
draftByChangeAuthor(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes,
com.google.gerrit.reviewdb.client.Account.Id author) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
draftByChangeFileAuthor(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes,
String file,
com.google.gerrit.reviewdb.client.Account.Id author) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
draftByPatchSetAuthor(com.google.gerrit.reviewdb.server.ReviewDb db,
com.google.gerrit.reviewdb.client.PatchSet.Id psId,
com.google.gerrit.reviewdb.client.Account.Id author,
ChangeNotes notes) |
com.google.common.base.Optional<com.google.gerrit.reviewdb.client.PatchLineComment> |
get(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes,
com.google.gerrit.reviewdb.client.PatchLineComment.Key key) |
void |
insertComments(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeUpdate update,
Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
publishedByChange(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
publishedByChangeFile(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes,
com.google.gerrit.reviewdb.client.Change.Id changeId,
String file) |
List<com.google.gerrit.reviewdb.client.PatchLineComment> |
publishedByPatchSet(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeNotes notes,
com.google.gerrit.reviewdb.client.PatchSet.Id psId) |
static void |
setCommentRevId(com.google.gerrit.reviewdb.client.PatchLineComment c,
PatchListCache cache,
com.google.gerrit.reviewdb.client.Change change,
com.google.gerrit.reviewdb.client.PatchSet ps) |
void |
updateComments(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeUpdate update,
Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) |
void |
upsertComments(com.google.gerrit.reviewdb.server.ReviewDb db,
ChangeUpdate update,
Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) |
@Inject public PatchLineCommentsUtil(GitRepositoryManager repoManager, AllUsersNameProvider allUsersProvider, DraftCommentNotes.Factory draftFactory, NotesMigration migration)
public com.google.common.base.Optional<com.google.gerrit.reviewdb.client.PatchLineComment> get(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes, com.google.gerrit.reviewdb.client.PatchLineComment.Key key) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> publishedByChange(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> draftByChange(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> byPatchSet(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes, com.google.gerrit.reviewdb.client.PatchSet.Id psId) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> publishedByChangeFile(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes, com.google.gerrit.reviewdb.client.Change.Id changeId, String file) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> publishedByPatchSet(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes, com.google.gerrit.reviewdb.client.PatchSet.Id psId) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> draftByPatchSetAuthor(com.google.gerrit.reviewdb.server.ReviewDb db, com.google.gerrit.reviewdb.client.PatchSet.Id psId, com.google.gerrit.reviewdb.client.Account.Id author, ChangeNotes notes) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> draftByChangeFileAuthor(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes, String file, com.google.gerrit.reviewdb.client.Account.Id author) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> draftByChangeAuthor(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeNotes notes, com.google.gerrit.reviewdb.client.Account.Id author) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public List<com.google.gerrit.reviewdb.client.PatchLineComment> draftByAuthor(com.google.gerrit.reviewdb.server.ReviewDb db, com.google.gerrit.reviewdb.client.Account.Id author) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void insertComments(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeUpdate update, Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void upsertComments(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeUpdate update, Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void updateComments(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeUpdate update, Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void deleteComments(com.google.gerrit.reviewdb.server.ReviewDb db, ChangeUpdate update, Iterable<com.google.gerrit.reviewdb.client.PatchLineComment> comments) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public static void setCommentRevId(com.google.gerrit.reviewdb.client.PatchLineComment c, PatchListCache cache, com.google.gerrit.reviewdb.client.Change change, com.google.gerrit.reviewdb.client.PatchSet ps) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException