From d75b4421afff1c5999ded2b4c2e62c0b04a3a6d6 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Sat, 09 Jun 2007 15:58:05 +0000
Subject: [PATCH] - [Issue 1768] Invalid fallback behavior for FS Entry Cache - [Issue 1767] Checksum error message on startup - Set eol-style to native

---
 opendj-sdk/opends/src/server/org/opends/server/messages/JebMessages.java            |   10 -----
 opendj-sdk/opends/src/server/org/opends/server/messages/ExtensionsMessages.java     |   31 ++++-----------
 opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java |   29 ++++----------
 opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java        |    6 ---
 4 files changed, 16 insertions(+), 60 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
index 667a514..4efc294 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -238,12 +238,6 @@
       }
     }
 
-    // Log a warning that we have failed to checksum this db environment.
-    int msgID = MSGID_JEB_BACKEND_CHECKSUM_FAIL;
-    String message = getMessage(msgID, cfg.getBackendId());
-    logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.SEVERE_WARNING,
-        message, msgID);
-
     return 0;
   }
 
diff --git a/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java b/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
index 365a1a4..63878b8 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
@@ -305,27 +305,14 @@
       // Log an error message.
       logError(ErrorLogCategory.CONFIGURATION,
           ErrorLogSeverity.SEVERE_ERROR,
-          MSGID_FSCACHE_INVALID_HOME,
-          String.valueOf(configEntryDN), stackTraceToSingleLineString(e),
-          cacheHome, DEFAULT_FSCACHE_HOME);
+          MSGID_FSCACHE_HOMELESS,
+          String.valueOf(configEntryDN), stackTraceToSingleLineString(e));
 
-      // User specified home is no good, reset to default.
-      cacheHome = DEFAULT_FSCACHE_HOME;
-
-      // Try again.
-      try {
-        checkAndSetupCacheHome(cacheHome);
-      } catch (Exception e2) {
-        // Not having any home for the cache db environment at this point is a
-        // fatal error as we are unable to continue any further without it.
-        if (debugEnabled()) {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e2);
-        }
-
-        int msgID = MSGID_FSCACHE_HOMELESS;
-        String message = getMessage(msgID, stackTraceToSingleLineString(e2));
-        throw new InitializationException(msgID, message, e2);
-      }
+      // Not having any home directory for the cache db environment is a
+      // fatal error as we are unable to continue any further without it.
+      int msgID = MSGID_FSCACHE_HOMELESS;
+      String message = getMessage(msgID, stackTraceToSingleLineString(e));
+      throw new InitializationException(msgID, message, e);
     }
 
     // Open JE environment and cache database.
