Class ProblemMutingServiceImpl

    • Method Detail

      • 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 interface ProblemMutingService
        Parameters:
        user - user who muting the tests.
        note - a user's note.
        unmuteWhenFixed - true for unmuting on test pass
        unmuteByTime - when to unmute if unmuting at specified time
        project - project to mute in
        tests - 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 interface ProblemMutingService
        Parameters:
        user - user who muting the tests.
        note - a user's note.
        unmuteWhenFixed - true for unmuting on test pass
        unmuteByTime - when to unmute if unmuting at specified time
        project - project to mute in
        removeExistingPreference - specifies scope where existing mutes should be removed
        tests - 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 interface ProblemMutingService
        Parameters:
        muteInfo - mute info to copy
        newProject - 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 interface ProblemMutingService
        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 interface ProblemMutingService
        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 removed
        problems - build problems 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 interface ProblemMutingService
        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.
      • 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 interface ProblemMutingService
        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 interface ProblemMutingService
        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 interface ProblemMutingService
        Parameters:
        user - user who performs an action
        note - additional comments
        buildType - build type scope
        tests - tests 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 interface ProblemMutingService
        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 interface ProblemMutingService
        Parameters:
        user - user who is unmuting.
        note - a user's note.
        unmutePreference - in which projects specified problems should be unmuted.
        problems - 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 interface ProblemMutingService
        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 interface ProblemMutingService
        Returns:
        mute info map: build id -> map(test id -> mute info)
      • 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 interface ProblemMutingService
        Parameters:
        project - the project
        Returns:
        current mute info map: test id -> current mute info
      • 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 interface ProblemMutingService
        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 interface ProblemMutingService
        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 interface ProblemMutingService
        Parameters:
        projectId - project internal id
        problemInfos - 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 interface ProblemMutingService
        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 interface ProblemMutingService
        Parameters:
        project - project
        Returns:
        see above
      • selectDistinctProjectsFromTests

        @NotNull
        public static Set<SProject> selectDistinctProjectsFromTests​(@NotNull
                                                                    Collection<STest> tests)