Class ProblemMutingServiceImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.mute.ProblemMutingServiceImpl
-
- All Implemented Interfaces:
ProblemMutingService
public class ProblemMutingServiceImpl extends Object implements ProblemMutingService
- Author:
- Leonid Bushuev from JetBrains
-
-
Constructor Summary
Constructors Constructor Description ProblemMutingServiceImpl(EventDispatcher<BuildServerListener> eventDispatcher, ExecutorServices executorServices, MultiNodesEvents multiNodesEvents)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyMuteInfo(MuteInfo muteInfo, SProject newProject)
Creates a copy of mute info in another project.CurrentMuteInfo
getBuildProblemCurrentMuteInfo(String projectId, Integer problemId)
Retrieves current actual mute info (from database) for the specified build problem.Map<Integer,CurrentMuteInfo>
getBuildProblemEffectiveMuteInfo(String projectId)
Retrieves all current actual mute info (from database) from specified project Includes mute info in the specified project, it's build types and all it's parent projects.Map<BuildProblemInfo,CurrentMuteInfo>
getBuildProblemEffectiveMuteInfo(String projectId, Collection<? extends BuildProblemInfo> problemInfos)
Retrieves current actual mute info (from database) for the specified build problems.Map<Integer,CurrentMuteInfo>
getBuildProblemsCurrentMuteInfo(SProject project)
Retrieves current actual mute info (from database) for all muted build problems.Map<Integer,MuteInfo>
getMuteInfoProblemForBuild(SBuild build)
Map<Long,MuteInfo>
getMuteInfoTestForBuild(SBuild build)
Retrieves mute info for all test runs in the specified build.Map<Long,Map<Long,MuteInfo>>
getMuteInfoTestForBuilds(Collection<Long> buildIds)
Retrieves mute info for all test runs for the builds with specified ids.Map<Long,MuteInfo>
getMutesOfOneTestInBuilds(STest test, Collection<Long> relatedBuildIds)
Retrives mute info for all test runs of the specified test in given builds.CurrentMuteInfo
getTestCurrentMuteInfo(String projectId, Long testNameId)
Retrieves current actual mute info (from database) for the specified test.Map<Long,CurrentMuteInfo>
getTestsCurrentMuteInfo(SProject project)
Retrieves mute info for all currently muted tests in the specified project and its parents and children transitively.void
invalidateProjectMutesCache(SProject project)
Invalidates project related data in the internal cache.void
muteProblemsInBuild(SUser user, String note, SBuild build, Collection<BuildProblemInfo> problems)
MuteInfo
muteProblemsInBuildTypes(SUser user, String note, boolean unmuteWhenFixed, Date unmuteByTime, Collection<SBuildType> buildTypes, Collection<? extends BuildProblemInfo> problems)
Mutes specified build problems in the specified build configuration scope.MuteInfo
muteProblemsInProject(SUser user, String note, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, Collection<? extends BuildProblemInfo> problems)
Mutes specified build problems in the specified project scope.MuteInfo
muteProblemsInProject(SUser user, String note, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, UnmutePreference removeExistingPreference, Collection<? extends BuildProblemInfo> problems)
Mutes specified build problems in the specified project scope.void
muteTestsInBuild(SUser user, String note, SBuild build, Collection<STest> tests)
MuteInfo
muteTestsInBuildTypes(SUser user, String note, boolean unmuteWhenFixed, Date unmuteByTime, Collection<SBuildType> buildTypes, Collection<STest> tests)
Mutes the specified tests in the build configuration scope.MuteInfo
muteTestsInProject(SUser user, String note, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, Collection<STest> tests)
Mutes specified tests in the project scope.MuteInfo
muteTestsInProject(SUser user, String note, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, UnmutePreference removeExistingPreference, Collection<STest> tests)
Mutes specified tests in the project scope.static Set<SProject>
selectDistinctProjectsFromTests(Collection<STest> tests)
void
setAuditLogFactory(AuditLogFactory auditLogFactory)
void
setProblemMutingService(LowLevelProblemMutingService problemMutingService)
void
setProjectManager(ProjectManager projectManager)
void
setTestManager(STestManager testManager)
void
unmuteProblems(SUser user, String note, SBuild build, Collection<BuildProblemInfo> problems)
Unmutes the specified build problems in the specified buildvoid
unmuteProblems(SUser user, String note, SBuildType buildType, Collection<BuildProblemInfo> problems)
Unmutes the specified build problems in one build type scope.void
unmuteProblems(SUser user, String note, SProject project, Collection<BuildProblemInfo> problems)
Unmutes the specified build problems in a scope where it was muted in the specified project and it's subprojects.void
unmuteProblems(SUser user, String note, SProject project, UnmutePreference unmutePreference, Collection<BuildProblemInfo> problems)
Unmutes the specified build problems in a scope where it was muted according to a given preference.void
unmuteTests(SUser user, String note, SBuildType buildType, Collection<STest> tests)
Unmutes the specified tests in one build type scope.void
unmuteTests(SUser user, String note, SProject project, Collection<STest> tests)
Unmutes the specified tests in a scope where it was muted, including child projects but excluding parent onesvoid
unmuteTests(SUser user, String note, SProject project, UnmutePreference unmutePreference, Collection<STest> tests)
Unmutes the specified tests in a scope where it was muted
-
-
-
Constructor Detail
-
ProblemMutingServiceImpl
public ProblemMutingServiceImpl(@NotNull EventDispatcher<BuildServerListener> eventDispatcher, @NotNull ExecutorServices executorServices, @NotNull MultiNodesEvents multiNodesEvents)
-
-
Method Detail
-
setProblemMutingService
public void setProblemMutingService(@NotNull LowLevelProblemMutingService problemMutingService)
-
setProjectManager
public void setProjectManager(@NotNull ProjectManager projectManager)
-
setTestManager
public void setTestManager(@NotNull STestManager testManager)
-
setAuditLogFactory
public void setAuditLogFactory(@NotNull AuditLogFactory auditLogFactory)
-
muteTestsInProject
@NotNull public MuteInfo muteTestsInProject(@NotNull SUser user, @Nullable String note, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull Collection<STest> tests)
Description copied from interface:ProblemMutingService
Mutes specified tests in the project scope. Automatically unmutes specified tests in all specified project's subprojects and their build types recursively.- Specified by:
muteTestsInProject
in interfaceProblemMutingService
- Parameters:
user
- user who muting the tests.note
- a user's note.unmuteWhenFixed
- true for unmuting on test passunmuteByTime
- when to unmute if unmuting at specified timeproject
- project to mute intests
- tests to mute- Returns:
- the mute info created
-
muteTestsInProject
@NotNull public MuteInfo muteTestsInProject(@NotNull SUser user, @Nullable String note, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull UnmutePreference removeExistingPreference, @NotNull Collection<STest> tests)
Description copied from interface:ProblemMutingService
Mutes specified tests in the project scope.- Specified by:
muteTestsInProject
in interfaceProblemMutingService
- Parameters:
user
- user who muting the tests.note
- a user's note.unmuteWhenFixed
- true for unmuting on test passunmuteByTime
- when to unmute if unmuting at specified timeproject
- project to mute inremoveExistingPreference
- specifies scope where existing mutes should be removedtests
- tests to mute- Returns:
- the mute info created
-
copyMuteInfo
public void copyMuteInfo(@NotNull MuteInfo muteInfo, @NotNull SProject newProject)
Description copied from interface:ProblemMutingService
Creates a copy of mute info in another project.- Specified by:
copyMuteInfo
in interfaceProblemMutingService
- Parameters:
muteInfo
- mute info to copynewProject
- project where a copy of mute info should be created
-
muteProblemsInProject
@NotNull public MuteInfo muteProblemsInProject(@NotNull SUser user, @Nullable String note, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull Collection<? extends BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Mutes specified build problems in the specified project scope. Automatically unmutes specified build problems in all specified project's subprojects and their build types recursively.- Specified by:
muteProblemsInProject
in interfaceProblemMutingService
- Parameters:
user
- user who is muting.note
- user's note.unmuteWhenFixed
- unmute problem automatically when it is fixed everywhere.unmuteByTime
- unmute problem automatically on a certain date.problems
- build problems to mute
-
muteProblemsInProject
public MuteInfo muteProblemsInProject(@NotNull SUser user, @Nullable String note, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull UnmutePreference removeExistingPreference, @NotNull Collection<? extends BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Mutes specified build problems in the specified project scope.- Specified by:
muteProblemsInProject
in interfaceProblemMutingService
- Parameters:
user
- user who is muting.note
- user's note.unmuteWhenFixed
- unmute problem automatically when it is fixed everywhere.unmuteByTime
- unmute problem automatically on a certain date.removeExistingPreference
- specifies scope where existing mutes should be removedproblems
- build problems to mute
-
muteTestsInBuildTypes
@NotNull public MuteInfo muteTestsInBuildTypes(@NotNull SUser user, @Nullable String note, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull Collection<SBuildType> buildTypes, @NotNull Collection<STest> tests)
Description copied from interface:ProblemMutingService
Mutes the specified tests in the build configuration scope.- Specified by:
muteTestsInBuildTypes
in interfaceProblemMutingService
- Parameters:
user
- user who muting the tests.note
- a user's note.buildTypes
- build types where to mute tests.tests
- tests to mute.
-
muteProblemsInBuildTypes
@NotNull public MuteInfo muteProblemsInBuildTypes(@NotNull SUser user, @Nullable String note, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull Collection<SBuildType> buildTypes, @NotNull Collection<? extends BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Mutes specified build problems in the specified build configuration scope.- Specified by:
muteProblemsInBuildTypes
in interfaceProblemMutingService
- Parameters:
user
- user who is muting.note
- user's note.unmuteWhenFixed
- unmute problem automatically when it is fixed everywhere.unmuteByTime
- unmute problem automatically on a certain date.buildTypes
- build types where to mute.problems
- build problems to mute.
-
muteTestsInBuild
public void muteTestsInBuild(@NotNull SUser user, @Nullable String note, @NotNull SBuild build, @NotNull Collection<STest> tests)
- Specified by:
muteTestsInBuild
in interfaceProblemMutingService
-
muteProblemsInBuild
public void muteProblemsInBuild(@Nullable SUser user, @Nullable String note, @NotNull SBuild build, @NotNull Collection<BuildProblemInfo> problems)
- Specified by:
muteProblemsInBuild
in interfaceProblemMutingService
-
unmuteTests
public void unmuteTests(@Nullable SUser user, @Nullable String note, @NotNull SProject project, @NotNull Collection<STest> tests)
Description copied from interface:ProblemMutingService
Unmutes the specified tests in a scope where it was muted, including child projects but excluding parent ones- Specified by:
unmuteTests
in interfaceProblemMutingService
- Parameters:
user
- user that is unmuting tests.note
- a user's note.tests
- tests to unmute.
-
unmuteTests
public void unmuteTests(@Nullable SUser user, @Nullable String note, @NotNull SProject project, @NotNull UnmutePreference unmutePreference, @NotNull Collection<STest> tests)
Description copied from interface:ProblemMutingService
Unmutes the specified tests in a scope where it was muted- Specified by:
unmuteTests
in interfaceProblemMutingService
- Parameters:
user
- user that is unmuting tests.note
- a user's note.unmutePreference
- in which projects specified tests need to be unmuted.tests
- tests to unmute.
-
unmuteTests
public void unmuteTests(@Nullable SUser user, @Nullable String note, @NotNull SBuildType buildType, @NotNull Collection<STest> tests)
Description copied from interface:ProblemMutingService
Unmutes the specified tests in one build type scope.- Specified by:
unmuteTests
in interfaceProblemMutingService
- Parameters:
user
- user who performs an actionnote
- additional commentsbuildType
- build type scopetests
- tests to unmute
-
unmuteProblems
public void unmuteProblems(@Nullable SUser user, @Nullable String note, @NotNull SBuildType buildType, @NotNull Collection<BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Unmutes the specified build problems in one build type scope.- Specified by:
unmuteProblems
in interfaceProblemMutingService
- Parameters:
user
- user who performs an actionnote
- additional commentsbuildType
- build type scopeproblems
- problems to unmute
-
unmuteProblems
public void unmuteProblems(@Nullable SUser user, @Nullable String note, @NotNull SProject project, @NotNull Collection<BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Unmutes the specified build problems in a scope where it was muted in the specified project and it's subprojects.- Specified by:
unmuteProblems
in interfaceProblemMutingService
- Parameters:
user
- user who is unmuting.note
- a user's note.problems
- problems to unmute.
-
unmuteProblems
public void unmuteProblems(@Nullable SUser user, @Nullable String note, @NotNull SProject project, @NotNull UnmutePreference unmutePreference, @NotNull Collection<BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Unmutes the specified build problems in a scope where it was muted according to a given preference.- Specified by:
unmuteProblems
in interfaceProblemMutingService
- Parameters:
user
- user who is unmuting.note
- a user's note.unmutePreference
- in which projects specified problems should be unmuted.problems
- problems to unmute.
-
unmuteProblems
public void unmuteProblems(@Nullable SUser user, @Nullable String note, @NotNull SBuild build, @NotNull Collection<BuildProblemInfo> problems)
Description copied from interface:ProblemMutingService
Unmutes the specified build problems in the specified build- Specified by:
unmuteProblems
in interfaceProblemMutingService
- Parameters:
user
- user who is unmuting.note
- a user's note.build
- build where to muteproblems
- problems to unmute.
-
getMuteInfoTestForBuild
@NotNull public Map<Long,MuteInfo> getMuteInfoTestForBuild(@NotNull SBuild build)
Description copied from interface:ProblemMutingService
Retrieves mute info for all test runs in the specified build.Warning! - this method is not just a getter, it is really a retriever that does a lot of works.
- Specified by:
getMuteInfoTestForBuild
in interfaceProblemMutingService
- Parameters:
build
- the build- Returns:
- mute info map: test id -> mute info (means "for all test runs of a given test...")
-
getMuteInfoTestForBuilds
@NotNull public Map<Long,Map<Long,MuteInfo>> getMuteInfoTestForBuilds(@NotNull Collection<Long> buildIds)
Description copied from interface:ProblemMutingService
Retrieves mute info for all test runs for the builds with specified ids.Warning! - this method is not just a getter, it is really a retriever that does a lot of works.
- Specified by:
getMuteInfoTestForBuilds
in interfaceProblemMutingService
- Returns:
- mute info map: build id -> map(test id -> mute info)
-
getMuteInfoProblemForBuild
@NotNull public Map<Integer,MuteInfo> getMuteInfoProblemForBuild(@NotNull SBuild build)
- Specified by:
getMuteInfoProblemForBuild
in interfaceProblemMutingService
-
getTestsCurrentMuteInfo
@NotNull public Map<Long,CurrentMuteInfo> getTestsCurrentMuteInfo(@NotNull SProject project)
Description copied from interface:ProblemMutingService
Retrieves mute info for all currently muted tests in the specified project and its parents and children transitively.Returns a modifiable map of current mute info for all muted tests in a project
Warning! - this method is not just a getter, it is really a retriever that does a lot of works.
- Specified by:
getTestsCurrentMuteInfo
in interfaceProblemMutingService
- Parameters:
project
- the project- Returns:
- current mute info map: test id -> current mute info
-
getMutesOfOneTestInBuilds
@NotNull public Map<Long,MuteInfo> getMutesOfOneTestInBuilds(STest test, Collection<Long> relatedBuildIds)
Description copied from interface:ProblemMutingService
Retrives mute info for all test runs of the specified test in given builds.- Specified by:
getMutesOfOneTestInBuilds
in interfaceProblemMutingService
- Parameters:
test
- the test to retrieve mute info for.relatedBuildIds
- buildIds- Returns:
- a map of buildId -> muteInfo.
-
getTestCurrentMuteInfo
@Nullable public CurrentMuteInfo getTestCurrentMuteInfo(@NotNull String projectId, Long testNameId)
Description copied from interface:ProblemMutingService
Retrieves current actual mute info (from database) for the specified test.- Specified by:
getTestCurrentMuteInfo
in interfaceProblemMutingService
- Parameters:
projectId
- project internal id- Returns:
- retrieved mute info, or null if no such project or test is not muted in the project and its build configurations.
-
getBuildProblemCurrentMuteInfo
@Nullable public CurrentMuteInfo getBuildProblemCurrentMuteInfo(@NotNull String projectId, @NotNull Integer problemId)
Description copied from interface:ProblemMutingService
Retrieves current actual mute info (from database) for the specified build problem. Includes mute info in the specified project, all it's parent projects recursively and subprojects and their build types recursively.- Specified by:
getBuildProblemCurrentMuteInfo
in interfaceProblemMutingService
- Parameters:
projectId
- project internal id- Returns:
- retrieved mute info, or null if no such project or problem is not muted in the project and its build configurations.
-
getBuildProblemEffectiveMuteInfo
@NotNull public Map<BuildProblemInfo,CurrentMuteInfo> getBuildProblemEffectiveMuteInfo(@NotNull String projectId, @NotNull Collection<? extends BuildProblemInfo> problemInfos)
Description copied from interface:ProblemMutingService
Retrieves current actual mute info (from database) for the specified build problems. Includes mute info in the specified project, it's build types and all it's parent projects.- Specified by:
getBuildProblemEffectiveMuteInfo
in interfaceProblemMutingService
- Parameters:
projectId
- project internal idproblemInfos
- collection of build problem info- Returns:
- retrieved mute info, or null if no such project or problem is not muted in the project and its build configurations.
-
getBuildProblemEffectiveMuteInfo
@NotNull public Map<Integer,CurrentMuteInfo> getBuildProblemEffectiveMuteInfo(@NotNull String projectId)
Description copied from interface:ProblemMutingService
Retrieves all current actual mute info (from database) from specified project Includes mute info in the specified project, it's build types and all it's parent projects.- Specified by:
getBuildProblemEffectiveMuteInfo
in interfaceProblemMutingService
- Parameters:
projectId
- project internal id- Returns:
- retrieved found mute info in format: Map(buildProblemId -> corresponding CurrentMuteInfo)
-
getBuildProblemsCurrentMuteInfo
@NotNull public Map<Integer,CurrentMuteInfo> getBuildProblemsCurrentMuteInfo(@NotNull SProject project)
Description copied from interface:ProblemMutingService
Retrieves current actual mute info (from database) for all muted build problems. Includes mute info in the specified project, all it's parent projects recursively and subprojects and their build types recursively.- Specified by:
getBuildProblemsCurrentMuteInfo
in interfaceProblemMutingService
- Parameters:
project
- project- Returns:
- see above
-
selectDistinctProjectsFromTests
@NotNull public static Set<SProject> selectDistinctProjectsFromTests(@NotNull Collection<STest> tests)
-
invalidateProjectMutesCache
public void invalidateProjectMutesCache(@NotNull SProject project)
Description copied from interface:ProblemMutingService
Invalidates project related data in the internal cache.- Specified by:
invalidateProjectMutesCache
in interfaceProblemMutingService
-
-