Interface CleanupProcessStateEx

    • Method Detail

      • reportBuildsToProcess

        void reportBuildsToProcess​(int buildsCount)
        Adds count of the builds scheduled for cleanup operation
        Parameters:
        buildsCount - count of the builds scheduled for cleanup operation
      • reportBuildsProcessed

        void reportBuildsProcessed​(@NotNull
                                   List<Long> buildIds,
                                   @NotNull
                                   CleanupLevel cleanupLevel)
        Sets ids of builds already processed by cleanup
        Parameters:
        buildIds - ids of builds already processed by cleanup
      • isAnyProcessedBuildForLevel

        boolean isAnyProcessedBuildForLevel​(@NotNull
                                            CleanupLevel cleanupLevel)
        Returns true if there is at least one processed build at specified level, false otherwise.
      • setCurrentStage

        void setCurrentStage​(@NotNull
                             String stageDescription)
        Sets description of current cleanup stage
        Parameters:
        stageDescription - cleanup stage description
      • setInterruptedByUser

        void setInterruptedByUser​(@NotNull
                                  SUser user)
        Marks cleanup process as interrupted by specified user
        Parameters:
        user - user who interrupted cleanup
      • isMainCleanupProcess

        boolean isMainCleanupProcess()
        Returns true if cleanup process is running as a part of the main cleanup process - which can be used by extensions to optimise cleanup behaviour.
      • useArtifactPatternsCache

        boolean useArtifactPatternsCache()
        Returns true if cleanup process is expected to use cache of applied keep artifact patterns for particular builds.
      • collectMetrics

        boolean collectMetrics()
        Returns true if cleanup process is expected to collect metrics.
      • getStartTime

        long getStartTime()
        Returns cleanup start time in millis.
      • onExtensionError

        void onExtensionError​(@NotNull
                              String extensionName,
                              @NotNull
                              Collection<? extends SBuild> builds,
                              @NotNull
                              String errorMessage,
                              @NotNull
                              CleanupLevel level)
        Stores an information about an error happened during the cleanup extension call and about affected builds.
      • hasExtensionErrors

        boolean hasExtensionErrors()
        Returns true if there is an error happened during cleanup extensions call.
        See Also:
        getExtensionErrorsMap()
      • getExtensionErrorsMap

        @NotNull
        NavigableMap<ExtensionError,​Map<String,​Pair<List<Long>,​List<Long>>>> getExtensionErrorsMap()
        Returns an information about all exceptions that happened during cleanup extension call and about affected builds:
        Error data -> affected build type id -> (ids of partly cleaned builds, ids of removed from history builds).
      • onCleanedFilesSize

        void onCleanedFilesSize​(long cleanedSize)
        Adds the amount of bytes of cleaned files.
      • getCleanedFilesSize

        long getCleanedFilesSize()
        Returns the amount of bytes cleaned by BuildArtifactsCleaner. Artifacts cleaned in external repositories (like S3, Docker) are not taken into account.
      • getCleanupDecisionListener

        CleanupDecisionListener getCleanupDecisionListener()
        Returns a listener for build-related clean-up reports.
      • getDryRunBuildTypesIds

        @NotNull
        Set<String> getDryRunBuildTypesIds()
        Returns:
        a collection of internal build type ids marke for dry-run cleanup.