Interface ITEngine
-
public interface ITEngine
This engine is supposed to extract issues from an issue tracker, such as Github, Gitlab, and so on.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<Issue>
getIssueById(java.lang.String id)
Returns the issue with the given id (seeIssue.getId()
).default java.util.List<Issue>
getIssuesFor(Commit commit)
Returns all issues referenced by the given commit.default java.util.List<Issue>
getIssuesFor(RevisionRange range)
Returns all issues referenced by the given revision range.default java.util.List<Issue>
getIssuesFor(java.util.List<Commit> commits)
Returns all issues referenced by the given list of commits.ItModelFactory
getModelFactory()
Returns the factory used to create issue tracker model instances.java.lang.String
getRepository()
Returns the processed repository.default java.util.List<java.lang.String>
parseIssueIds(java.lang.String text)
Parses the given text and returns all referenced issue ids.void
setModelFactory(ItModelFactory factory)
Sets the factory used to create issue tracker model instances.
-
-
-
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 (seeIssue.getId()
). Returns an emptyOptional
if there is no such issue. This method does not fail ifid
isnull
.- 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
- Iffactory
isnull
.
-
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 ifcommit
isnull
and does not return the same issue (according toIssue.getId()
) twice. The default implementation delegatescommit
togetIssuesFor(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 ifcommits
isnull
or containsnull
values and does not return the same issue (according toIssue.getId()
) twice. The default implementation parses the commit messages usingparseIssueIds(String)
and creates anIssue
instance for each id found usinggetIssueById(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 ifrange
isnull
and does not return the same issue (according toIssue.getId()
) twice. The default implementations delegates the referenced commits (seeRevisionRange.getCommits()
) togetIssuesFor(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 iftext
isnull
. The default implementation searches for patterns like '#6'.- Parameters:
text
- The text to parse.- Returns:
- The referenced issue ids.
-
-