Class LowLevelProblemMutingServiceImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.mute.LowLevelProblemMutingServiceImpl
-
- All Implemented Interfaces:
LowLevelProblemMutingService
public class LowLevelProblemMutingServiceImpl extends Object implements LowLevelProblemMutingService
- Author:
- Leonid Bushuev from JetBrains
-
-
Constructor Summary
Constructors Constructor Description LowLevelProblemMutingServiceImpl(DBFunctionsProvider db, NumericIdSequences idSequences, ServerExtensionHolder extensionsHolder, ProjectManager projectManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearMuteInfoCache()
Resets cache of mute informationMuteInfo
copyMuteInfo(MuteInfo muteInfo, SProject newProject)
Creates a copy of mute info in another project.STestManager
getTestManager()
UserModel
getUserModel()
BuildProblemMuter
makeBuildProblemMuter(BuildPromotionEx buildPromotion)
Makes a new build problem muting service.TestRunMuter
makeTestRunMuter(BuildPromotionEx buildPromotion)
Makes a new test run muting service.MuteInfo
muteProblemsInBT(long userId, String comment, boolean unmuteWhenFixed, Date unmuteByTime, String projectId, Set<String> buildTypes, Set<Integer> problems)
Mutes the specified build problems in the build configuration scope.MuteInfo
muteProblemsInBuild(long userId, String comment, String projectId, long buildId, Set<Integer> problems)
Mutes the build problems in a specified build only.void
muteProblemsInBuild(long buildId, Set<Integer> problems)
Mutes the build problems in a specified build only.MuteInfo
muteProblemsInProject(long userId, String comment, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, Set<Integer> problems)
Mutes specified build problems in the project scope.MuteInfo
muteProblemsInProject(long userId, String comment, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, UnmutePreference handleExistingMutesPreference, Set<Integer> problems)
Mutes specified build problems in the project scope.MuteInfo
muteTestsInBT(long userId, String comment, boolean unmuteWhenFixed, Date unmuteByTime, String projectId, Set<String> buildTypes, Set<Long> tests, boolean removePreviousMutes)
Mutes the specified tests in the build configuration scope.MuteInfo
muteTestsInBuild(long userId, String comment, String projectId, long buildId, Set<Long> tests)
Mutes the tests in a specified build only.MuteInfo
muteTestsInProject(long userId, String comment, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, Set<Long> tests)
Mutes specified tests in the project scope.MuteInfo
muteTestsInProject(long userId, String comment, boolean unmuteWhenFixed, Date unmuteByTime, SProject project, UnmutePreference handleExistingMutesPreference, Set<Long> tests)
Mutes specified tests in the project scope.Collection<Integer>
retrieveMuteProblems(Integer muteId)
void
retrieveMutesOfOneTestInBuilds(long testNameId, Collection<Long> relatedBuildIds, MutingInBuildInfoConsumer consumer)
Retrieves mutes of runs of one test in given builds.void
retrieveMutesWithTimeOut(MutingInfoConsumer consumer)
Retrieves current mutes that already not actual because of the auto-unmuting time.Collection<Long>
retrieveMuteTests(Integer muteId)
Map<Integer,MuteInfo>
retrieveProblemMutesForBuild(long buildId)
Map<Integer,MuteInfo>
retrieveProblemMutesForBuild(DBFunctions dbf, long buildId)
void
retrieveProblemsCurrentMuteInfos(Set<String> projectIds, Set<String> buildTypeIds, MutingInfoConsumer consumer)
Retrieves information about currently muted build problems for the specified projects and build configurations.Map<Long,MuteInfo>
retrieveTestMutesForBuild(long buildId)
Retrieves the information about tests muting in the specified build.Map<Long,Map<Long,MuteInfo>>
retrieveTestMutesForBuilds(Collection<Long> buildIds)
Retrieves the information about muted tests in the specified builds.void
retrieveTestsCurrentMuteInfos(Set<String> projectIds, Set<String> buildTypeIds, MutingInfoConsumer consumer)
Retrieves information about currently muted tests for the specified projects and build configurations.void
setEventDispatcher(EventDispatcher<BuildServerListener> eventDispatcher)
void
setTestManager(STestManager testManager)
void
setUserModel(UserModel userModel)
void
unmuteProblems(long buildId, Set<Integer> problems)
Mutes the build problems in a specified build only.void
unmuteProblems(Set<String> projectIds, Set<String> buildTypeIds, Collection<Integer> problems)
Unmutes the specified build problems in the specified project and specified build configurations.void
unmuteProblemsByMuteInfo(Collection<Integer> muteInfoIds)
Unmutes build problems associated with the given mute infos.void
unmuteTests(Set<String> projectIds, Set<String> buildTypeIds, Collection<Long> testNameIds)
Unmutes the specified tests in the specied project and specified build configurations.void
unmuteTestsByMuteInfo(Collection<Integer> muteInfoIds)
Unmutes tests associated with the given mute infos.
-
-
-
Constructor Detail
-
LowLevelProblemMutingServiceImpl
public LowLevelProblemMutingServiceImpl(@NotNull DBFunctionsProvider db, @NotNull NumericIdSequences idSequences, @NotNull ServerExtensionHolder extensionsHolder, @NotNull ProjectManager projectManager)
-
-
Method Detail
-
setUserModel
public void setUserModel(@NotNull UserModel userModel)
-
setEventDispatcher
public void setEventDispatcher(@NotNull EventDispatcher<BuildServerListener> eventDispatcher)
-
getUserModel
@NotNull public UserModel getUserModel()
-
setTestManager
public void setTestManager(@NotNull STestManager testManager)
-
getTestManager
@NotNull public STestManager getTestManager()
-
muteTestsInProject
@NotNull public MuteInfo muteTestsInProject(long userId, @Nullable String comment, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull Set<Long> tests)
Description copied from interface:LowLevelProblemMutingService
Mutes specified tests in the project scope. Existing mutes on given tests in the descendent projects and build configurations are removed.- Specified by:
muteTestsInProject
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- user who muting the tests.comment
- a user's comment.unmuteWhenFixed
- unmute the test automatically when it is fixed everywhere.unmuteByTime
- unmute the test automatically on a certain date.tests
- ids of tests to mute. @return identifier of the just created mute-info.
-
muteTestsInProject
@NotNull public MuteInfo muteTestsInProject(long userId, @Nullable String comment, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull UnmutePreference handleExistingMutesPreference, @NotNull Set<Long> tests)
Description copied from interface:LowLevelProblemMutingService
Mutes specified tests in the project scope.- Specified by:
muteTestsInProject
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- user who muting the tests.comment
- a user's comment.unmuteWhenFixed
- unmute the test automatically when it is fixed everywhere.unmuteByTime
- unmute the test automatically on a certain date.tests
- ids of tests to mute. @return identifier of the just created mute-info.
-
copyMuteInfo
@NotNull public MuteInfo copyMuteInfo(@NotNull MuteInfo muteInfo, @NotNull SProject newProject)
Description copied from interface:LowLevelProblemMutingService
Creates a copy of mute info in another project. Does not process parent or sub projects anyhow.- Specified by:
copyMuteInfo
in interfaceLowLevelProblemMutingService
- Parameters:
muteInfo
- mute info to copynewProject
- project where a copy of mute info should be created- Returns:
- a copy of mute info
-
muteTestsInBT
@NotNull public MuteInfo muteTestsInBT(long userId, @Nullable String comment, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull String projectId, @NotNull Set<String> buildTypes, @NotNull Set<Long> tests, boolean removePreviousMutes)
Description copied from interface:LowLevelProblemMutingService
Mutes the specified tests in the build configuration scope.- Specified by:
muteTestsInBT
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- user who muting the tests.comment
- a user's comment.unmuteWhenFixed
- unmute the test automatically when it is fixed everywhere.unmuteByTime
- unmute the test automatically on a certain date.projectId
- project the specified build types are belong.buildTypes
- build types where tests to mute.tests
- tests to mute.removePreviousMutes
- if true then removes mutes data currently associated with specified project, build configurations and tests; otherwise does not try to find and remove this data (useful when we know for sure that project and build types are new, for instance, just copied)- Returns:
- identifier of the just created mute-info.
-
muteTestsInBuild
@NotNull public MuteInfo muteTestsInBuild(long userId, @Nullable String comment, @NotNull String projectId, long buildId, @NotNull Set<Long> tests)
Description copied from interface:LowLevelProblemMutingService
Mutes the tests in a specified build only. Note: does not process the build status, dependent builds, etc.- Specified by:
muteTestsInBuild
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- the user who is performing the actioncomment
- the commentprojectId
- the project idbuildId
- the build idtests
- the list of test ids- Returns:
- identifier of the just created mute-info.
-
muteProblemsInBuild
@NotNull public MuteInfo muteProblemsInBuild(long userId, @Nullable String comment, @NotNull String projectId, long buildId, @NotNull Set<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Mutes the build problems in a specified build only. Note: does not process the build status, dependent builds, etc.- Specified by:
muteProblemsInBuild
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- the user who is performing the actioncomment
- the commentprojectId
- the project idbuildId
- the build idproblems
- the list of buidld problems ids- Returns:
- identifier of the just created mute-info.
-
muteProblemsInBuild
public void muteProblemsInBuild(long buildId, @NotNull Set<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Mutes the build problems in a specified build only. Note: does not process the build status, dependent builds, etc.- Specified by:
muteProblemsInBuild
in interfaceLowLevelProblemMutingService
- Parameters:
buildId
- the build idproblems
- the list of buidld problems ids
-
unmuteProblems
public void unmuteProblems(long buildId, @NotNull Set<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Mutes the build problems in a specified build only. Note: does not process the build status, dependent builds, etc.- Specified by:
unmuteProblems
in interfaceLowLevelProblemMutingService
- Parameters:
buildId
- the build idproblems
- the list of buidld problems ids
-
muteProblemsInProject
@NotNull public MuteInfo muteProblemsInProject(long userId, @Nullable String comment, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull Set<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Mutes specified build problems in the project scope.- Specified by:
muteProblemsInProject
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- user who is muting.comment
- user's comment.unmuteWhenFixed
- unmute problem automatically when it is fixed everywhere.unmuteByTime
- unmute problem automatically on a certain date.problems
- identities of build problems to mute.- Returns:
- identifier of the just created mute-info.
-
muteProblemsInProject
@NotNull public MuteInfo muteProblemsInProject(long userId, @Nullable String comment, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull SProject project, @NotNull UnmutePreference handleExistingMutesPreference, @NotNull Set<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Mutes specified build problems in the project scope.- Specified by:
muteProblemsInProject
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- user who is muting.comment
- user's comment.unmuteWhenFixed
- unmute problem automatically when it is fixed everywhere.unmuteByTime
- unmute problem automatically on a certain date.problems
- identities of build problems to mute.- Returns:
- identifier of the just created mute-info.
-
muteProblemsInBT
@NotNull public MuteInfo muteProblemsInBT(long userId, @Nullable String comment, boolean unmuteWhenFixed, @Nullable Date unmuteByTime, @NotNull String projectId, @NotNull Set<String> buildTypes, @NotNull Set<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Mutes the specified build problems in the build configuration scope.- Specified by:
muteProblemsInBT
in interfaceLowLevelProblemMutingService
- Parameters:
userId
- user who is muting.comment
- user's comment.unmuteWhenFixed
- unmute problem automatically when it is fixed everywhere.unmuteByTime
- unmute problem automatically on a certain date.projectId
- project where the specified build types belong.buildTypes
- build types where to mute.problems
- build problems to mute.- Returns:
- identifier of the just created mute-info.
-
unmuteTests
public void unmuteTests(@NotNull Set<String> projectIds, @NotNull Set<String> buildTypeIds, @NotNull Collection<Long> testNameIds)
Description copied from interface:LowLevelProblemMutingService
Unmutes the specified tests in the specied project and specified build configurations.- Specified by:
unmuteTests
in interfaceLowLevelProblemMutingService
buildTypeIds
- build configuration ids.testNameIds
- test name identifiers to unmute.
-
unmuteTestsByMuteInfo
public void unmuteTestsByMuteInfo(@NotNull Collection<Integer> muteInfoIds)
Description copied from interface:LowLevelProblemMutingService
Unmutes tests associated with the given mute infos.- Specified by:
unmuteTestsByMuteInfo
in interfaceLowLevelProblemMutingService
- Parameters:
muteInfoIds
- identifiers of mute info records.
-
unmuteProblems
public void unmuteProblems(@NotNull Set<String> projectIds, @NotNull Set<String> buildTypeIds, @NotNull Collection<Integer> problems)
Description copied from interface:LowLevelProblemMutingService
Unmutes the specified build problems in the specified project and specified build configurations.- Specified by:
unmuteProblems
in interfaceLowLevelProblemMutingService
buildTypeIds
- build configuration ids.problems
- build problem identities to unmute.
-
unmuteProblemsByMuteInfo
public void unmuteProblemsByMuteInfo(@NotNull Collection<Integer> muteInfoIds)
Description copied from interface:LowLevelProblemMutingService
Unmutes build problems associated with the given mute infos.- Specified by:
unmuteProblemsByMuteInfo
in interfaceLowLevelProblemMutingService
- Parameters:
muteInfoIds
- identifiers of mute info records.
-
clearMuteInfoCache
public void clearMuteInfoCache()
Description copied from interface:LowLevelProblemMutingService
Resets cache of mute information- Specified by:
clearMuteInfoCache
in interfaceLowLevelProblemMutingService
-
retrieveTestsCurrentMuteInfos
public void retrieveTestsCurrentMuteInfos(@NotNull Set<String> projectIds, @NotNull Set<String> buildTypeIds, @NotNull MutingInfoConsumer consumer)
Description copied from interface:LowLevelProblemMutingService
Retrieves information about currently muted tests for the specified projects and build configurations.For each mute entry it call the consumer's method:
MutingInfoConsumer.consumeTestMutedInProject(java.lang.Long, java.lang.String, jetbrains.buildServer.serverSide.mute.MuteInfo)
if the entry is project-related,MutingInfoConsumer.consumeTestMutedInBuildType(java.lang.Long, java.lang.String, jetbrains.buildServer.serverSide.mute.MuteInfo)
if the entry is build-configuration-related.
- Specified by:
retrieveTestsCurrentMuteInfos
in interfaceLowLevelProblemMutingService
buildTypeIds
- build configurations id (should relate the project id).consumer
- consumer that will consume and process MuteInfo entries.
-
retrieveProblemsCurrentMuteInfos
public void retrieveProblemsCurrentMuteInfos(@NotNull Set<String> projectIds, @NotNull Set<String> buildTypeIds, @NotNull MutingInfoConsumer consumer)
Description copied from interface:LowLevelProblemMutingService
Retrieves information about currently muted build problems for the specified projects and build configurations.- Specified by:
retrieveProblemsCurrentMuteInfos
in interfaceLowLevelProblemMutingService
buildTypeIds
- build configurations id (should relate the project id).consumer
- consumer that will consume and process MuteInfo entries.
-
retrieveMutesWithTimeOut
public void retrieveMutesWithTimeOut(@NotNull MutingInfoConsumer consumer)
Description copied from interface:LowLevelProblemMutingService
Retrieves current mutes that already not actual because of the auto-unmuting time.- Specified by:
retrieveMutesWithTimeOut
in interfaceLowLevelProblemMutingService
- Parameters:
consumer
- consumer that will consume and process MuteInfo entries.
-
retrieveTestMutesForBuild
@NotNull public Map<Long,MuteInfo> retrieveTestMutesForBuild(long buildId)
Description copied from interface:LowLevelProblemMutingService
Retrieves the information about tests muting in the specified build.- Specified by:
retrieveTestMutesForBuild
in interfaceLowLevelProblemMutingService
- Parameters:
buildId
- build the information is needed for.- Returns:
- map of TestId -> MuteInfo; contains only test runs that are muted.
-
retrieveTestMutesForBuilds
@NotNull public Map<Long,Map<Long,MuteInfo>> retrieveTestMutesForBuilds(@NotNull Collection<Long> buildIds)
Description copied from interface:LowLevelProblemMutingService
Retrieves the information about muted tests in the specified builds.- Specified by:
retrieveTestMutesForBuilds
in interfaceLowLevelProblemMutingService
- Returns:
- map of build id to map of TestId -> MuteInfo; contains only test runs that are muted.
-
retrieveProblemMutesForBuild
@NotNull public Map<Integer,MuteInfo> retrieveProblemMutesForBuild(long buildId)
- Specified by:
retrieveProblemMutesForBuild
in interfaceLowLevelProblemMutingService
-
retrieveProblemMutesForBuild
@NotNull public Map<Integer,MuteInfo> retrieveProblemMutesForBuild(@NotNull DBFunctions dbf, long buildId)
- Specified by:
retrieveProblemMutesForBuild
in interfaceLowLevelProblemMutingService
-
retrieveMutesOfOneTestInBuilds
public void retrieveMutesOfOneTestInBuilds(long testNameId, Collection<Long> relatedBuildIds, MutingInBuildInfoConsumer consumer)
Description copied from interface:LowLevelProblemMutingService
Retrieves mutes of runs of one test in given builds.- Specified by:
retrieveMutesOfOneTestInBuilds
in interfaceLowLevelProblemMutingService
- Parameters:
testNameId
- identifier of test name.relatedBuildIds
- set of related buildsconsumer
- consumer to consume the retrieved info.
-
retrieveMuteTests
@NotNull public Collection<Long> retrieveMuteTests(@NotNull Integer muteId)
-
retrieveMuteProblems
@NotNull public Collection<Integer> retrieveMuteProblems(@NotNull Integer muteId)
-
makeTestRunMuter
@NotNull public TestRunMuter makeTestRunMuter(@NotNull BuildPromotionEx buildPromotion)
Description copied from interface:LowLevelProblemMutingService
Makes a new test run muting service.Warning! - the client should release all references to this service when the build is finished, to avoid memory leaks.
- Specified by:
makeTestRunMuter
in interfaceLowLevelProblemMutingService
- Parameters:
buildPromotion
- build promotion- Returns:
- the service.
-
makeBuildProblemMuter
@NotNull public BuildProblemMuter makeBuildProblemMuter(@NotNull BuildPromotionEx buildPromotion)
Description copied from interface:LowLevelProblemMutingService
Makes a new build problem muting service.Warning! - the client should release all references to this service when the build is finished, to avoid memory leaks.
- Specified by:
makeBuildProblemMuter
in interfaceLowLevelProblemMutingService
- Parameters:
buildPromotion
- build promotion
-
-