Package org.forgerock.audit.rotation
Class FixedTimeRotationPolicy
java.lang.Object
org.forgerock.audit.rotation.FixedTimeRotationPolicy
- All Implemented Interfaces:
RotationPolicy
Rotates audit files at fixed times throughout the day.
-
Constructor Summary
ConstructorDescriptionFixedTimeRotationPolicy
(List<Duration> rotationTimes) Constructs aFixedTimeRotationPolicy
given a list of milliseconds after midnight to rotateIfNeeded the files. -
Method Summary
Modifier and TypeMethodDescriptionGet the list of times since midnight that rotation will occur at.boolean
shouldRotateFile
(RotatableObject rotatable) This method indicates if the log file should be rotated or not.
-
Constructor Details
-
FixedTimeRotationPolicy
Constructs aFixedTimeRotationPolicy
given a list of milliseconds after midnight to rotateIfNeeded the files.- Parameters:
rotationTimes
- List ofDuration
objects specifying the time after midnight to rotate the log file.
-
-
Method Details
-
shouldRotateFile
This method indicates if the log file should be rotated or not.- Specified by:
shouldRotateFile
in interfaceRotationPolicy
- Parameters:
rotatable
- The file to be checked.- Returns:
- True if the log file should be rotated, false otherwise.
-
getDailyRotationTimes
Get the list of times since midnight that rotation will occur at.- Returns:
- The list of times as
Duration
instances.
-