Class AbstractIssueTracker

  • All Implemented Interfaces:
    IssueTrackerService

    public abstract class AbstractIssueTracker
    extends Object
    implements IssueTrackerService
    An abstract IssueTracker which provides logic common to all issue trackers.
    Author:
    Ryan Emerson
    • Constructor Detail

      • AbstractIssueTracker

        public AbstractIssueTracker​(TrackerType TRACKER_TYPE)
    • Method Detail

      • getLog

        protected abstract org.apache.commons.logging.Log getLog()
      • init

        public boolean init​(AphroditeConfig aphroditeConfig)
        Description copied from interface: IssueTrackerService
        Initiate this IssueTrackerService using the supplied AphroditeConfig. The first IssueTrackerConfig object found in the AphroditeConfig object, is used to initiate the service and is subsequently removed from the config to prevent the same service being initiated twice.
        Specified by:
        init in interface IssueTrackerService
        Parameters:
        aphroditeConfig - a AphroditeConfig object containing at least one IssueTrackerConfig object.
        Returns:
        true if the service was initialised without errors, false otherwise.
      • init

        public boolean init​(IssueTrackerConfig config)
        Description copied from interface: IssueTrackerService
        Initiate this IssueTrackerService using the supplied IssueTrackerConfig.
        Specified by:
        init in interface IssueTrackerService
        Parameters:
        config - a IssueTrackerConfig object containing all configuration information.
        Returns:
        true if the service was initialised without errors, false otherwise.
      • getIssuesAssociatedWith

        public List<org.jboss.set.aphrodite.domain.Issue> getIssuesAssociatedWith​(org.jboss.set.aphrodite.domain.PullRequest pullRequest)
        Description copied from interface: IssueTrackerService
        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.
        Specified by:
        getIssuesAssociatedWith in interface IssueTrackerService
        Parameters:
        pullRequest - the PullRequest object whoms associated Issues should be returned.
        Returns:
        a list of all Issue objects, or an empty list if no issues can be found.
      • addCommentToIssue

        public void addCommentToIssue​(org.jboss.set.aphrodite.domain.Issue issue,
                                      org.jboss.set.aphrodite.domain.Comment comment)
                               throws NotFoundException
        Description copied from interface: IssueTrackerService
        Adds a new comment to the specified issue.
        Specified by:
        addCommentToIssue in interface IssueTrackerService
        Parameters:
        issue - the issue to add a new comment to.
        comment - the comment to be added to the issue.
        Throws:
        NotFoundException - if the provided Issue cannot be found at the IssueTracker.
      • urlExists

        public boolean urlExists​(URL url)
        Description copied from interface: IssueTrackerService
        Checks whether the provided URL is on the same host as this service.
        Specified by:
        urlExists in interface IssueTrackerService
        Parameters:
        url - the URL to check.
        Returns:
        true if the provided URL has the same host as this service, otherwise false.
      • getTrackerID

        public String getTrackerID()
        Description copied from interface: IssueTrackerService
        Return string format of tracker id, this value, can be used as key/index and compared to AbstractIssueTracker#convertToTrackerID().
        Specified by:
        getTrackerID in interface IssueTrackerService
        Returns:
      • convertToTrackerID

        public static String convertToTrackerID​(URL url)
      • filterIssuesByHost

        protected Map<org.jboss.set.aphrodite.domain.Issue,​org.jboss.set.aphrodite.domain.Comment> filterIssuesByHost​(Map<org.jboss.set.aphrodite.domain.Issue,​org.jboss.set.aphrodite.domain.Comment> commentMap)
      • filterIssuesByHost

        protected Collection<org.jboss.set.aphrodite.domain.Issue> filterIssuesByHost​(Collection<org.jboss.set.aphrodite.domain.Issue> issues)