Interface BuildCleanupContext

    • Method Detail

      • getCleanupLevel

        @NotNull
        CleanupLevel getCleanupLevel()
        Returns:
        current cleanup level
      • getCleanupPolicyForBuild

        @NotNull
        @Deprecated
        CleanupPolicy getCleanupPolicyForBuild​(long buildId)
        Deprecated.
        since 2019.2: always returns the cleanup policy with "do not clean anything" artifacts pattern.
        This method is intended for TeamCity internal usage only and can be changed, removed or throw an exception at any time!
        Always returns the cleanup policy with "do not clean anything" artifacts pattern.
        Parameters:
        buildId - id of the build
        Since:
        2017.1.1
      • getBuilds

        @NotNull
        List<SFinishedBuild> getBuilds()
        Returns list of builds to be cleaned on given cleanup level if such builds still exist.
      • getBuildIds

        @NotNull
        default List<Long> getBuildIds()
        Returns ids of builds to be cleaned on given cleanup level.
      • onBuildCleanupError

        void onBuildCleanupError​(@NotNull
                                 BuildsCleanupExtension cleanupExtension,
                                 @NotNull
                                 SBuild build,
                                 @NotNull
                                 String errorMessage)
        Informs the core clean-up process about an error happened in a clean-up extension.
        Note: if there are a lot of such calls, try to keep the same errorMessage when possible: it will allow to provide the resulting health report in a more compact format.
        Parameters:
        cleanupExtension - the affected clean-up extension
        build - the affected build
        errorMessage - the error description
        Since:
        2020.2.3
      • getExtensionData

        @Nullable
        Object getExtensionData​(@NotNull
                                String key)
        Retrieves the data stored by an extension for a provided key.
        Parameters:
        key - a unique key that identifies saved object. Suggested naming convention: 'extension_class_name.extension_specific_data_key' (Example: `jetbrains.buildServer.serverSide.impl.CustomDataStorageManagerImpl.SUFFIXES_CACHE`).
        Returns:
        data stored by an extension in this context by means of setExtensionData(String, Object) invocation.
        Since:
        2024.07
      • setExtensionData

        void setExtensionData​(@NotNull
                              String key,
                              @NotNull
                              Object data)
        A method that can be used by a BuildsCleanupExtension to store data in the current cleanup context.
        Parameters:
        key - a unique key that identifies saved object. Suggested naming convention: 'extension_class_name.extension_specific_data_key' (Example: * `jetbrains.buildServer.serverSide.impl.CustomDataStorageManagerImpl.SUFFIXES_CACHE`).
        data - data to be stored for the provided key.
        Since:
        2024.07