org.opends.server.loggers
Interface RetentionPolicy<T extends LogRetentionPolicyCfg>

Type Parameters:
T - The type of retention policy configuration handled by this retention policy implementation.
All Known Implementing Classes:
FileNumberRetentionPolicy, FreeDiskSpaceRetentionPolicy, SizeBasedRetentionPolicy

public interface RetentionPolicy<T extends LogRetentionPolicyCfg>

This interface describes the retention policy that should be used for the logger. Supported policies include number of files and disk utilization (for Java 6).


Method Summary
 java.io.File[] deleteFiles(FileNamingPolicy fileNamingPolicy)
          Returns all files that should be deleted according to the policy.
 void initializeLogRetentionPolicy(T config)
          Initializes this log retention policy based on the information in the provided retention policy configuration.
 

Method Detail

initializeLogRetentionPolicy

void initializeLogRetentionPolicy(T config)
                                  throws ConfigException,
                                         InitializationException
Initializes this log retention policy based on the information in the provided retention policy configuration.

Parameters:
config - The retention policy configuration that contains the information to use to initialize this policy.
Throws:
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.

deleteFiles

java.io.File[] deleteFiles(FileNamingPolicy fileNamingPolicy)
                           throws DirectoryException
Returns all files that should be deleted according to the policy.

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 null if an error occured while obtaining the file list.
Throws:
DirectoryException - If an error occurs while obtaining a list of files to delete.