Class Fido2MetricsAggregationScheduler

java.lang.Object
io.jans.fido2.service.metric.Fido2MetricsAggregationScheduler

@ApplicationScoped public class Fido2MetricsAggregationScheduler extends Object
Scheduler service for FIDO2 metrics aggregation
Author:
FIDO2 Team
  • Constructor Details

    • Fido2MetricsAggregationScheduler

      public Fido2MetricsAggregationScheduler()
  • Method Details

    • isAggregationEnabled

      public boolean isAggregationEnabled()
      Check if aggregation is enabled
    • getDataRetentionDays

      public int getDataRetentionDays()
      Get data retention days
    • flushPendingMetrics

      public void flushPendingMetrics()
      Ensure all pending metrics are persisted to database This method should be called before node shutdown or during maintenance
    • shouldPerformAggregation

      public boolean shouldPerformAggregation()
      Check if this node should perform the aggregation In single-node deployments: always returns true In multi-node clusters: uses distributed locking to coordinate Synchronized to prevent race conditions between concurrent job threads
    • startPeriodicLockUpdates

      public ScheduledFuture<?> startPeriodicLockUpdates()
      Start periodic updates to keep the lock alive during aggregation work Should be called at the start of aggregation work Only used in cluster environments
      Returns:
      ScheduledFuture that can be used to cancel the updates, or null if not in cluster
    • initTimer

      public void initTimer()
      Initialize and register Quartz jobs for metrics aggregation Called during application startup by AppInitializer
    • releaseClusterNode

      @PreDestroy public void releaseClusterNode()
      Cleanup resources on shutdown Shuts down update executor if in cluster mode