Interface CleanupProcessState
-
- All Known Subinterfaces:
CleanupProcessStateEx
- All Known Implementing Classes:
ServerCleanupState
public interface CleanupProcessState
Represents status of cleanup progress- Since:
- 8.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getBuildsToProcess()
String
getCurrentStage()
Returns text description of the current cleanup stage.long
getElapsedTime()
InterruptReason
getInterruptReason()
SUser
getInterruptUser()
int
getProcessedBuilds()
Collection<Long>
getProcessedBuilds(CleanupLevel... cleanupLevels)
Returns ids of all builds processed on specified cleanup levels.Set<String>
getRemovedBuildTypesIds()
Set<String>
getRemovedProjectsIds()
boolean
isInProgress()
boolean
isInterrupted()
Returnstrue
if the cleanup process was interrupted.
Note for extensions: the usage ofthrowIfInterrupted()
is preferred because allows to stop the cleanup process faster.void
throwIfInterrupted()
ThrowsCleanupInterruptedException
if 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 CleanupInterruptedException
ThrowsCleanupInterruptedException
if the cleanup process was interrupted.- Throws:
CleanupInterruptedException
- if the cleanup process was interrupted.- Since:
- 2020.2
-
isInterrupted
boolean isInterrupted()
Returnstrue
if the cleanup process was interrupted.
Note for extensions: the usage ofthrowIfInterrupted()
is preferred because allows to stop the cleanup process faster.- Returns:
true
if 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
-1
it 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:
true
if 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
-
-