Class TimeBasedDirectoryCleanerConfig

java.lang.Object
org.kiwiproject.dropwizard.config.TimeBasedDirectoryCleanerConfig

public class TimeBasedDirectoryCleanerConfig extends Object
A (Dropwizard) configuration class to configure and schedule a TimeBasedDirectoryCleaner.
  • Field Details

    • DEFAULT_INITIAL_DELAY_MILLIS

      public static final io.dropwizard.util.Duration DEFAULT_INITIAL_DELAY_MILLIS
    • SHUTDOWN_DURATION

      public static final io.dropwizard.util.Duration SHUTDOWN_DURATION
  • Constructor Details

    • TimeBasedDirectoryCleanerConfig

      public TimeBasedDirectoryCleanerConfig()
  • Method Details

    • scheduleCleanupUsing

      public TimeBasedDirectoryCleaner scheduleCleanupUsing(ScheduledExecutorService cleanupExecutor)
      Schedules directory cleanup using the given ScheduledExecutorService, returning the TimeBasedDirectoryCleaner instance 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 ScheduledExecutorService is externally managed and has only one thread.
    • scheduleCleanupUsing

      public TimeBasedDirectoryCleaner scheduleCleanupUsing(io.dropwizard.core.setup.Environment environment)
      Schedules directory cleanup and registers a TimeBasedDirectoryCleanerHealthCheck health check using the given Environment, returning the TimeBasedDirectoryCleaner instance 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
    • getDirectoryPath

      public String getDirectoryPath()
    • getRetentionThreshold

      public io.dropwizard.util.Duration getRetentionThreshold()
    • getInitialCleanupDelay

      public io.dropwizard.util.Duration getInitialCleanupDelay()
    • getCleanupInterval

      public io.dropwizard.util.Duration getCleanupInterval()
    • getHealthCheckWarningDuration

      public io.dropwizard.util.Duration getHealthCheckWarningDuration()
    • getDeleteErrorLogLevel

      public String getDeleteErrorLogLevel()
    • setDirectoryPath

      public void setDirectoryPath(String directoryPath)
    • setRetentionThreshold

      public void setRetentionThreshold(io.dropwizard.util.Duration retentionThreshold)
    • setInitialCleanupDelay

      public void setInitialCleanupDelay(io.dropwizard.util.Duration initialCleanupDelay)
    • setCleanupInterval

      public void setCleanupInterval(io.dropwizard.util.Duration cleanupInterval)
    • setHealthCheckWarningDuration

      public void setHealthCheckWarningDuration(io.dropwizard.util.Duration healthCheckWarningDuration)
    • setDeleteErrorLogLevel

      public void setDeleteErrorLogLevel(String deleteErrorLogLevel)