Class FixedTimeRotationPolicy

  • All Implemented Interfaces:
    RotationPolicy

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

      • FixedTimeRotationPolicy

        public 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.
    • Method Detail

      • shouldRotateFile

        public boolean shouldRotateFile​(RotatableObject rotatable)
        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.
      • getDailyRotationTimes

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