Package org.opends.server.loggers
Class TimeLimitRotationPolicy
java.lang.Object
org.opends.server.loggers.TimeLimitRotationPolicy
- All Implemented Interfaces:
ConfigurationChangeListener<TimeLimitLogRotationPolicyCfg>
,RotationPolicy<TimeLimitLogRotationPolicyCfg>
public final class TimeLimitRotationPolicy
extends Object
implements RotationPolicy<TimeLimitLogRotationPolicyCfg>, ConfigurationChangeListener<TimeLimitLogRotationPolicyCfg>
This class implements a fixed time based rotation policy. Rotation will happen N seconds since the last rotation.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionApplies the configuration changes to this change listener.void
Initializes this log rotation policy based on the information in the provided rotation policy configuration.boolean
isConfigurationChangeAcceptable
(TimeLimitLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.boolean
rotateFile
(RotatableLogFile writer) This method indicates if the log file should be rotated or not.
-
Constructor Details
-
TimeLimitRotationPolicy
public TimeLimitRotationPolicy()
-
-
Method Details
-
initializeLogRotationPolicy
Description copied from interface:RotationPolicy
Initializes this log rotation policy based on the information in the provided rotation policy configuration.- Specified by:
initializeLogRotationPolicy
in interfaceRotationPolicy<TimeLimitLogRotationPolicyCfg>
- Parameters:
config
- The rotation policy configuration that contains the information to use to initialize this policy.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(TimeLimitLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListener
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptable
in interfaceConfigurationChangeListener<TimeLimitLogRotationPolicyCfg>
- Parameters:
config
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
true
if the proposed change is acceptable, orfalse
if it is not.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<TimeLimitLogRotationPolicyCfg>
- Parameters:
config
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
rotateFile
Description copied from interface:RotationPolicy
This method indicates if the log file should be rotated or not.- Specified by:
rotateFile
in interfaceRotationPolicy<TimeLimitLogRotationPolicyCfg>
- Parameters:
writer
- the file writer to be checked.- Returns:
- true if the log file should be rotated, false otherwise.
-