Package org.opends.server.loggers
Class SizeBasedRetentionPolicy
- java.lang.Object
-
- org.opends.server.loggers.SizeBasedRetentionPolicy
-
- All Implemented Interfaces:
ConfigurationChangeListener<SizeLimitLogRetentionPolicyCfg>,RetentionPolicy<SizeLimitLogRetentionPolicyCfg>
public final class SizeBasedRetentionPolicy extends Object implements RetentionPolicy<SizeLimitLogRetentionPolicyCfg>, ConfigurationChangeListener<SizeLimitLogRetentionPolicyCfg>
This class implements a retention policy based on the amount of space taken by the log files.
-
-
Constructor Summary
Constructors Constructor Description SizeBasedRetentionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(SizeLimitLogRetentionPolicyCfg config)Applies the configuration changes to this change listener.Path[]deleteFiles(org.opends.server.loggers.FileNamingPolicy fileNamingPolicy)Returns all files that should be deleted according to the policy.voidinitializeLogRetentionPolicy(SizeLimitLogRetentionPolicyCfg config)Initializes this log retention policy based on the information in the provided retention policy configuration.booleanisConfigurationChangeAcceptable(SizeLimitLogRetentionPolicyCfg config, List<LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.StringtoString()
-
-
-
Method Detail
-
initializeLogRetentionPolicy
public void initializeLogRetentionPolicy(SizeLimitLogRetentionPolicyCfg config)
Description copied from interface:RetentionPolicyInitializes this log retention policy based on the information in the provided retention policy configuration.- Specified by:
initializeLogRetentionPolicyin interfaceRetentionPolicy<SizeLimitLogRetentionPolicyCfg>- Parameters:
config- The retention policy configuration that contains the information to use to initialize this policy.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(SizeLimitLogRetentionPolicyCfg 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<SizeLimitLogRetentionPolicyCfg>- 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(SizeLimitLogRetentionPolicyCfg config)
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<SizeLimitLogRetentionPolicyCfg>- Parameters:
config- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
deleteFiles
public Path[] deleteFiles(org.opends.server.loggers.FileNamingPolicy fileNamingPolicy) throws IOException
Description copied from interface:RetentionPolicyReturns all files that should be deleted according to the policy.- Specified by:
deleteFilesin interfaceRetentionPolicy<SizeLimitLogRetentionPolicyCfg>- Parameters:
fileNamingPolicy- The naming policy used generate the log file names.- Returns:
- An array of files that should be deleted according to the policy or
nullif an error occurred while obtaining the file list. - Throws:
IOException- If an error occurs while obtaining a list of files to delete.
-
-