public interface ReviewService
| Modifier and Type | Interface and Description |
|---|---|
static class |
ReviewService.Action
The actions which can be performed on a review, changing its state.
|
| Modifier and Type | Method and Description |
|---|---|
ReviewData |
addChangesetsToReview(PermId<ReviewData> id,
java.lang.String repository,
java.util.List<ChangesetData> changesets)
Add a changeset to existing review -- the review will contain all the revisions in the changesets.
|
VersionedLineCommentData |
addComment(PermId<ReviewItemData> id,
VersionedLineCommentData comment)
Add a comment to a review item.
|
FisheyeReviewItemData |
addFileToReview(PermId<ReviewData> id,
FileData file,
FileData diff)
Adds a file to the review, optionally diff'ed to a second file.
|
ReviewItemData |
addFisheyeDiff(PermId<ReviewData> id,
java.lang.String repositoryName,
java.lang.String fromPath,
java.lang.String fromRevision,
java.lang.String toPath,
java.lang.String toRevision)
Add the changes between two files in a fisheye repository to the review.
|
GeneralCommentData |
addGeneralComment(PermId<ReviewData> id,
GeneralCommentData comment)
Add a general comment to a review.
|
ReviewData |
addPatchToReview(PermId<ReviewData> id,
java.lang.String patch)
Add a patch to existing review -- the review will contain provied patch
|
ReviewData |
addPatchToReview(PermId<ReviewData> id,
java.lang.String patch,
AnchorData anchorData)
Add a patch to existing review.
|
ReviewData |
addPatchToReview(PermId<ReviewData> id,
java.lang.String patch,
AnchorData anchorData,
java.lang.String source)
Add a patch to existing review.
|
GeneralCommentData |
addReply(PermId<CommentData> commentId,
GeneralCommentData comment)
Add a reply to comment in a review.
|
void |
addReviewers(PermId<ReviewData> id,
java.lang.String[] userNames)
Add reviewers to a review
|
FisheyeReviewItemData |
addReviewItem(PermId<ReviewData> reviewId,
FisheyeReviewItemData reviewItem)
Adds the given review item to the review.
|
ReviewItemData |
addReviewItemRevisions(PermId<ReviewData> reviewId,
PermId<ReviewItemData> itemId,
java.util.List<java.lang.String> revisions)
Adds the given list of revisions to the supplied review item, merging if required.
|
DetailedReviewData |
addReviewRevisions(PermId<ReviewData> reviewId,
java.util.List<CrucibleRevisionData> reviewItems)
Adds a review item for each of the
CrucibleRevisionData given. |
ReviewData |
changeState(PermId<ReviewData> id,
ReviewService.Action action)
Change the state of a review by performing an action on it.
|
ReviewData |
changeState(PermId<ReviewData> id,
java.lang.String action)
Change the state of a review by performing an action on it.
|
void |
checkChangesetSizeAcceptable(java.util.List<ChangesetData> changesets,
java.lang.String repository)
Allows to check if the size of changesets does not exceed allowed limit so they can be added to a review.
|
ReviewData |
closeReviewWithSummary(PermId<ReviewData> id,
java.lang.String message)
Complete/uncomplte review by reviewer
|
void |
completeReview(PermId<ReviewData> reviewDataPermId,
boolean complete)
Complete/uncomplete review by reviewer
|
DetailedReviewData |
createDetailedReview(DetailedReviewData review)
Create a new review from the attributes in a
DetailedReviewData instance (similar to
createReview(com.atlassian.crucible.spi.data.ReviewData), but also
copies the list of Reviewers into the
new review. |
ReviewData |
createReview(ReviewData review)
Create a new review from the attributes in a ReviewData instance.
|
ReviewData |
createReviewFromChangeSets(ReviewData review,
java.lang.String repository,
java.util.List<ChangesetData> changesets)
Create a new review from a changesets -- the review will contain all the revisions in the changesets
|
ReviewData |
createReviewFromPatch(ReviewData review,
java.lang.String patch)
Create a new review from a patch.
|
ReviewData |
createReviewFromPatch(ReviewData review,
java.lang.String patch,
AnchorData anchorData)
Create a new review from a patch, and anchor it to the repository given by
AnchorData.getAnchorRepository(). |
ReviewData |
createSnippetReview(ReviewData review,
java.lang.String snippet,
java.lang.String filename)
Create a new snippet review from text
|
void |
deleteReview(PermId<ReviewData> id)
Permanently delete a review.
|
java.lang.String |
extractReviewTitle(java.lang.String text) |
java.util.List<ActionData> |
getAllowedActionsForReview(PermId<ReviewData> id)
Get a list of the actions which the current user is allowed to perform
on the review.
|
java.util.List<ActionData> |
getAllowedTransitionsForReview(PermId<ReviewData> id)
Get a list of the actions which the current user can perform on this
review, given its current state and the user's permissions.
|
java.util.Set<ReviewerData> |
getAllReviewers(PermId<ReviewData> id)
Get the reviewer data of all the reviewers on a review.
|
java.util.List<ReviewData> |
getAllReviews(boolean details)
Get a ReviewData instance for each review.
|
java.util.List<ReviewData> |
getAllReviewsForItem(java.lang.String path,
java.lang.String repositoryName,
boolean details)
Finds all reviews that contain at least one revision of the specified file.
|
java.util.List<VersionedLineCommentData> |
getAllRevisionComments(PermId<ReviewData> id)
Get a list of the comments on all the review items in a review, i.e., excluding
general comments, that are visible to the effective user for a particular review.
|
java.util.List<VersionedLineCommentData> |
getAllRevisionComments(PermId<ReviewData> id,
boolean withHtmlMessage)
Same as calling
getAllRevisionComments(com.atlassian.crucible.spi.PermId). |
java.util.List<ReviewData> |
getChildReviews(PermId<ReviewData> id)
Get the child reviews belonging to a review
|
java.util.List<ReviewData> |
getChildReviews(PermId<ReviewData> id,
boolean details)
Get the child reviews belonging to a review
|
CommentData |
getComment(PermId<CommentData> id)
Get the
details of a comment by its id. |
CommentData |
getComment(PermId<CommentData> id,
boolean withHtmlMessage)
Get the
details of a comment by its id. |
java.util.Set<ReviewerData> |
getCompletedReviewers(PermId<ReviewData> reviewDataPermId)
Get the reviewer data of the reviewers that already completed a review.
|
java.util.List<ReviewData> |
getCustomFilterReviews(CustomFilterData filter,
boolean details)
Get a list of all the reviews for which the user involved based on predefined criteria.
|
java.util.List<ReviewData> |
getFilteredReviews(java.lang.String filter,
boolean details)
Get a list of all the reviews for which the user involved based on predefined criteria.
|
java.util.List<GeneralCommentData> |
getGeneralComments(PermId<ReviewData> id)
Get a list of the general comments visible to the effective user for a particular review.
|
java.util.List<GeneralCommentData> |
getGeneralComments(PermId<ReviewData> id,
boolean withHtmlMessage)
Same as
getGeneralComments(com.atlassian.crucible.spi.PermId),except if the parameter withHtmlMessage is set to true, CommentDataImpl.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup). |
java.util.List<CustomFieldDefData> |
getMetrics(int metricsVersion)
Get metrics metadata for specified metrics version
|
java.util.List<GeneralCommentData> |
getReplies(PermId<CommentData> commentId)
Get a list of the comment replies that are visible to the effective user.
|
java.util.List<GeneralCommentData> |
getReplies(PermId<CommentData> commentId,
boolean withHtmlMessage)
Same as calling
getReplies(com.atlassian.crucible.spi.PermId). |
ReviewData |
getReview(PermId<ReviewData> id)
Gets a single review from its permId.
|
ReviewData |
getReview(PermId<ReviewData> id,
boolean details)
Deprecated.
use the versions without the 'details' parameter
|
DetailedReviewData |
getReviewDetails(PermId<ReviewData> id)
Get a single review from its permId.
|
FisheyeReviewItemData |
getReviewItem(PermId<ReviewData> reviewDataPermId,
PermId<ReviewItemData> reviewItemDataPermId)
Returns detailed information for a specific review item.
|
java.util.List<ReviewItemData> |
getReviewItemsForReview(PermId<ReviewData> id)
Get a list of all the items in a review.
|
java.util.List<PatchGroupData> |
getReviewPatches(PermId<ReviewData> id)
Get the list of patches in the review
|
java.util.List<ReviewData> |
getReviewsInStates(ReviewData.State[] states,
boolean details)
Retrieves all reviews that are in one of the the specified states.
|
java.util.Set<ReviewerData> |
getUncompletedReviewers(PermId<ReviewData> reviewDataPermId)
Get the reviewer data of the reviewers that didn't complete the review.
|
java.util.List<ReviewData> |
getUncompletedReviewsForUser(java.lang.String userName)
Get a list of all the reviews for which the user is a reviwer who has not completed the review.
|
java.util.List<VersionedLineCommentData> |
getVersionedComments(PermId<ReviewItemData> id)
Get a list of the comments visible to the effective user for a particular review item.
|
java.util.List<VersionedLineCommentData> |
getVersionedComments(PermId<ReviewItemData> id,
boolean withHtmlMessage)
Same as
getVersionedComments(com.atlassian.crucible.spi.PermId), except if the parameter withHtmlMessage is set to true, CommentDataImpl.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup). |
VersionInfo |
getVersionInfo()
Deprecated.
Moved to ServerInfoService
|
boolean |
hasPermission(PermId<ReviewData> id,
java.lang.String actionName)
Does the current user have permission to perform the given action on the given review?
|
DetailedReviewData |
markAllCommentsAsRead(PermId<ReviewData> reviewId)
For the effective user, mark all comments in a review as read (except those marked as leave unread).
|
CommentData |
markCommentAsLeaveUnread(PermId<CommentData> commentId)
Mark a comment as leave unread for the effective user (even if already marked
as leave unread).
|
CommentData |
markCommentAsRead(PermId<CommentData> commentId)
Mark a comment as read by the effective user (even if already read).
|
void |
postComment(PermId<CommentData> commentId)
Post a comment in draft state (any kind of comment, also reply).
|
void |
postComments(PermId<ReviewData> id)
Post all draft comments, including replies, authored by the effective user.
|
java.util.List<UserData> |
remindIncompleteReviewers(PermId<ReviewData> id)
Send a reminder message to incomplete reviewers about finishing this review.
|
java.util.List<UserData> |
remindIncompleteReviewers(PermId<ReviewData> id,
java.util.List<java.lang.String> recipients,
java.lang.String message)
Send a reminder message to incomplete reviewers about finishing this review.
|
void |
removeComment(PermId<CommentData> commentId)
Remove a comment, and all of its descendent draft replies, from a review.
|
void |
removeReviewer(PermId<ReviewData> id,
java.lang.String userName)
Remove reviewers from a review
|
void |
removeReviewItem(PermId<ReviewData> reviewId,
PermId<ReviewItemData> itemId)
Remove an item from a review.
|
void |
removeReviewItemRevisions(PermId<ReviewData> reviewId,
PermId<ReviewItemData> itemId,
java.util.List<java.lang.String> revisions)
Removes the revisions given from the review item in the review specified by the id.
|
FisheyeReviewItemData |
setReviewItem(PermId<ReviewData> reviewId,
PermId<ReviewItemData> itemId,
FisheyeReviewItemData reviewItem)
sets the review item specified by itemId with the given reviewItem.
|
void |
tryAutomaticJiraLinking(PermId<ReviewData> id)
Try to link the given review to an existing JIRA issue.
|
void |
updateComment(PermId<CommentData> commentId,
GeneralCommentData comment)
Update the details of a comment.
|
ReviewData createReview(ReviewData review)
review - a ReviewData containing the attributes of the review.DetailedReviewData createDetailedReview(DetailedReviewData review)
DetailedReviewData instance (similar to
createReview(com.atlassian.crucible.spi.data.ReviewData), but also
copies the list of Reviewers into the
new review.review - a DetailedReviewData
containing the attributes of the review.DetailedReviewData instance
with the permId attribute set to the id of the review which was just created.ReviewData createReviewFromPatch(ReviewData review, java.lang.String patch) throws ChangeSetContentTooLargeException
review - a ReviewData containing the attributes of the review.patch - a String containing the patch as a stream of UTF8 characters.ChangeSetContentTooLargeException - if the given patch is too large (contains too many files) for a
single reviewReviewData createReviewFromPatch(ReviewData review, java.lang.String patch, AnchorData anchorData) throws PatchAnchorFailedException, ChangeSetContentTooLargeException
AnchorData.getAnchorRepository().review - the review data containing the review attributespatch - a UTF-8 string of the patchanchorData - a pojo with the anchor info. You can anchor to a particular repository by setting the
anchorRepository property to the repository or by calling the constructor AnchorData.AnchorData(String).
To anchor to a particular path (e.g., branches/branch1, instead of trunk), set the anchorPath
property to the desired path. Make sure this path exists for the repository given by the
anchorRepository property, otherwise, a PatchAnchorFailedException will be thrown. If the patch
given has a different path (e.g., it was not produced by svn diff), then you may be required to
also set the stripCount property. This property indicates how many path elements (or
directories) to strip away from the path, starting from the root directory, before appending to
the anchorPath to produce the final path to which anchoring occurs.
For example, given that we wish to anchor the patch to "branches/branch1" in the repository
"repo", and the patch contains a file "/root/trunk/dir1/a.txt", , we would set the anchPath
property to "branches/branch1", the anchorRepository to "repo", and the stripCount property to
2. We can achieve this by either calling the appropriate setters, or in one go by calling the
constructor AnchorData.AnchorData(String, String, Integer).
However, in most cases, simply setting the anchorRepository (leaving the other properties null)
should be enough, because crucible will automatically compute the correct anchor path, and the
correct stripCount, based on the information provided by the patch.
If anchorData is null, anchoring will not happen.AnchorData.getAnchorRepository().PatchAnchorFailedException - If anchoring fails, e.g., due to the repository not being available, or if
patch anchoring fails (e.g, because the anchor path was not found), then a
PatchAnchorFailedException will be
thrown. The AnchorData passed into this method can be obtained by calling PatchAnchorFailedException.getAnchorData().ChangeSetContentTooLargeException - if the given patch is too large (contains too many files) for a
single reviewReviewData createSnippetReview(ReviewData review, java.lang.String snippet, java.lang.String filename)
review - a ReviewData containing the attributes of the review.snippet - a String containing the snippet (review contents) as a stream of UTF8 characters.filename - a suggested filename eg "test.java", "test.sql" to indicate syntax highlighting as defined in FISHEYE_HOME/syntax
pass in null and we will use "filename.txt"
pass in a value with no "." character, eg "java" and we will prefix it with "filename." eg "filename.java"
FISHEYE_HOME/syntax an always be update _after_ creating this snippet, if the extension used was not definedReviewData createReviewFromChangeSets(ReviewData review, java.lang.String repository, java.util.List<ChangesetData> changesets) throws ChangeSetContentTooLargeException
review - a ReviewData containing the attributes of the review.repository - a String naming the repository the changesets are from.changesets - a list of changesets containing the name of the changeset, relative to the repositoryChangeSetContentTooLargeException - if the total size of aggregated changesets exceeds allowed limitReviewData addChangesetsToReview(PermId<ReviewData> id, java.lang.String repository, java.util.List<ChangesetData> changesets) throws ChangeSetContentTooLargeException, ReviewContentTooLargeException
id - an id of reviewrepository - repository name of added changesetchangesets - a list of changesets containing the name of the changeset, relative to the repo given in the ReviewDataChangeSetContentTooLargeException - if the total size of aggregated changesets exceeds allowed limitReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.DetailedReviewData addReviewRevisions(PermId<ReviewData> reviewId, java.util.List<CrucibleRevisionData> reviewItems) throws java.lang.IllegalArgumentException, NotFoundException, NotPermittedException, ChangeSetContentTooLargeException, ReviewContentTooLargeException
CrucibleRevisionData given.reviewId - the PermId of the review.reviewItems - a list of CrucibleRevisionData, each one containing
the desired shape of the review item. If the CrucibleRevisionData
contains a path that already exists (i.e., an existing review item with the same path is in
the review), then the CrucibleRevisionData given here
will merge the revisions with the existing review item revisions instead of creating a new
review item. The merge is documented in addReviewItemRevisions(com.atlassian.crucible.spi.PermId<com.atlassian.crucible.spi.data.ReviewData>, com.atlassian.crucible.spi.PermId<com.atlassian.crucible.spi.data.ReviewItemData>, java.util.List<java.lang.String>).DetailedReviewData object with the added CrucibleRevisionDatajava.lang.IllegalArgumentException - if the repository does not exist for one or more of the given CrucibleRevisionData, or if one or more of the
path does not exist in the repository specified in the CrucibleRevisionData, or if a revision
specified in the CrucibleRevisionData
does not exist.NotFoundException - when the review does not existNotPermittedException - if the caller does not have permission to modify the reviewChangeSetContentTooLargeException - if the total size of aggregated changesets exceeds allowed limitReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.FisheyeReviewItemData addReviewItem(PermId<ReviewData> reviewId, FisheyeReviewItemData reviewItem) throws java.lang.IllegalArgumentException, NotFoundException, NotPermittedException, ChangeSetContentTooLargeException, ReviewContentTooLargeException
reviewId - a valid review idreviewItem - a valid review item.java.lang.IllegalArgumentException - if the review item provided is invalid. An valid review item is one whose paths
and revisions exists in the source provided.NotFoundException - if the reviewId is not found.NotPermittedException - if the user does not have permission to modify the review.ChangeSetContentTooLargeException - if the total size of aggregated changesets exceeds allowed limitReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.FisheyeReviewItemData setReviewItem(PermId<ReviewData> reviewId, PermId<ReviewItemData> itemId, FisheyeReviewItemData reviewItem) throws java.lang.IllegalArgumentException, NotFoundException, NotPermittedException, ChangeSetContentTooLargeException, ReviewContentTooLargeException
reviewId - a valid review iditemId - a valid review item idreviewItem - a review item to replace the given itemId.java.lang.IllegalArgumentException - if the FisheyeReviewItemData is invalid.
a valid FisheyeReviewItemData is one where the paths and revisions and the
source exists.NotFoundException - if the review does not exist, or if the review item does not exist.NotPermittedException - if the caller does not have permission to modify the review, or if the given
itemId could not be deleted (due to having existing comments).ChangeSetContentTooLargeException - if the total size of aggregated changesets exceeds allowed limitReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.ReviewItemData addReviewItemRevisions(PermId<ReviewData> reviewId, PermId<ReviewItemData> itemId, java.util.List<java.lang.String> revisions) throws java.lang.IllegalArgumentException, NotFoundException, NotPermittedException, ReviewContentTooLargeException
a.txt contains revisions 3 to 6, and if:
a.txt will have revisions 3--4--5--6a.txt will have revisions 2--3--6--7a.txt will have revisions 2--3--6a.txt will have revisions 3--6--7a.txt will have revisions 2--3--4--6a.txt will have revisions 3--4--6--7reviewId - the id of the reviewitemId - the id of the review itemrevisions - a list of revisions to add to the review item, merging if required. If a revision already exists
in the given review item, then the given revision is ignored.java.lang.IllegalArgumentException - when one or more of the given list of revision does not existNotFoundException - if the review does not exist, or if the review item does not existNotPermittedException - if the caller does not have permission to modify the reviewReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.void removeReviewItemRevisions(PermId<ReviewData> reviewId, PermId<ReviewItemData> itemId, java.util.List<java.lang.String> revisions) throws java.lang.IllegalArgumentException, NotFoundException, NotPermittedException
reviewId - the id of the reviewitemId - the id of the review item from which to remove the list of revisionsrevisions - a list of revisions to remove. If the revision does not exist in the review item, it is ignoredjava.lang.IllegalArgumentException - if any of the given list of revisions does not exist, or if any revision could
not be deleted due to it having exiting comments.NotFoundException - when the review does not exist, or when the review item id is invalidNotPermittedException - if the caller does not have permission to modify the reviewReviewData addPatchToReview(PermId<ReviewData> id, java.lang.String patch) throws ReviewContentTooLargeException, ChangeSetContentTooLargeException
id - an id of reviewpatch - a String containing the patch as a stream of UTF-8 characters.ChangeSetContentTooLargeException - if the given patch is too large (contains too many files) for a
single reviewReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.ReviewData addPatchToReview(PermId<ReviewData> id, java.lang.String patch, AnchorData anchorData) throws PatchAnchorFailedException, ChangeSetContentTooLargeException, ReviewContentTooLargeException
AnchorData.getAnchorRepository().id - an id of the reviewpatch - a String containing the patch as a stream of UTF-8 characters.anchorData - a pojo with the anchor info. see createReviewFromPatch(com.atlassian.crucible.spi.data.ReviewData,
String, com.atlassian.crucible.spi.data.AnchorData) for more information.source - PatchAnchorFailedException - when anchoring failed. see createReviewFromPatch(ReviewData,
String, AnchorData) for more information.ChangeSetContentTooLargeException - if the given patch is too large (contains too many files) for a
single reviewReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.ReviewData addPatchToReview(PermId<ReviewData> id, java.lang.String patch, AnchorData anchorData, java.lang.String source) throws PatchAnchorFailedException, ChangeSetContentTooLargeException, ReviewContentTooLargeException
AnchorData.getAnchorRepository().id - an id of the reviewpatch - a String containing the patch as a stream of UTF-8 characters.anchorData - a pojo with the anchor info. see createReviewFromPatch(com.atlassian.crucible.spi.data.ReviewData,
String, com.atlassian.crucible.spi.data.AnchorData) for more information.source - the patch to source to add to, must be anchored to the same repository as the patch being addedPatchAnchorFailedException - when anchoring failed. see createReviewFromPatch(ReviewData,
String, AnchorData) for more information.ChangeSetContentTooLargeException - if the given patch is too large (contains too many files) for a
single reviewReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.FisheyeReviewItemData addFileToReview(PermId<ReviewData> id, FileData file, FileData diff) throws ReviewContentTooLargeException
id - of the review to add the file tofile - file to include in the review. Required.diff - when not null, fileToReview
gets diff'ed to this file.FisheyeReviewItemData instance.ReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.java.util.List<ReviewData> getAllReviews(boolean details)
details - true if details should be fetched for the review. If the details is set, the review data will also contain the html rendered
comments. Get them by calling CommentData.getMessageAsHtml(). If this parameter is set
to false, then the above call will return null.ReviewData getReview(PermId<ReviewData> id, boolean details)
ReviewData getReview(PermId<ReviewData> id)
id - the PermIdNotFoundException - if the review could not be found.DetailedReviewData getReviewDetails(PermId<ReviewData> id)
CommentData.getMessageAsHtml().id - the PermIdNotFoundException - if the review could not be found.java.util.List<ActionData> getAllowedActionsForReview(PermId<ReviewData> id)
This shows actions the user has permission to perform - the review may not be in a suitable state for all these actions to be performed.
id - the PermIdjava.util.List<ActionData> getAllowedTransitionsForReview(PermId<ReviewData> id)
id - the PermIdjava.util.List<ReviewData> getReviewsInStates(ReviewData.State[] states, boolean details)
states - of reviews to fetchdetails - true if details should be fetched for reviews. If true, the review data will also contain the html rendered comments. Get them by calling
CommentData.getMessageAsHtml(). If false, the above call will return null.java.util.Set<ReviewerData> getAllReviewers(PermId<ReviewData> id)
id - the PermIdjava.util.Set<ReviewerData> getCompletedReviewers(PermId<ReviewData> reviewDataPermId)
reviewDataPermId - the PermIdjava.util.Set<ReviewerData> getUncompletedReviewers(PermId<ReviewData> reviewDataPermId)
reviewDataPermId - the PermIdvoid addReviewers(PermId<ReviewData> id, java.lang.String[] userNames)
id - the PermIduserNames - the set of names of the users to make a reviewervoid removeReviewer(PermId<ReviewData> id, java.lang.String userName)
id - the PermIduserName - the username of the user to remove a reviewer rolejava.util.List<UserData> remindIncompleteReviewers(PermId<ReviewData> id)
id - the PermIdjava.util.List<UserData> remindIncompleteReviewers(PermId<ReviewData> id, java.util.List<java.lang.String> recipients, java.lang.String message)
id - the PermIdrecipients - the usernames to notifymessage - a message to send to the recipients about this reviewReviewItemData addFisheyeDiff(PermId<ReviewData> id, java.lang.String repositoryName, java.lang.String fromPath, java.lang.String fromRevision, java.lang.String toPath, java.lang.String toRevision) throws ReviewContentTooLargeException
id - the PermIdrepositoryName - a String naming the repository to use.fromPath - the path of the older version of the file within the repository.fromRevision - the revision of the older version.toPath - the path of the newer version of the file within the repository (often the same as fromPath)toRevision - the revision of the newer version of the file.ReviewContentTooLargeException - if the review is at or over allowed content size limit so new changes
cannot be added until some other content is removed from review first.void removeReviewItem(PermId<ReviewData> reviewId, PermId<ReviewItemData> itemId)
reviewId - the PermIditemId - the PermIdjava.util.List<ReviewItemData> getReviewItemsForReview(PermId<ReviewData> id)
id - PermIdVersionedLineCommentData addComment(PermId<ReviewItemData> id, VersionedLineCommentData comment)
If no line ranges are specified in the comment a review item level comment
is created, otherwise an inline comment is created. When creating an inline
comment, if using the deprecated VersionedLineCommentData.getFromLineRange()
and VersionedLineCommentData.getToLineRange() (instead of
VersionedLineCommentData.getLineRanges()),
the comment will be created on the oldest and newest revision of the review item.
Emits a CommentCreatedEvent for the created comment.
id - the PermId<ReviewItemData> of the item to add the comment to.comment - a VersionedLineCommentData containing the details of the comment.VersionedLineCommentData with the details of the created comment.
The CommentDataImpl.getMessageAsHtml() will contain the comment renderd in html.java.lang.NullPointerException - if any argument is nullNotFoundException - if the specified review item doesn't existNotPermittedException - if the effective principal is not permitted to comment on the reviewjava.lang.IllegalArgumentException - if the comment refers to a non-existent revision of the review item, or
is to be made on more than two revisions of the review itemjava.lang.IllegalStateException - if the review containing the review item is not open for
commenting (see ReviewData.State)GeneralCommentData addGeneralComment(PermId<ReviewData> id, GeneralCommentData comment)
Emits a CommentCreatedEvent for the created comment.
id - the PermId<ReviewData> of the review to add the comment tocomment - a GeneralCommentData containing the details of the commentGeneralCommentData with the details of the created comment.
The CommentDataImpl.getMessageAsHtml() will contain the comment renderd in html.java.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the review permId is not well-formed;
if replies are specified for the new commentNotFoundException - if the review does not existNotPermittedException - if the effective principal is not permitted to comment on the reviewjava.lang.IllegalStateException - if the review is not open for commenting
(see ReviewData.State)CommentData getComment(PermId<CommentData> id)
details of a comment by its id.
Same as calling getComment(com.atlassian.crucible.spi.PermId, boolean) with withHtmlMessage set to false.id - the PermId<CommentData> of the comment to retrieve.CommentData subclass.getComment(com.atlassian.crucible.spi.PermId , boolean)CommentData getComment(PermId<CommentData> id, boolean withHtmlMessage)
details of a comment by its id.id - the PermId<CommentData> of the comment to retrieve.withHtmlMessage - If true, the CommentData will also contain the html rendered comment. Get it by calling CommentData.getMessageAsHtml(). If false, the above call will return null.CommentData subclass.java.lang.NullPointerException - if id is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formedNotFoundException - if the comment doesn't existNotPermittedException - if the effective principal is not permitted to view the review containing the comment, or if the comment is a
draft and the effective user isn't its authorvoid updateComment(PermId<CommentData> commentId, GeneralCommentData comment)
Although you can update any type of comment, it's not possible to modify the revisions or line ranges of versioned line comments.
Emits a CommentUpdatedEvent for the updated comment.
commentId - the PermId<CommentData> of the comment to update.comment - a GeneralCommentData containing the details of the comment.java.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formed;
if the comment specifies any repliesNotFoundException - if the comment doesn't existNotPermittedException - if the effective user is not permitted to comment on the review containing
the comment,
or if the effective user is not author of the commentjava.lang.IllegalStateException - if the review containing the comment is not open
for commenting (see ReviewData.State)void removeComment(PermId<CommentData> commentId) throws NotFoundException
Emits a CommentDeletedEvent for the comment if
it wasn't a draft. Note that no event is emitted for removed descendent draft replies.
commentId - the PermId<CommentData> of the comment to remove.java.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formed;
if the comment has non-draft repliesNotFoundException - if the comment doesn't existNotPermittedException - if the effective user is not permitted to comment on the review containing
the comment,
or if the effective user is not the author of the commentjava.lang.IllegalStateException - if the review containing the comment is not open
for commenting (see ReviewData.State)GeneralCommentData addReply(PermId<CommentData> commentId, GeneralCommentData comment)
Emits a CommentCreatedEvent for the added reply.
commentId - the PermId<CommentData> of the comment to add reply to.comment - a GeneralCommentData containing the details of the replyGeneralCommentData with the details of the comment added. The CommentDataImpl.getMessageAsHtml()
will contain the comment renderd in html.java.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formed; if the comment specifies any replies; if you add a non-draft reply
to a draft parent commentNotFoundException - if the parent comment doesn't existNotPermittedException - if the effective user is not permitted to comment on the review containing the parent commentjava.lang.IllegalStateException - if the review containing the parent comment is not open for commenting (see ReviewData.State)void postComment(PermId<CommentData> commentId)
Note that once a review is no longer open for comments, e.g., in summary or closed, there are no longer any draft comments.
Emits a CommentUpdatedEvent for the posted comment,
commentId - the PermId<CommentData> of the comment to post.java.lang.NullPointerException - if commentId or commentId.getId() are nulljava.lang.IllegalArgumentException - if the comment permId isn't valid,
or if the comment isn't a draft,
or if posting a draft reply to a draft parent commentNotFoundException - if the comment doesn't existNotPermittedException - if the effective user is not permitted to comment
on the review containing the comment,
or the effective user is not the author of the comment.java.lang.IllegalStateException - if the review containing the comment is not open
for commenting (see ReviewData.State)void postComments(PermId<ReviewData> id)
Emits a CommentCreatedEvent for each draft
comment posted.
id - the PermId<ReviewData> of the review to post the comment.java.lang.NullPointerException - if id is nulljava.lang.IllegalArgumentException - if id is not a well-formed review PermIdNotFoundException - if the review doesn't existNotPermittedException - if the effective user is not permitted to comment on the reviewjava.lang.IllegalStateException - if the review is not open for commenting
(see ReviewData.State)DetailedReviewData markAllCommentsAsRead(PermId<ReviewData> reviewId)
reviewId - the PermId<ReviewData> of the review to mark all comments as read.CommentData.getMessageAsHtml() contain the comments rendered in htmljava.lang.NullPointerException - if reviewId is nulljava.lang.IllegalArgumentException - if reviewId is not a well-formed review permIdNotFoundException - if the review doesn't existNotPermittedException - if the effective user is not permitted to comment on the reviewjava.lang.IllegalStateException - if the review is not open for commenting
(see ReviewData.State)CommentData markCommentAsRead(PermId<CommentData> commentId)
commentId - the PermId<CommentData> of the comment to mark as read.CommentData.getMessageAsHtml() will return the
rendered html.java.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formedNotFoundException - if the comment doesn't existNotPermittedException - if the effective user is not permitted to comment on the reviewjava.lang.IllegalStateException - if the review containing the comment is not open
for commenting (see ReviewData.State)CommentData markCommentAsLeaveUnread(PermId<CommentData> commentId)
commentId - the PermId<CommentData> to leave unread.CommentData.getMessageAsHtml() will return the
rendered html.java.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formedNotFoundException - if the comment doesn't existNotPermittedException - if the effective user is not permitted to comment on the reviewjava.lang.IllegalStateException - if the review containing the comment is not open
for commenting (see ReviewData.State)void completeReview(PermId<ReviewData> reviewDataPermId, boolean complete)
reviewDataPermId - the PermIdcomplete - - true-complete, false - uncompleteReviewData closeReviewWithSummary(PermId<ReviewData> id, java.lang.String message)
id - the PermIdmessage - summmary messageCommentData.getMessageAsHtml() will *NOT* return the
rendered html.java.util.List<GeneralCommentData> getGeneralComments(PermId<ReviewData> id)
Note that the list returned by this method only contains the root-level
comments and not any replies. The replies to each comment are recursively
accessed through the CommentData.getReplies()
method.
CommentDataImpl.getMessageAsHtml() will *NOT* return the
rendered html. Call getGeneralComments(com.atlassian.crucible.spi.PermId, boolean) with the withHtmlMessage flag set to true to do that.id - the PermId<ReviewData> of the review.List<GeneralCommentData> containing the comments or an empty
list if there are nonejava.lang.NullPointerException - if id is nulljava.lang.IllegalArgumentException - if the review permId is not well-formedNotPermittedException - if the effective principal is not permitted to view the reviewNotFoundException - if the review does not existjava.util.List<GeneralCommentData> getGeneralComments(PermId<ReviewData> id, boolean withHtmlMessage)
getGeneralComments(com.atlassian.crucible.spi.PermId),except if the parameter withHtmlMessage is set to true, CommentDataImpl.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup).
Otherwise, CommentDataImpl.getMessageAsHtml() will return null.id - the perma id of the review frin which to get the general comments.withHtmlMessage - true if the returned comment should have the property 'messageAsHtml' contain the rendered html.java.util.List<VersionedLineCommentData> getVersionedComments(PermId<ReviewItemData> id)
Note that the list returned by this method only contains the root-level
comments and not any replies. The replies to each comment are recursively
accessed through the CommentData.getReplies()
method.
id - the PermId<ReviewItemData> of the item.List<VersionedLineCommentData> containing the comments or an empty
list if there are nonejava.lang.NullPointerException - if id is nullNotFoundException - if the specified review item doesn't existNotPermittedException - if the effective principal is not permitted to view the
review containing the review itemjava.util.List<VersionedLineCommentData> getVersionedComments(PermId<ReviewItemData> id, boolean withHtmlMessage)
getVersionedComments(com.atlassian.crucible.spi.PermId), except if the parameter withHtmlMessage is set to true, CommentDataImpl.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup).
Otherwise, CommentDataImpl.getMessageAsHtml() will return null.id - the PermId<ReviewItemData> of the item.withHtmlMessage - true if the returned comment should have the property 'messageAsHtml' contain the rendered html.List<VersionedLineCommentData> containing the comments (with the individual comments
optionally rendered as HTML, see above) or an empty list if there are nonejava.util.List<VersionedLineCommentData> getAllRevisionComments(PermId<ReviewData> id)
Note that the list returned by this method only contains the root-level
comments and not any replies. The replies to each comment are recursively
accessed through the CommentData.getReplies()
method.
id - the PermId<ReviewData> of the review.List<VersionedLineCommentData> containing the comments or an
empty list if there are nonejava.lang.NullPointerException - if id is nulljava.lang.IllegalArgumentException - if the review permId is not well-formedNotPermittedException - if you are not permitted to view the reviewNotFoundException - if the review does not existjava.util.List<VersionedLineCommentData> getAllRevisionComments(PermId<ReviewData> id, boolean withHtmlMessage)
getAllRevisionComments(com.atlassian.crucible.spi.PermId). If 'withHtmlMessage' is true, CommentDataImpl.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup).
Otherwise, it will return null.id - the PermId<ReviewData> of the review.withHtmlMessage - true if the returned comment should have the property 'messageAsHtml' contain the rendered html.List<VersionedLineCommentData> containing the comments (with the individual comments
optionally rendered as HTML, see above) or an empty list if there are nonejava.util.List<GeneralCommentData> getReplies(PermId<CommentData> commentId)
Note that the list returned by this method only contains the direct child
comments and not any more deeply nested replies. The nested replies to each
returned reply are recursively accessed through the
CommentData.getReplies() method.
commentId - id of the parent commentjava.lang.NullPointerException - if any argument is nulljava.lang.IllegalArgumentException - if the comment permId is not well-formedNotFoundException - if the comment doesn't existNotPermittedException - if the effective principal is not permitted to
view the review containing the comment;
if the comment is a draft and the effective user isn't its author;java.util.List<GeneralCommentData> getReplies(PermId<CommentData> commentId, boolean withHtmlMessage)
getReplies(com.atlassian.crucible.spi.PermId). If 'withHtmlMessage' is true, CommentDataImpl.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup).
Otherwise, CommentDataImpl.getMessageAsHtml() will return null.commentId - id of the parent commentwithHtmlMessage - true if the returned comment should have the property 'messageAsHtml' contain the rendered html.java.util.List<ReviewData> getUncompletedReviewsForUser(java.lang.String userName)
userName - a String naming the user.CommentData.getMessageAsHtml() will
*not* return the rendered html.java.util.List<ReviewData> getFilteredReviews(java.lang.String filter, boolean details)
Filter names are:
filter - a predefined filter namedetails - true if details should be fetched for the review. If true, then
CommentData.getMessageAsHtml() will return the comment rendered as html (respecting wiki markup).
Otherwise, CommentData.getMessageAsHtml() will return null.java.util.List<ReviewData> getCustomFilterReviews(CustomFilterData filter, boolean details)
filter - custom filter definitiondetails - true if details should be fetched for the review. If true, then CommentData.getMessageAsHtml()
will return the comment rendered as html (respecting wiki markup). Otherwise, CommentData.getMessageAsHtml()
will return null.java.util.List<ReviewData> getAllReviewsForItem(java.lang.String path, java.lang.String repositoryName, boolean details)
path - path to find in reviewsrepositoryName - repository to search for filedetails - output format with details when true. If true, then CommentData.getMessageAsHtml()
will return the comment rendered as html (respecting wiki markup). Otherwise, CommentData.getMessageAsHtml() will return null.FisheyeReviewItemData getReviewItem(PermId<ReviewData> reviewDataPermId, PermId<ReviewItemData> reviewItemDataPermId)
reviewDataPermId - review idreviewItemDataPermId - review item idVersionInfo getVersionInfo()
void deleteReview(PermId<ReviewData> id)
id - the PermId of the Review to delete.void tryAutomaticJiraLinking(PermId<ReviewData> id)
Review#getBestSuggestedJiraIssueKey no issue is linked.id - the id of the review to try and link a JIRA issue key tojava.util.List<PatchGroupData> getReviewPatches(PermId<ReviewData> id)
id - the review id to get the patch list forReviewData changeState(PermId<ReviewData> id, java.lang.String action)
id - the PermIdaction - the string representation of Action to perform.CommentData.getMessageAsHtml() will return null.ReviewData changeState(PermId<ReviewData> id, ReviewService.Action action)
id - the PermIdaction - the Action to perform.CommentData.getMessageAsHtml() will return null.java.util.List<ReviewData> getChildReviews(PermId<ReviewData> id)
id - the PermIdjava.util.List<ReviewData> getChildReviews(PermId<ReviewData> id, boolean details)
id - the PermIddetails - true if details should be fetched for the review. If true, then CommentData.getMessageAsHtml()
will return the comment rendered as html (respecting wiki markup). Otherwise, CommentData.getMessageAsHtml()
will return null.java.util.List<CustomFieldDefData> getMetrics(int metricsVersion)
metricsVersion - metric versionboolean hasPermission(PermId<ReviewData> id, java.lang.String actionName)
id - review to check permission againsactionName - action to be performedjava.lang.String extractReviewTitle(java.lang.String text)
void checkChangesetSizeAcceptable(java.util.List<ChangesetData> changesets, java.lang.String repository) throws ChangeSetContentTooLargeException
changesets - list of changesets to be analysedrepository - name of the repository changesets refer to.ChangeSetContentTooLargeException - if the total size of aggregated changesets exceeds allowed limit