Package org.opends.server.loggers
Class FixedTimeRotationPolicy
- java.lang.Object
-
- org.opends.server.loggers.FixedTimeRotationPolicy
-
- All Implemented Interfaces:
ConfigurationChangeListener<FixedTimeLogRotationPolicyCfg>,RotationPolicy<FixedTimeLogRotationPolicyCfg>
public final class FixedTimeRotationPolicy extends Object implements RotationPolicy<FixedTimeLogRotationPolicyCfg>, ConfigurationChangeListener<FixedTimeLogRotationPolicyCfg>
This class implements a rotation policy based on fixed day/time of day.
-
-
Constructor Summary
Constructors Constructor Description FixedTimeRotationPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(FixedTimeLogRotationPolicyCfg config)Applies the configuration changes to this change listener.voidinitializeLogRotationPolicy(FixedTimeLogRotationPolicyCfg config)Initializes this log rotation policy based on the information in the provided rotation policy configuration.booleanisConfigurationChangeAcceptable(FixedTimeLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.booleanrotateFile(RotatableLogFile writer)This method indicates if the log file should be rotated or not.
-
-
-
Method Detail
-
initializeLogRotationPolicy
public void initializeLogRotationPolicy(FixedTimeLogRotationPolicyCfg config)
Description copied from interface:RotationPolicyInitializes this log rotation policy based on the information in the provided rotation policy configuration.- Specified by:
initializeLogRotationPolicyin interfaceRotationPolicy<FixedTimeLogRotationPolicyCfg>- Parameters:
config- The rotation policy configuration that contains the information to use to initialize this policy.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(FixedTimeLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<FixedTimeLogRotationPolicyCfg>- 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
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(FixedTimeLogRotationPolicyCfg config)
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<FixedTimeLogRotationPolicyCfg>- Parameters:
config- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
rotateFile
public boolean rotateFile(RotatableLogFile writer)
Description copied from interface:RotationPolicyThis method indicates if the log file should be rotated or not.- Specified by:
rotateFilein interfaceRotationPolicy<FixedTimeLogRotationPolicyCfg>- Parameters:
writer- the file writer to be checked.- Returns:
- true if the log file should be rotated, false otherwise.
-
-