Package org.jboss.set.aphrodite.spi
Interface IssueTrackerService
-
- All Known Implementing Classes:
AbstractIssueTracker
public interface IssueTrackerService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaddCommentToIssue(Collection<org.jboss.set.aphrodite.domain.Issue> issues, org.jboss.set.aphrodite.domain.Comment comment)Adds theCommentto all of the providedIssueobjects.booleanaddCommentToIssue(Map<org.jboss.set.aphrodite.domain.Issue,org.jboss.set.aphrodite.domain.Comment> commentMap)Adds theCommentto the associatedIssueobject for all Issue/Comment pairs in theMap.voidaddCommentToIssue(org.jboss.set.aphrodite.domain.Issue issue, org.jboss.set.aphrodite.domain.Comment comment)Adds a new comment to the specified issue.org.jboss.set.aphrodite.domain.IssuecreateIssue(IssueCreationDetails details)Create skeletal issue.default voiddestroy()allows to destroy and deallocate resourcesorg.jboss.set.aphrodite.domain.IssuegetIssue(URL url)Retrieve an issue object associated with the givenURL.List<org.jboss.set.aphrodite.domain.Issue>getIssues(Collection<URL> urls)Retrieve all issues associated with the provided URLs.List<org.jboss.set.aphrodite.domain.Issue>getIssuesAssociatedWith(org.jboss.set.aphrodite.domain.PullRequest pullRequest)Retrieve all Issues associated with the provided pullRequest object.StringgetTrackerID()Return string format of tracker id, this value, can be used as key/index and compared toAbstractIssueTracker#convertToTrackerID().booleaninit(AphroditeConfig config)Initiate thisIssueTrackerServiceusing the suppliedAphroditeConfig.booleaninit(IssueTrackerConfig config)Initiate thisIssueTrackerServiceusing the suppliedIssueTrackerConfig.booleanisCPReleased(String cpVersion)Check if a given CP version is released.List<org.jboss.set.aphrodite.domain.Issue>searchIssues(org.jboss.set.aphrodite.domain.SearchCriteria searchCriteria)Return all issues which match the passedSearchCriteria.List<org.jboss.set.aphrodite.domain.Issue>searchIssuesByFilter(URL filterUrl)Return all issues which match the provided filter.booleanupdateIssue(org.jboss.set.aphrodite.domain.Issue issue)Update anIssueat the remote issue tracker service.booleanurlExists(URL url)Checks whether the providedURLis on the same host as this service.
-
-
-
Method Detail
-
init
boolean init(AphroditeConfig config)
Initiate thisIssueTrackerServiceusing the suppliedAphroditeConfig. The firstIssueTrackerConfigobject found in theAphroditeConfigobject, is used to initiate the service and is subsequently removed from the config to prevent the same service being initiated twice.- Parameters:
config- aAphroditeConfigobject containing at least oneIssueTrackerConfigobject.- Returns:
trueif the service was initialised without errors,falseotherwise.- Throws:
IllegalArgumentException- if noIssueTrackerConfigobjects are present.
-
init
boolean init(IssueTrackerConfig config)
Initiate thisIssueTrackerServiceusing the suppliedIssueTrackerConfig.- Parameters:
config- aIssueTrackerConfigobject containing all configuration information.- Returns:
trueif the service was initialised without errors,falseotherwise.
-
urlExists
boolean urlExists(URL url)
Checks whether the providedURLis on the same host as this service.- Parameters:
url- theURLto check.- Returns:
- true if the provided
URLhas the same host as this service, otherwise false. - Throws:
NullPointerException- if the providedURLis null.
-
getTrackerID
String getTrackerID()
Return string format of tracker id, this value, can be used as key/index and compared toAbstractIssueTracker#convertToTrackerID().- Returns:
-
getIssuesAssociatedWith
List<org.jboss.set.aphrodite.domain.Issue> getIssuesAssociatedWith(org.jboss.set.aphrodite.domain.PullRequest pullRequest)
Retrieve all Issues associated with the provided pullRequest object. Implementations of this method assume that the urls of the related issues are present in the pullRequest's description field.- Parameters:
pullRequest- thePullRequestobject whoms associated Issues should be returned.- Returns:
- a list of all
Issueobjects, or an empty list if no issues can be found.
-
getIssue
org.jboss.set.aphrodite.domain.Issue getIssue(URL url) throws NotFoundException
Retrieve an issue object associated with the givenURL.- Parameters:
url- theURLof the issue to be retrieved.- Returns:
- the
Issueassociated with the providedURK. - Throws:
NotFoundException- if the providedURLis not associated with an issue.
-
getIssues
List<org.jboss.set.aphrodite.domain.Issue> getIssues(Collection<URL> urls)
Retrieve all issues associated with the provided URLs. This method simply logs any issue URLs that cannot be retrieved from thisIssueTrackerServer. If the provided URLs collection is empty, or no issues are found, then an empty List is returned.- Parameters:
urls- a collection of issue URLs.- Returns:
- a list of
Issueobjects associated with the provided urls.
-
searchIssues
List<org.jboss.set.aphrodite.domain.Issue> searchIssues(org.jboss.set.aphrodite.domain.SearchCriteria searchCriteria)
Return all issues which match the passedSearchCriteria.- Parameters:
searchCriteria- all set fields will be search for.- Returns:
- a list of all
Issueobjects which match the specified searchCriteria, or an empty list if no issues match the searched criteria or the searchCriteria object contains no entries.
-
searchIssuesByFilter
List<org.jboss.set.aphrodite.domain.Issue> searchIssuesByFilter(URL filterUrl) throws NotFoundException
Return all issues which match the provided filter.- Parameters:
filterUrl- the url of the issue tracker filtered to be applied.- Returns:
- a list of all
Issueobjects which are returned by the provided filter. - Throws:
NotFoundException- if the filterURL is not associated with any filters.
-
updateIssue
boolean updateIssue(org.jboss.set.aphrodite.domain.Issue issue) throws NotFoundException, AphroditeExceptionUpdate anIssueat the remote issue tracker service. Note, this does not update issue comments or an issues description. To add a new comment, useaddCommentToIssue(Issue, Comment)- Parameters:
issue- the issue to be updated at theIssueTrackerService- Returns:
- true if the issue was successfully updated, false otherwise.
- Throws:
NotFoundException- if the providedIssuecannot be found at the IssueTracker.AphroditeException- if the user credentials supplied for this issue track do not have permission to update this issue, or a field within this issue.
-
addCommentToIssue
void addCommentToIssue(org.jboss.set.aphrodite.domain.Issue issue, org.jboss.set.aphrodite.domain.Comment comment) throws NotFoundExceptionAdds a new comment to the specified issue.- Parameters:
issue- the issue to add a new comment to.comment- the comment to be added to the issue.- Throws:
NotFoundException- if the providedIssuecannot be found at the IssueTracker.
-
addCommentToIssue
boolean addCommentToIssue(Map<org.jboss.set.aphrodite.domain.Issue,org.jboss.set.aphrodite.domain.Comment> commentMap)
Adds theCommentto the associatedIssueobject for all Issue/Comment pairs in theMap. Null comments are ignored.- Parameters:
commentMap- the map containing all Issues that are to be updated and the associated comments.- Returns:
- true if all comments are successfully added to their associated Issue, otherwise false.
-
addCommentToIssue
boolean addCommentToIssue(Collection<org.jboss.set.aphrodite.domain.Issue> issues, org.jboss.set.aphrodite.domain.Comment comment)
Adds theCommentto all of the providedIssueobjects.- Parameters:
issues- a collection of all issues that the comment should be added to.comment- the comment to be added to all issues.- Returns:
- true if the comment is successfully added to all issues.
-
isCPReleased
boolean isCPReleased(String cpVersion)
Check if a given CP version is released.- Parameters:
cpVersion- the CP version to be tested. Jira accepts GA version format x.y.z.GA, e.g. 7.1.2.GA. Bugzilla accepts version format x.y.z, e.g. 6.4.18.- Returns:
- true if the given version is released, otherwise false.
-
destroy
default void destroy()
allows to destroy and deallocate resources
-
createIssue
org.jboss.set.aphrodite.domain.Issue createIssue(IssueCreationDetails details) throws MalformedURLException, NotFoundException, AphroditeException
Create skeletal issue.- Parameters:
details- - implementation of issue detail proper for identified tracker- Returns:
- issue that was created
- Throws:
NotFoundExceptionMalformedURLExceptionAphroditeException
-
-