Class FixedTimeRotationPolicy

java.lang.Object
org.forgerock.audit.rotation.FixedTimeRotationPolicy
All Implemented Interfaces:
RotationPolicy

public class FixedTimeRotationPolicy extends Object implements RotationPolicy
Rotates audit files at fixed times throughout the day.
  • Constructor Details

  • Method Details

    • fixedTimeRotationPolicy

      public static FixedTimeRotationPolicy fixedTimeRotationPolicy(List<Duration> rotationTimes)
      Constructs a FixedTimeRotationPolicy given a list of milliseconds after midnight to rotateIfNeeded the files.
      Parameters:
      rotationTimes - List of Duration objects specifying the time after midnight to rotate the log file.
      Returns:
      A FixedTimeRotationPolicy instance.
    • shouldRotateFile

      public boolean shouldRotateFile(RotatableObject rotatable)
      Description copied from interface: RotationPolicy
      This method indicates if the log file should be rotated or not.
      Specified by:
      shouldRotateFile in interface RotationPolicy
      Parameters:
      rotatable - The file to be checked.
      Returns:
      True if the log file should be rotated, false otherwise.
    • getDailyRotationTimeDurations

      public List<Duration> getDailyRotationTimeDurations()
      Get the list of times since midnight that rotation will occur at.
      Returns:
      The list of times as Duration instances.
    • getDailyRotationTimes

      @Deprecated(since="27.0.0", forRemoval=true) public List<Duration> getDailyRotationTimes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the list of times since midnight that rotation will occur at.
      Returns:
      The list of times as Duration instances.