Class IssuesManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.issueTracker.impl.IssuesManagerImpl
-
- All Implemented Interfaces:
IssuesManager
public class IssuesManagerImpl extends Object implements IssuesManager
Few words about terminology used here and in tests (internally): the last modification mentioning the given issue I is called a fixer of I.Note that the fixer is valuable for us only if the issue is actually fixed (i.e. has a fixed state in ITS). But even if the issue isn't fixed at some point, we still hold its fixer, so we could optimize the search of a real fixer in the future.
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Constructor Summary
Constructors Constructor Description IssuesManagerImpl(VcsModificationHistory modificationHistory, IssueProvidersManager issueProvidersManager, ProjectManager projectManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fetchIssuesIntoMemory(Collection<IssueEx> issues)
Requests specifiedissues
from corresponding issue trackers to get all of them into cache.IssueEx
findIssueById(IssueProvider provider, String id)
Returns the issue corresponding to specifiedid
.IssueEx
findPossiblyExpiredIssue(SIssueProvider provider, String id, VcsModification modification)
Returns the issue data corresponding to theid
.List<IssueEx>
getRelatedIssues(BuildPromotionEx promotion)
Resolves related issues for build promotion Process of resolving is base on the fact, that promotion has its related, existing corresponding project All issue definitions are resolved relative to this project and its ancestorsList<IssueEx>
getRelatedIssues(SVcsModification modification)
Resolves related issues for single vcs modification.boolean
hasRelatedIssues(BuildPromotionEx promotion)
Returns true if the given promotion has related issues, false otherwiseboolean
isIssueFixedByRelatedModification(IssueEx issue)
Method return true, iff:issue.isFixed() == true
,issue.getRelatedModification() != null
, getRelatedModification() is the last modification, in which this issue is mentioned.
-
-
-
Constructor Detail
-
IssuesManagerImpl
public IssuesManagerImpl(@NotNull VcsModificationHistory modificationHistory, @NotNull IssueProvidersManager issueProvidersManager, @NotNull ProjectManager projectManager)
-
-
Method Detail
-
getRelatedIssues
@NotNull public List<IssueEx> getRelatedIssues(@NotNull BuildPromotionEx promotion)
Resolves related issues for build promotion Process of resolving is base on the fact, that promotion has its related, existing corresponding project All issue definitions are resolved relative to this project and its ancestors- Specified by:
getRelatedIssues
in interfaceIssuesManager
- Parameters:
promotion
- build promotion- Returns:
- list of issues, related to build promotion, empty list if project is deleted
-
hasRelatedIssues
public boolean hasRelatedIssues(@NotNull BuildPromotionEx promotion)
Description copied from interface:IssuesManager
Returns true if the given promotion has related issues, false otherwise- Specified by:
hasRelatedIssues
in interfaceIssuesManager
- Parameters:
promotion
- promotion of interest- Returns:
- see above
-
getRelatedIssues
@NotNull public List<IssueEx> getRelatedIssues(@NotNull SVcsModification modification)
Resolves related issues for single vcs modification. Tries to resolve issue mentions against all related projects and all providers in each project respecting hierarchy- Specified by:
getRelatedIssues
in interfaceIssuesManager
- Parameters:
modification
- vcs modification- Returns:
- list of issues related to given modification
-
findIssueById
@NotNull public IssueEx findIssueById(@NotNull IssueProvider provider, @NotNull String id) throws RetrieveIssueException
Description copied from interface:IssuesManager
Returns the issue corresponding to specifiedid
. The relation is defined by aprovider
.- Specified by:
findIssueById
in interfaceIssuesManager
- Parameters:
provider
- issue providerid
- issue id- Returns:
- a corresponding issue
- Throws:
RetrieveIssueException
- if the issue cannot be found for some reason
-
findPossiblyExpiredIssue
public IssueEx findPossiblyExpiredIssue(@NotNull SIssueProvider provider, @NotNull String id, @Nullable VcsModification modification)
Description copied from interface:IssuesManager
Returns the issue data corresponding to theid
.See
SIssueProvider.findPossiblyExpiredIssue(String)
method for more details.- Specified by:
findPossiblyExpiredIssue
in interfaceIssuesManager
- Parameters:
provider
- issue providerid
- issue idmodification
- related modification for the issue- Returns:
- a corresponding issue
-
isIssueFixedByRelatedModification
public boolean isIssueFixedByRelatedModification(@NotNull IssueEx issue)
Description copied from interface:IssuesManager
Method return true, iff:-
issue.isFixed() == true
, -
issue.getRelatedModification() != null
, - getRelatedModification() is the last modification, in which this issue is mentioned.
- Specified by:
isIssueFixedByRelatedModification
in interfaceIssuesManager
- Parameters:
issue
- the issue to check- Returns:
- whether specified issue is fixed by its related modification
- See Also:
Issue.isResolved()
,IssueEx.getRelatedModification()
-
-
fetchIssuesIntoMemory
public void fetchIssuesIntoMemory(@NotNull Collection<IssueEx> issues)
Description copied from interface:IssuesManager
Requests specifiedissues
from corresponding issue trackers to get all of them into cache.Note: all fetching is done in the current thread.
- Specified by:
fetchIssuesIntoMemory
in interfaceIssuesManager
- Parameters:
issues
- the issues to fetch
-
-