Package org.forgerock.audit.rotation
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 Summary
Constructors Constructor Description FixedTimeRotationPolicy(List<Duration> rotationTimes)
Constructs aFixedTimeRotationPolicy
given a list of milliseconds after midnight to rotateIfNeeded the files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Duration>
getDailyRotationTimes()
Get 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 Detail
-
FixedTimeRotationPolicy
public FixedTimeRotationPolicy(List<Duration> rotationTimes)
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 Detail
-
shouldRotateFile
public boolean shouldRotateFile(RotatableObject rotatable)
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.
-
-