From f1c38c624c1b8046bd03a746c4537fd7a555f6bb Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 24 Jan 2008 17:19:15 +0000
Subject: [PATCH] Improved error handling in logger retention policy enforcement. The rotater thread will now handle exceptions rasied during rotation and/or retention runs.

---
 opendj-sdk/opends/src/server/org/opends/server/loggers/RetentionPolicy.java |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/loggers/RetentionPolicy.java b/opendj-sdk/opends/src/server/org/opends/server/loggers/RetentionPolicy.java
index c486899..867600e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/loggers/RetentionPolicy.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/loggers/RetentionPolicy.java
@@ -22,14 +22,16 @@
  * CDDL HEADER END
  *
  *
- *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
+ *      Portions Copyright 2006-2008 Sun Microsystems, Inc.
  */
 package org.opends.server.loggers;
 
 import org.opends.server.admin.std.server.LogRetentionPolicyCfg;
 import org.opends.server.config.ConfigException;
 import org.opends.server.types.InitializationException;
+import org.opends.server.types.DirectoryException;
 
+import java.io.File;
 
 /**
  * This interface describes the retention policy that should be used
@@ -60,14 +62,18 @@
       throws ConfigException, InitializationException;
 
   /**
-   * This method checks for whether files should be deleted or not.
+   * Returns all files that should be deleted according to the policy.
    *
-   * @param writer The multi file writer writing the files to be
-   *        checked.
+   * @param fileNamingPolicy The naming policy used generate the log file
+   *                         names.
    *
-   * @return number of files deleted, if any.
+   * @return An array of files that should be deleted according to the
+   *         policy or <code>null</code> if an error occured while
+   *         obtaining the file list.
+   * @throws DirectoryException If an error occurs while obtaining a list
+   *                            of files to delete.
    */
-  public int deleteFiles(MultifileTextWriter writer);
-
+  public File[] deleteFiles(FileNamingPolicy fileNamingPolicy)
+      throws DirectoryException;
 }
 

--
Gitblit v1.10.0