Class TimeBasedDirectoryCleanerConfig
- java.lang.Object
-
- org.kiwiproject.dropwizard.config.TimeBasedDirectoryCleanerConfig
-
public class TimeBasedDirectoryCleanerConfig extends Object
A (Dropwizard) configuration class to configure and schedule aTimeBasedDirectoryCleaner.
-
-
Field Summary
Fields Modifier and Type Field Description static io.dropwizard.util.DurationDEFAULT_INITIAL_DELAY_MILLISstatic io.dropwizard.util.DurationSHUTDOWN_DURATION
-
Constructor Summary
Constructors Constructor Description TimeBasedDirectoryCleanerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeBasedDirectoryCleanerscheduleCleanupUsing(io.dropwizard.setup.Environment environment)Schedules directory cleanup and registers aTimeBasedDirectoryCleanerHealthCheckhealth check using the givenEnvironment, returning theTimeBasedDirectoryCleanerinstance that was scheduled.TimeBasedDirectoryCleanerscheduleCleanupUsing(ScheduledExecutorService cleanupExecutor)Schedules directory cleanup using the givenScheduledExecutorService, returning theTimeBasedDirectoryCleanerinstance that was scheduled.
-
-
-
Method Detail
-
scheduleCleanupUsing
public TimeBasedDirectoryCleaner scheduleCleanupUsing(ScheduledExecutorService cleanupExecutor)
Schedules directory cleanup using the givenScheduledExecutorService, returning theTimeBasedDirectoryCleanerinstance that was scheduled. It can then be used to retrieve delete error information.- Parameters:
cleanupExecutor- the scheduled executor to use- Returns:
- a new TimeBasedDirectoryCleaner using the given executor
- Implementation Note:
- It is assumed that the
ScheduledExecutorServiceis externally managed and has only one thread.
-
scheduleCleanupUsing
public TimeBasedDirectoryCleaner scheduleCleanupUsing(io.dropwizard.setup.Environment environment)
Schedules directory cleanup and registers aTimeBasedDirectoryCleanerHealthCheckhealth check using the givenEnvironment, returning theTimeBasedDirectoryCleanerinstance that was scheduled. It can then be used to retrieve delete error information.- Parameters:
environment- the Dropwizard Environment to use- Returns:
- a new TimeBasedDirectoryCleaner using the given environment
-
-