Interface BuildCleanupContext
-
- All Superinterfaces:
CleanupContext
- All Known Subinterfaces:
BuildCleanupContextEx
- All Known Implementing Classes:
BuildCleanupContextImpl
public interface BuildCleanupContext extends CleanupContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default List<Long>
getBuildIds()
Returns ids of builds to be cleaned on given cleanup level.List<SFinishedBuild>
getBuilds()
Returns list of builds to be cleaned on given cleanup level if such builds still exist.CleanupLevel
getCleanupLevel()
CleanupPolicy
getCleanupPolicyForBuild(long buildId)
Deprecated.since 2019.2: always returns the cleanup policy with "do not clean anything" artifacts pattern.ErrorReporter
getErrorReporter()
Deprecated.Object
getExtensionData(String key)
Retrieves the data stored by an extension for a provided key.void
onBuildCleanupError(BuildsCleanupExtension cleanupExtension, SBuild build, 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 sameerrorMessage
when possible: it will allow to provide the resulting health report in a more compact format.void
setExtensionData(String key, Object data)
A method that can be used by aBuildsCleanupExtension
to store data in the current cleanup context.-
Methods inherited from interface jetbrains.buildServer.serverSide.cleanup.CleanupContext
getCleanupState
-
-
-
-
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.
-
getErrorReporter
@NotNull @Deprecated ErrorReporter getErrorReporter()
Deprecated.- Returns:
- error reporter which can be used if errors occur during the cleanup.
-
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 sameerrorMessage
when possible: it will allow to provide the resulting health report in a more compact format.- Parameters:
cleanupExtension
- the affected clean-up extensionbuild
- the affected builderrorMessage
- 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 aBuildsCleanupExtension
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
-
-