Interface CleanupProcessState
-
- All Known Subinterfaces:
CleanupProcessStateEx
- All Known Implementing Classes:
ServerCleanupState
public interface CleanupProcessStateRepresents status of cleanup progress- Since:
- 8.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetBuildsToProcess()StringgetCurrentStage()Returns text description of the current cleanup stage.longgetElapsedTime()InterruptReasongetInterruptReason()SUsergetInterruptUser()intgetProcessedBuilds()Collection<Long>getProcessedBuilds(CleanupLevel... cleanupLevels)Returns ids of all builds processed on specified cleanup levels.Set<String>getRemovedBuildTypesIds()Set<String>getRemovedProjectsIds()booleanisInProgress()booleanisInterrupted()Returnstrueif the cleanup process was interrupted.
Note for extensions: the usage ofthrowIfInterrupted()is preferred because allows to stop the cleanup process faster.voidthrowIfInterrupted()ThrowsCleanupInterruptedExceptionif the cleanup process was interrupted.
-
-
-
Method Detail
-
getCurrentStage
@NotNull String getCurrentStage()
Returns text description of the current cleanup stage.- Returns:
- returns text description of current cleanup stage
-
throwIfInterrupted
void throwIfInterrupted() throws CleanupInterruptedExceptionThrowsCleanupInterruptedExceptionif the cleanup process was interrupted.- Throws:
CleanupInterruptedException- if the cleanup process was interrupted.- Since:
- 2020.2
-
isInterrupted
boolean isInterrupted()
Returnstrueif the cleanup process was interrupted.
Note for extensions: the usage ofthrowIfInterrupted()is preferred because allows to stop the cleanup process faster.- Returns:
trueif the cleanup process was interrupted- See Also:
throwIfInterrupted()
-
getInterruptReason
@Nullable InterruptReason getInterruptReason()
- Returns:
- if cleanup interrupted, returns reason of interruption
-
getInterruptUser
@Nullable SUser getInterruptUser()
- Returns:
- if cleanup interrupted, returns user who interrupted it
-
getProcessedBuilds
int getProcessedBuilds()
- Returns:
- number of processed builds or
-1it there is none of them
-
getBuildsToProcess
int getBuildsToProcess()
- Returns:
- number of builds scheduled to cleanup but not yet processed
-
getElapsedTime
long getElapsedTime()
- Returns:
- returns cleanup process elapsed time in milliseconds
-
isInProgress
boolean isInProgress()
- Returns:
trueif cleanup is in progress (even if it was interrupted)
-
getProcessedBuilds
@NotNull Collection<Long> getProcessedBuilds(@NotNull CleanupLevel... cleanupLevels)
Returns ids of all builds processed on specified cleanup levels.- Parameters:
cleanupLevels- cleanup levels- Returns:
- ids of processed builds
-
getRemovedProjectsIds
@NotNull Set<String> getRemovedProjectsIds()
- Returns:
- a collection of internal project ids for the removed projects whose data should be cleaned up
- Since:
- 2018.1
-
-