Interface ITEngine


  • public interface ITEngine
    This engine is supposed to extract issues from an issue tracker, such as Github, Gitlab, and so on.
    • Method Detail

      • getRepository

        java.lang.String getRepository()
        Returns the processed repository.
        Returns:
        The processed repository.
      • getIssueById

        java.util.Optional<Issue> getIssueById​(java.lang.String id)
                                        throws java.io.IOException
        Returns the issue with the given id (see Issue.getId()). Returns an empty Optional if there is no such issue. This method does not fail if id is null.
        Parameters:
        id - The id of the issue to fetch.
        Returns:
        The issue with the given id.
        Throws:
        java.io.IOException - If an error occurred while retrieving the issue.
      • getModelFactory

        ItModelFactory getModelFactory()
        Returns the factory used to create issue tracker model instances.
        Returns:
        The factory used to create issue tracker model instances.
      • setModelFactory

        void setModelFactory​(ItModelFactory factory)
        Sets the factory used to create issue tracker model instances.
        Parameters:
        factory - The factory used to create issue tracker model instances.
        Throws:
        java.lang.NullPointerException - If factory is null.
      • getIssuesFor

        default java.util.List<Issue> getIssuesFor​(Commit commit)
                                            throws java.io.IOException
        Returns all issues referenced by the given commit. This method does not fail if commit is null and does not return the same issue (according to Issue.getId()) twice. The default implementation delegates commit to getIssuesFor(List).
        Parameters:
        commit - The commit to parse.
        Returns:
        The referenced issues.
        Throws:
        java.io.IOException - If an error occurred while retrieving an issue.
      • getIssuesFor

        default java.util.List<Issue> getIssuesFor​(java.util.List<Commit> commits)
                                            throws java.io.IOException
        Returns all issues referenced by the given list of commits. This method does not fail if commits is null or contains null values and does not return the same issue (according to Issue.getId()) twice. The default implementation parses the commit messages using parseIssueIds(String) and creates an Issue instance for each id found using getIssueById(String).
        Parameters:
        commits - The commits to parse.
        Returns:
        The referenced issues.
        Throws:
        java.io.IOException - If an error occurred while retrieving an issue.
      • getIssuesFor

        default java.util.List<Issue> getIssuesFor​(RevisionRange range)
                                            throws java.io.IOException
        Returns all issues referenced by the given revision range. This method does not fail if range is null and does not return the same issue (according to Issue.getId()) twice. The default implementations delegates the referenced commits (see RevisionRange.getCommits()) to getIssuesFor(List).
        Parameters:
        range - The revision range to parse.
        Returns:
        The referenced issues.
        Throws:
        java.io.IOException - If an error occurred while retrieving an issue.
      • parseIssueIds

        default java.util.List<java.lang.String> parseIssueIds​(java.lang.String text)
        Parses the given text and returns all referenced issue ids. This method does not fail if text is null. The default implementation searches for patterns like '#6'.
        Parameters:
        text - The text to parse.
        Returns:
        The referenced issue ids.