Class BuildsManagerImpl

    • Constructor Detail

      • BuildsManagerImpl

        public BuildsManagerImpl()
    • Method Detail

      • setSecurityContext

        public void setSecurityContext​(SecurityContextEx securityContext)
      • setProjectManager

        public void setProjectManager​(ProjectManagerEx projectManager)
      • findBuildInstanceById

        @Nullable
        public SBuild findBuildInstanceById​(long buildId)
        Return the build which corresponds to given buildId. Build can be running, or it can be finished.
        Specified by:
        findBuildInstanceById in interface BuildsManager
        Parameters:
        buildId - build identifier
        Returns:
        the build which corresponds to given buildId
        Throws:
        AccessDeniedException - if the current authority holder doesn't have an access to the build with the given id.
        See Also:
        BuildsManager.findBuildInstanceById(long)
      • findPreviousBuild

        @Nullable
        public SBuild findPreviousBuild​(@NotNull
                                        SBuild buildData)
        Description copied from interface: BuildsManager
        Finds a non personal build (running or finished) which was started before the specified build and contains same or previous changes than the specified build. The resulting build belongs to the same build configuration.
        Specified by:
        findPreviousBuild in interface BuildsManager
        Parameters:
        buildData - build to find previous build for
        Returns:
        previous build in same build configuration or null if there is no previous build
      • findBuildInstances

        @NotNull
        public Collection<SBuild> findBuildInstances​(@NotNull
                                                     Collection<Long> buildIds)
        Description copied from interface: BuildsManager
        Returns collection of builds corresponding to the specified builds ids. Both running and finished builds can appear in the resulting collection. The collection will contain existing builds only. NOTE: RETURNED COLLECTION WILL NOT MAINTAIN REQUESTED ORDER!
        Specified by:
        findBuildInstances in interface BuildsManager
        Parameters:
        buildIds - build identifiers to be searched for.
        Returns:
        see above
      • findBuildInstanceByBuildNumber

        public SBuild findBuildInstanceByBuildNumber​(@NotNull
                                                     String buildTypeId,
                                                     @NotNull
                                                     String buildNumber)
        Description copied from interface: BuildsManager
        Returns the most recent build (ordered by changes) with the specified build number
        Specified by:
        findBuildInstanceByBuildNumber in interface BuildsManager
        Parameters:
        buildTypeId - build configuration internal id
        buildNumber - build number string
        Returns:
        see above
      • findBuildInstancesByBuildNumber

        @NotNull
        public List<SBuild> findBuildInstancesByBuildNumber​(@NotNull
                                                            String buildTypeId,
                                                            @NotNull
                                                            String buildNumber)
        Description copied from interface: BuildsManager
        Returns builds in specified build configuration id having the specified build number. Builds are ordered by changes, i.e. the most recent build first. The list may contain personal builds too.
        Specified by:
        findBuildInstancesByBuildNumber in interface BuildsManager
        Parameters:
        buildTypeId - build configuration internal id
        buildNumber - build number
        Returns:
        see above
      • findRunningBuildById

        @Nullable
        public SRunningBuild findRunningBuildById​(long buildId)
        Description copied from interface: RunningBuildsManager
        Searches for a running build by specified build id.
        Specified by:
        findRunningBuildById in interface RunningBuildsManager
        Parameters:
        buildId - id of the build
        Returns:
        running build with specified build id or null if there are no running build with such build id.
      • getRunningBuilds

        @NotNull
        public List<SRunningBuild> getRunningBuilds​(@Nullable
                                                    User user,
                                                    @Nullable
                                                    BuildDataFilter filter)
        Description copied from interface: RunningBuildsManager
        Returns all running builds including personal builds according to settings of the specified user. If user is not null then all non-personal builds and personal builds of this user will be returned. If user settings are configured to show all personal builds, then personal builds of other users will be returned as well. If user is null, then all personal and non-personal builds are returned. If filter is not null it will be applied to the result. List of running builds is sorted by build id in reverse order (most recent build first).
        Specified by:
        getRunningBuilds in interface RunningBuildsManager
        Parameters:
        user - owner of personal builds, can be null
        filter - filter to apply for builds, can be null
        Returns:
        unmodifiable list of running builds
      • getRunningBuilds

        @NotNull
        public List<SRunningBuild> getRunningBuilds​(@Nullable
                                                    User user,
                                                    @NotNull
                                                    SBuildType buildType)
        Description copied from interface: RunningBuildsManager
        Returns all running builds including personal builds which belong to the specified build configuration. If user is not null then all non-personal builds and personal builds of this user will be returned. If user settings are configured to show all personal builds, then personal builds of other users will be returned as well. If user is null, then all personal and non-personal builds are returned. List of running builds is sorted by build id in reverse order (most recent build first).
        Specified by:
        getRunningBuilds in interface RunningBuildsManager
        Parameters:
        user - owner of personal builds or null
        buildType - build configuration
        Returns:
        see above
      • getRunningStatus

        public Map<SBuildType,​List<SRunningBuild>> getRunningStatus​(@Nullable
                                                                          User user,
                                                                          @Nullable
                                                                          BuildDataFilter filter)
        Description copied from interface: RunningBuildsManager
        Returns map of running builds per build configuration. Method returns all personal builds if user is null, otherwise only personal builds of this user are returned. If filter is not null it will be applied to the result. The resulting map will contain only those build configurations for which list or running builds is not empty. List of running builds is sorted by build id in reverse order (most recent build first).
        Specified by:
        getRunningStatus in interface RunningBuildsManager
        Parameters:
        user - owner of personal builds, can be null
        filter - filter to apply for builds, can be null
        Returns:
        unmodifiable map of running builds per build type