Class BuildTablesCleanerImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.cleanup.extensions.BuildTablesCleanerImpl
-
- All Implemented Interfaces:
AfterBuildsCleanupExtension
,BuildsCleanupExtension
,BuildTablesCleaner
,ServerExtension
,TeamCityExtension
,PositionAware
,PositionConstraintAware
public class BuildTablesCleanerImpl extends Object implements BuildTablesCleaner, BuildsCleanupExtension, AfterBuildsCleanupExtension, PositionAware
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFERRED_CLEANER_DELAY_PROP
-
Constructor Summary
Constructors Constructor Description BuildTablesCleanerImpl(SQLRunnerEx sqlRunner, ExecutorServicesEx executorServices, CleanupHistory cleanupHistory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBuildRelatedTables(String... tables)
void
afterCleanup(CleanupProcessState cleanupState)
Invoked upon finishing of the main cleanup process.void
cleanupBuildsData(BuildCleanupContext cleanupContext)
Invoked afterBuildsCleanupExtension.prepareBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
is called for all extensions.PositionConstraint
getConstraint()
Constraint to be respected during objects sorting.String
getOrderId()
Returns object id that can be referenced by {PositionConstraint
}-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.cleanup.BuildsCleanupExtension
getCleanupBuildsDataConcurrencyLevel, getDisplayName, prepareBuildsData
-
-
-
-
Field Detail
-
DEFERRED_CLEANER_DELAY_PROP
public static final String DEFERRED_CLEANER_DELAY_PROP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BuildTablesCleanerImpl
public BuildTablesCleanerImpl(@NotNull SQLRunnerEx sqlRunner, @NotNull ExecutorServicesEx executorServices, @NotNull CleanupHistory cleanupHistory)
-
-
Method Detail
-
addBuildRelatedTables
public void addBuildRelatedTables(@NotNull String... tables)
- Specified by:
addBuildRelatedTables
in interfaceBuildTablesCleaner
-
cleanupBuildsData
public void cleanupBuildsData(@NotNull BuildCleanupContext cleanupContext)
Description copied from interface:BuildsCleanupExtension
Invoked afterBuildsCleanupExtension.prepareBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
is called for all extensions. There is no guarantee about ordering of the method execution for different extensions, they may be called simultaneously etc. It should perform db operations in current thread otherwise deadlock can occur.- Specified by:
cleanupBuildsData
in interfaceBuildsCleanupExtension
- Parameters:
cleanupContext
- cleanup context
-
afterCleanup
public void afterCleanup(@NotNull CleanupProcessState cleanupState) throws CleanupInterruptedException
Description copied from interface:AfterBuildsCleanupExtension
Invoked upon finishing of the main cleanup process. At this point all data for specific builds is deleted.
Note: This extension might not be called for every cleanup run as cleanup process can be interrupted earlier. Extension must check cleanup process state and if it is interrupted, complete its operations and return as quick as possible.- Specified by:
afterCleanup
in interfaceAfterBuildsCleanupExtension
- Parameters:
cleanupState
- cleanup process state- Throws:
CleanupInterruptedException
- if the cleanup process was interrupted
-
getOrderId
@NotNull public String getOrderId()
Description copied from interface:PositionAware
Returns object id that can be referenced by {PositionConstraint
}- Specified by:
getOrderId
in interfacePositionAware
- Returns:
- object id
-
getConstraint
@NotNull public PositionConstraint getConstraint()
Description copied from interface:PositionConstraintAware
Constraint to be respected during objects sorting.- Specified by:
getConstraint
in interfacePositionConstraintAware
- Returns:
- position constraint
-
-