public class SizeBasedRotationPolicy extends Object implements RotationPolicy<SizeLimitLogRotationPolicyCfg>, ConfigurationChangeListener<SizeLimitLogRotationPolicyCfg>
Constructor and Description |
---|
SizeBasedRotationPolicy() |
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(SizeLimitLogRotationPolicyCfg config)
Applies the configuration changes to this change listener.
|
void |
initializeLogRotationPolicy(SizeLimitLogRotationPolicyCfg config)
Initializes this log rotation policy based on the
information in the provided rotation policy configuration.
|
boolean |
isConfigurationChangeAcceptable(SizeLimitLogRotationPolicyCfg 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.
|
public SizeBasedRotationPolicy()
public void initializeLogRotationPolicy(SizeLimitLogRotationPolicyCfg config) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
initializeLogRotationPolicy
in interface RotationPolicy<SizeLimitLogRotationPolicyCfg>
config
- The rotation policy configuration that contains the
information to use to initialize this policy.org.forgerock.opendj.config.server.ConfigException
- If an unrecoverable problem arises in the process of
performing the initialization as a result of the server
configuration.InitializationException
- If a problem occurs during initialization that is not
related to the server configuration.public boolean isConfigurationChangeAcceptable(SizeLimitLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<SizeLimitLogRotationPolicyCfg>
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.true
if the proposed change is
acceptable, or false
if it is not.public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(SizeLimitLogRotationPolicyCfg config)
applyConfigurationChange
in interface ConfigurationChangeListener<SizeLimitLogRotationPolicyCfg>
config
- The new configuration containing the changes.public boolean rotateFile(RotatableLogFile writer)
rotateFile
in interface RotationPolicy<SizeLimitLogRotationPolicyCfg>
writer
- The multi file text writer writing the log file.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.