Class RetentionScheduler

java.lang.Object
com.nmontytskyi.monitoring.server.scheduler.RetentionScheduler

@Component public class RetentionScheduler extends Object
Scheduled component that triggers periodic database cleanup according to the configured data-retention policy.

Reads the retention.enabled, retention.frequency, and retention.time settings at runtime from AppSettingsService and delegates the actual deletion to RetentionService. Running daily by default at 03:00, the scheduler removes metric records, alert events, and report history entries older than their respective retention windows.

Author:
Nazar Montytskyi
See Also:
  • Constructor Details

    • RetentionScheduler

      public RetentionScheduler()
  • Method Details

    • scheduleFromSettings

      @PostConstruct public void scheduleFromSettings()
    • reschedule

      public void reschedule()
    • buildCron

      public static String buildCron(String frequency, String timeOfDay)