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
ConstructorsConstructorDescriptionFixedTimeRotationPolicy(List<Duration> rotationTimes) Constructs aFixedTimeRotationPolicygiven 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.booleanshouldRotateFile(RotatableObject rotatable) This method indicates if the log file should be rotated or not.
-
Constructor Details
-
FixedTimeRotationPolicy
Constructs aFixedTimeRotationPolicygiven a list of milliseconds after midnight to rotateIfNeeded the files.- Parameters:
rotationTimes- List ofDurationobjects 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:
shouldRotateFilein 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
Durationinstances.
-