Package org.forgerock.audit.rotation
Class SizeBasedRotationPolicy
java.lang.Object
org.forgerock.audit.rotation.SizeBasedRotationPolicy
- All Implemented Interfaces:
RotationPolicy
Creates a file size based rotation policy. Once a file is a given size in bytes it is rotated.
-
Constructor Summary
ConstructorDescriptionSizeBasedRotationPolicy
(long maxFileSizeInBytes) Constructs a SizeBasedRotationPolicy given a max file size in bytes. -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the maximum size (in bytes) a file may grow to before being rotated.boolean
Indicates whether or not aRotatableObject
needs rotation.
-
Constructor Details
-
SizeBasedRotationPolicy
public SizeBasedRotationPolicy(long maxFileSizeInBytes) Constructs a SizeBasedRotationPolicy given a max file size in bytes.- Parameters:
maxFileSizeInBytes
- A max file size in bytes.
-
-
Method Details
-
shouldRotateFile
Indicates whether or not aRotatableObject
needs rotation.- Specified by:
shouldRotateFile
in interfaceRotationPolicy
- Parameters:
file
- TheRotatableObject
to be checked.- Returns:
- True - If the
RotatableObject
needs rotation. False - If theRotatableObject
doesn't need rotation.
-
getMaxFileSizeInBytes
public long getMaxFileSizeInBytes()Gets the maximum size (in bytes) a file may grow to before being rotated.- Returns:
- the maximum file size permitted by this policy.
-