@@ -2268,7 +2255,7 @@
             throw new Exception();
           }
         } catch(Exception e) {
-          // Log an warning that the permissions were not set.
+          // Log a warning that the permissions were not set.
           int msgID = MSGID_FSCACHE_SET_PERMISSIONS_FAILED;
           String message = getMessage(msgID, cacheHome);
           logError(ErrorLogCategory.EXTENSIONS, ErrorLogSeverity.SEVERE_WARNING,
diff --git a/opendj-sdk/opends/src/server/org/opends/server/messages/ExtensionsMessages.java b/opendj-sdk/opends/src/server/org/opends/server/messages/ExtensionsMessages.java
index 31ce6dd..9ad8cf2 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/messages/ExtensionsMessages.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/messages/ExtensionsMessages.java
@@ -5142,29 +5142,19 @@
       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_ERROR | 492;
 
   /**
-   * The message ID for the message that will be used if entry cache home
-   * either cannot be created or exist but already in use by another instance
-   * This takes four arguments, which are the DN of the configuration entry,
-   * the cache-home attribute value of the configuration entry, default cache
-   * home value and a string representation of the exception that was caught.
-   */
-  public static final int MSGID_FSCACHE_INVALID_HOME =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_ERROR | 493;
-
-  /**
    * The message ID for the message that will be used if a fatal error occurs
    * while trying to setup the cache db environment home.  This takes one
    * argument which is a string representation of the exception that was caught.
    */
   public static final int MSGID_FSCACHE_HOMELESS =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_FATAL_ERROR | 494;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_FATAL_ERROR | 493;
 
   /**
    * The message ID of an error indicating that the file permissions for the
    * file system entry cache database directory were not set.
    */
   public static final int MSGID_FSCACHE_SET_PERMISSIONS_FAILED =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_WARNING | 495;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_WARNING | 494;
 
   /**
    * The message ID for the message that will be used if recorded offline state
@@ -5172,7 +5162,7 @@
    * argument which is the backend ID.
    */
   public static final int MSGID_FSCACHE_OFFLINE_STATE_FAIL =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_WARNING | 496;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_WARNING | 495;
 
   /**
    * The message ID for the message that will be used to report the cache
@@ -5181,7 +5171,7 @@
    * restored.
    */
   public static final int MSGID_FSCACHE_RESTORE_PROGRESS_REPORT =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_INFORMATIONAL | 497;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_INFORMATIONAL | 496;
 
   /**
    * The message ID for the message that will be used to report the cache
@@ -5190,7 +5180,7 @@
    * preserved.
    */
   public static final int MSGID_FSCACHE_SAVE_PROGRESS_REPORT =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_INFORMATIONAL | 498;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_INFORMATIONAL | 497;
 
   /**
    * The message ID for the message that will be used if an error occurs while
@@ -5198,7 +5188,7 @@
    * cache. Takes no arguments.
    */
   public static final int MSGID_FSCACHE_INDEX_NOT_FOUND =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_INFORMATIONAL | 499;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_INFORMATIONAL | 498;
 
   /**
    * The message ID for the message that will be used if persistent cache index
@@ -5206,7 +5196,7 @@
    * can detect. Takes no arguments.
    */
   public static final int MSGID_FSCACHE_INDEX_IMPAIRED =
-       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_ERROR | 500;
+       CATEGORY_MASK_EXTENSIONS | SEVERITY_MASK_SEVERE_ERROR | 499;
 
 
 
@@ -7461,15 +7451,10 @@
     registerMessage(MSGID_FSCACHE_CANNOT_INITIALIZE,
                     "A fatal error occurred while trying to initialize file " +
                     "system entry cache. This cache will be disabled now");
-    registerMessage(MSGID_FSCACHE_INVALID_HOME,
-                    "The file system entry cache home specified in entry %s " +
-                    "is invalid:  %s.  The configured location of %s cannot " +
-                    "be used so the server will attempt to use the default " +
-                    "location of %s");
     registerMessage(MSGID_FSCACHE_HOMELESS,
                     "A fatal error occurred while trying to setup file " +
                     "system entry cache home. No suitable path can be found " +
-                    "to host the cache home. This cache will be disabled now");
+                    "to host the cache home");
     registerMessage(MSGID_FSCACHE_SET_PERMISSIONS_FAILED,
                     "Unable to set file permissions for the file system " +
                     "entry cache backend database directory %s");
diff --git a/opendj-sdk/opends/src/server/org/opends/server/messages/JebMessages.java b/opendj-sdk/opends/src/server/org/opends/server/messages/JebMessages.java
index 1f3061d..a675821 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/messages/JebMessages.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/messages/JebMessages.java
@@ -1157,13 +1157,6 @@
   public static final int MSGID_JEB_UNABLE_SET_PERMISSIONS =
       CATEGORY_MASK_JEB | SEVERITY_MASK_SEVERE_WARNING | 146;
 
-  /**
-   * The message ID to use when we have failed to checksum db environment.
-   * This takes one argument which is the backend ID.
-   */
-  public static final int MSGID_JEB_BACKEND_CHECKSUM_FAIL =
-      CATEGORY_MASK_JEB | SEVERITY_MASK_SEVERE_WARNING | 147;
-
 
   /**
    * Associates a set of generic messages with the message IDs defined in this
@@ -1474,9 +1467,6 @@
     registerMessage(MSGID_JEB_REBUILD_BACKEND_ONLINE,
                     "Rebuilding system index(es) must be done with the " +
                     "backend containing the base DN disabled");
-    registerMessage(MSGID_JEB_BACKEND_CHECKSUM_FAIL,
-                    "Failed to checksum the database environment for " +
-                    "backend %s");
     registerMessage(MSGID_ENTRYIDSORTER_CANNOT_EXAMINE_ENTRY,
                     "Unable to examine the entry with ID %s for sorting " +
                     "purposes:  %s");

--
Gitblit v1.10.0