From 7ba39a6c06cd5ff7ae7ab0295a11f49703a6e859 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 09 Aug 2007 19:57:53 +0000
Subject: [PATCH] Fix for issue 2066. Changed constants to use the small case and dash format from the admin framework.

---
 opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java |    8 ++--
 opends/build.xml                                                             |    2 
 opends/src/server/org/opends/server/backends/jeb/EntryContainer.java         |   11 +++++
 opends/src/server/org/opends/server/loggers/debug/TraceSettings.java         |    8 ++--
 opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java          |    5 ++
 opends/src/server/org/opends/server/loggers/TextErrorLogPublisher.java       |    8 ++--
 opends/src/server/org/opends/server/util/ServerConstants.java                |   76 +++++++++++++++++++-------------------
 7 files changed, 67 insertions(+), 51 deletions(-)

diff --git a/opends/build.xml b/opends/build.xml
index dac7586..edbe8b4 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -1278,7 +1278,7 @@
     <!-- This sets org.opends.test.debug.target if and only if its's not
          already set. -->
     <condition property="org.opends.test.debug.target"
-               value="org.opends.server:level=warning,category=caught|data|database_access|message|protocol">
+               value="org.opends.server:level=warning,category=caught|data|database-access|message|protocol">
       <not>
         <isset property="org.opends.test.debug.target" />
       </not>
diff --git a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
index 6e9bfe8..f66a598 100644
--- a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
+++ b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -614,6 +614,17 @@
   }
 
   /**
+   * Get the state database used by this entry container.
+   * The entry container must have been opened.
+   *
+   * @return The state database.
+   */
+  public State getState()
+  {
+    return state;
+  }
+
+  /**
    * Look for an attribute index for the given attribute type.
    *
    * @param attrType The attribute type for which an attribute index is needed.
diff --git a/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java b/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java
index 138db7f..1185f4e 100644
--- a/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java
+++ b/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java
@@ -629,6 +629,11 @@
       }
     }
 
+    if(id2entry == null)
+    {
+      return new byte[0];
+    }
+
     // Get the entry from id2entry and assign the values from the entry.
     // Once the values are assigned from the retrieved entry, it will
     // not be retrieve again from future compares.
diff --git a/opends/src/server/org/opends/server/loggers/TextErrorLogPublisher.java b/opends/src/server/org/opends/server/loggers/TextErrorLogPublisher.java
index 7209bc8..09fe163 100644
--- a/opends/src/server/org/opends/server/loggers/TextErrorLogPublisher.java
+++ b/opends/src/server/org/opends/server/loggers/TextErrorLogPublisher.java
@@ -186,7 +186,7 @@
     {
       for(ErrorLogPublisherCfgDefn.DefaultSeverity defSev : defSevs)
       {
-        if(defSev.name().equalsIgnoreCase(LOG_SEVERITY_ALL))
+        if(defSev.toString().equalsIgnoreCase(LOG_SEVERITY_ALL))
         {
           defaultSeverities.add(ErrorLogSeverity.FATAL_ERROR);
           defaultSeverities.add(ErrorLogSeverity.INFORMATIONAL);
@@ -199,7 +199,7 @@
         else
         {
           ErrorLogSeverity errorSeverity =
-              ErrorLogSeverity.getByName(defSev.name());
+              ErrorLogSeverity.getByName(defSev.toString());
           if(errorSeverity != null)
           {
             defaultSeverities.add(errorSeverity);
@@ -418,7 +418,7 @@
     {
       for(ErrorLogPublisherCfgDefn.DefaultSeverity defSev : defSevs)
       {
-        if(defSev.name().equalsIgnoreCase(LOG_SEVERITY_ALL))
+        if(defSev.toString().equalsIgnoreCase(LOG_SEVERITY_ALL))
         {
           defaultSeverities.add(ErrorLogSeverity.FATAL_ERROR);
           defaultSeverities.add(ErrorLogSeverity.INFORMATIONAL);
@@ -431,7 +431,7 @@
         else
         {
           ErrorLogSeverity errorSeverity =
-              ErrorLogSeverity.getByName(defSev.name());
+              ErrorLogSeverity.getByName(defSev.toString());
           if(errorSeverity != null)
           {
             defaultSeverities.add(errorSeverity);
diff --git a/opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java b/opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java
index 637b741..c9bfaa3 100644
--- a/opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java
+++ b/opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java
@@ -217,7 +217,7 @@
 
     //Get the default/global settings
     LogLevel logLevel =
-        DebugLogLevel.parse(config.getDefaultDebugLevel().name());
+        DebugLogLevel.parse(config.getDefaultDebugLevel().toString());
     Set<LogCategory> logCategories = null;
     if(!config.getDefaultDebugCategory().isEmpty())
     {
@@ -226,7 +226,7 @@
       for(DebugLogPublisherCfgDefn.DefaultDebugCategory category :
           config.getDefaultDebugCategory())
       {
-        logCategories.add(DebugLogCategory.parse(category.name()));
+        logCategories.add(DebugLogCategory.parse(category.toString()));
       }
     }
 
@@ -340,7 +340,7 @@
 
     //Get the default/global settings
     LogLevel logLevel =
-        DebugLogLevel.parse(config.getDefaultDebugLevel().name());
+        DebugLogLevel.parse(config.getDefaultDebugLevel().toString());
     Set<LogCategory> logCategories = null;
     if(!config.getDefaultDebugCategory().isEmpty())
     {
@@ -349,7 +349,7 @@
       for(DebugLogPublisherCfgDefn.DefaultDebugCategory category :
           config.getDefaultDebugCategory())
       {
-        logCategories.add(DebugLogCategory.parse(category.name()));
+        logCategories.add(DebugLogCategory.parse(category.toString()));
       }
     }
 
diff --git a/opends/src/server/org/opends/server/loggers/debug/TraceSettings.java b/opends/src/server/org/opends/server/loggers/debug/TraceSettings.java
index dad93de..bfbd4d8 100644
--- a/opends/src/server/org/opends/server/loggers/debug/TraceSettings.java
+++ b/opends/src/server/org/opends/server/loggers/debug/TraceSettings.java
@@ -166,7 +166,7 @@
   public TraceSettings(DebugTargetCfg config)
   {
     this.level =
-        DebugLogLevel.parse(config.getDebugLevel().name());
+        DebugLogLevel.parse(config.getDebugLevel().toString());
 
     Set<LogCategory> logCategories = null;
     if(!config.getDebugCategory().isEmpty())
@@ -176,7 +176,7 @@
       for(DebugTargetCfgDefn.DebugCategory category :
           config.getDebugCategory())
       {
-        logCategories.add(DebugLogCategory.parse(category.name()));
+        logCategories.add(DebugLogCategory.parse(category.toString()));
       }
     }
 
@@ -215,7 +215,7 @@
     // naming attribute. Changing it would result in a modify DN.
 
     this.level =
-        DebugLogLevel.parse(config.getDebugLevel().name());
+        DebugLogLevel.parse(config.getDebugLevel().toString());
 
     Set<LogCategory> logCategories = null;
     if(!config.getDebugCategory().isEmpty())
@@ -225,7 +225,7 @@
       for(DebugTargetCfgDefn.DebugCategory category :
           config.getDebugCategory())
       {
-        logCategories.add(DebugLogCategory.parse(category.name()));
+        logCategories.add(DebugLogCategory.parse(category.toString()));
       }
     }
 
diff --git a/opends/src/server/org/opends/server/util/ServerConstants.java b/opends/src/server/org/opends/server/util/ServerConstants.java
index 6a54295..796a313 100644
--- a/opends/src/server/org/opends/server/util/ServerConstants.java
+++ b/opends/src/server/org/opends/server/util/ServerConstants.java
@@ -888,7 +888,7 @@
    * The English name for the basic disabled log severity used for all
    * log severities.
    */
-  public static final String LOG_SEVERITY_DISABLED = "DISABLED";
+  public static final String LOG_SEVERITY_DISABLED = "disabled";
 
 
 
@@ -896,7 +896,7 @@
    * The English name for the basic all log severity used for all log
    * severities.
    */
-  public static final String LOG_SEVERITY_ALL = "ALL";
+  public static final String LOG_SEVERITY_ALL = "all";
 
 
 
@@ -904,14 +904,14 @@
    * The English name for the debug log category used for access control
    * debugging.
    */
-  public static final String DEBUG_CATEGORY_MESSAGE = "MESSAGE";
+  public static final String DEBUG_CATEGORY_MESSAGE = "message";
 
 
 
   /**
    * The English name for the debug log category used for constructor debugging.
    */
-  public static final String DEBUG_CATEGORY_CONSTRUCTOR = "CONSTRUCTOR";
+  public static final String DEBUG_CATEGORY_CONSTRUCTOR = "constructor";
 
 
 
@@ -919,21 +919,21 @@
    * The English name for the debug log category used for debugging raw data
    * read.
    */
-  public static final String DEBUG_CATEGORY_DATA = "DATA";
+  public static final String DEBUG_CATEGORY_DATA = "data";
 
 
 
   /**
    * The English name for the debug log category used for exception debugging.
    */
-  public static final String DEBUG_CATEGORY_THROWN = "THROWN";
+  public static final String DEBUG_CATEGORY_THROWN = "thrown";
 
 
 
   /**
    * The English name for the debug log category used for exception debugging.
    */
-  public static final String DEBUG_CATEGORY_CAUGHT = "CAUGHT";
+  public static final String DEBUG_CATEGORY_CAUGHT = "caught";
 
 
 
@@ -941,7 +941,7 @@
    * The English name for the debug log category used for method entry
    * debugging.
    */
-  public static final String DEBUG_CATEGORY_ENTER = "ENTER";
+  public static final String DEBUG_CATEGORY_ENTER = "enter";
 
 
 
@@ -949,7 +949,7 @@
    * The English name for the debug log category used for method exit
    * debugging.
    */
-  public static final String DEBUG_CATEGORY_EXIT = "EXIT";
+  public static final String DEBUG_CATEGORY_EXIT = "exit";
 
 
 
@@ -957,7 +957,7 @@
    * The English name for the debug log category used for debugging protocol
    * elements.
    */
-  public static final String DEBUG_CATEGORY_PROTOCOL = "PROTOCOL";
+  public static final String DEBUG_CATEGORY_PROTOCOL = "protocol";
 
 
 
@@ -965,14 +965,14 @@
    * The English name for the debug log category used for raw data access
    * from the JE database.
    */
-  public static final String DEBUG_CATEGORY_DATABASE_ACCESS = "DATABASE_ACCESS";
+  public static final String DEBUG_CATEGORY_DATABASE_ACCESS = "database-access";
 
 
 
   /**
    * The English name for the debug log severity used for verbose messages.
    */
-  public static final String DEBUG_SEVERITY_VERBOSE = "VERBOSE";
+  public static final String DEBUG_SEVERITY_VERBOSE = "verbose";
 
 
 
@@ -980,21 +980,21 @@
    * The English name for the debug log severity used for informational
    * messages.
    */
-  public static final String DEBUG_SEVERITY_INFO = "INFO";
+  public static final String DEBUG_SEVERITY_INFO = "info";
 
 
 
   /**
    * The English name for the debug log severity used for warning messages.
    */
-  public static final String DEBUG_SEVERITY_WARNING = "WARNING";
+  public static final String DEBUG_SEVERITY_WARNING = "warning";
 
 
 
   /**
    * The English name for the debug log severity used for error messages.
    */
-  public static final String DEBUG_SEVERITY_ERROR = "ERROR";
+  public static final String DEBUG_SEVERITY_ERROR = "error";
 
 
 
@@ -1002,14 +1002,14 @@
    * The English name for the error log category used for access control
    * processing.
    */
-  public static final String ERROR_CATEGORY_ACCESS_CONTROL = "ACCESS_CONTROL";
+  public static final String ERROR_CATEGORY_ACCESS_CONTROL = "access-control";
 
 
 
   /**
    * The English name for the error log category used for backend processing.
    */
-  public static final String ERROR_CATEGORY_BACKEND = "BACKEND";
+  public static final String ERROR_CATEGORY_BACKEND = "backend";
 
 
 
@@ -1017,7 +1017,7 @@
    * The English name for the error log category used for configuration
    * processing.
    */
-  public static final String ERROR_CATEGORY_CONFIG = "CONFIG";
+  public static final String ERROR_CATEGORY_CONFIG = "config";
 
 
 
@@ -1025,7 +1025,7 @@
    * The English name for the error log category used for client connection
    * handling.
    */
-  public static final String ERROR_CATEGORY_CONNECTION_HANDLING = "CONNECTION";
+  public static final String ERROR_CATEGORY_CONNECTION_HANDLING = "connection";
 
 
 
@@ -1033,14 +1033,14 @@
    * The English name for the error log category used for core server
    * processing.
    */
-  public static final String ERROR_CATEGORY_CORE_SERVER = "CORE";
+  public static final String ERROR_CATEGORY_CORE_SERVER = "core";
 
 
   /**
    * The English name for the error log category used for extended operation
    * processing.
    */
-  public static final String ERROR_CATEGORY_EXTENDED_OPERATION = "EXTENDED_OP";
+  public static final String ERROR_CATEGORY_EXTENDED_OPERATION = "extended-op";
 
 
 
@@ -1048,7 +1048,7 @@
    * The English name for the error log category used for server extension
    * processing.
    */
-  public static final String ERROR_CATEGORY_EXTENSIONS = "EXTENTIONS";
+  public static final String ERROR_CATEGORY_EXTENSIONS = "extensions";
 
 
 
@@ -1056,49 +1056,49 @@
    * The English name for the error log category used for password policy
    * processing.
    */
-  public static final String ERROR_CATEGORY_PASSWORD_POLICY = "PW_POLICY";
+  public static final String ERROR_CATEGORY_PASSWORD_POLICY = "pw-policy";
 
 
 
   /**
    * The English name for the error log category used for plugin processing.
    */
-  public static final String ERROR_CATEGORY_PLUGIN = "PLUGIN";
+  public static final String ERROR_CATEGORY_PLUGIN = "plugin";
 
 
 
   /**
    * The English name for the error log category used for request handling.
    */
-  public static final String ERROR_CATEGORY_REQUEST = "REQUEST";
+  public static final String ERROR_CATEGORY_REQUEST = "request";
 
 
 
   /**
    * The English name for the error log category used for SASL processing.
    */
-  public static final String ERROR_CATEGORY_SASL_MECHANISM = "SASL";
+  public static final String ERROR_CATEGORY_SASL_MECHANISM = "sasl";
 
 
 
   /**
    * The English name for the error log category used for schema processing.
    */
-  public static final String ERROR_CATEGORY_SCHEMA = "SCHEMA";
+  public static final String ERROR_CATEGORY_SCHEMA = "schema";
 
 
 
   /**
    * The English name for the error log category used for shutdown processing.
    */
-  public static final String ERROR_CATEGORY_SHUTDOWN = "SHUTDOWN";
+  public static final String ERROR_CATEGORY_SHUTDOWN = "shutdown";
 
 
 
   /**
    * The English name for the error log category used for startup processing.
    */
-  public static final String ERROR_CATEGORY_STARTUP = "STARTUP";
+  public static final String ERROR_CATEGORY_STARTUP = "startup";
 
 
 
@@ -1106,21 +1106,21 @@
    * The English name for the error log category used for synchronization
    * processing.
    */
-  public static final String ERROR_CATEGORY_SYNCHRONIZATION = "SYNC";
+  public static final String ERROR_CATEGORY_SYNCHRONIZATION = "sync";
 
 
 
   /**
    * The English name for the error log category used for task processing.
    */
-  public static final String ERROR_CATEGORY_TASK = "TASK";
+  public static final String ERROR_CATEGORY_TASK = "task";
 
 
 
   /**
    * The English name for the error log severity used for fatal error messages.
    */
-  public static final String ERROR_SEVERITY_FATAL = "FATAL_ERROR";
+  public static final String ERROR_SEVERITY_FATAL = "fatal-error";
 
 
 
@@ -1128,21 +1128,21 @@
    * The English name for the error log severity used for informational
    * messages.
    */
-  public static final String ERROR_SEVERITY_INFORMATIONAL = "INFO";
+  public static final String ERROR_SEVERITY_INFORMATIONAL = "info";
 
 
 
   /**
    * The English name for the error log severity used for mild error messages.
    */
-  public static final String ERROR_SEVERITY_MILD_ERROR = "MILD_ERROR";
+  public static final String ERROR_SEVERITY_MILD_ERROR = "mild-error";
 
 
 
   /**
    * The English name for the error log severity used for mild warning messages.
    */
-  public static final String ERROR_SEVERITY_MILD_WARNING = "MILD_WARNING";
+  public static final String ERROR_SEVERITY_MILD_WARNING = "mild-warning";
 
 
 
@@ -1150,14 +1150,14 @@
    * The English name for the error log severity used for important
    * informational messages.
    */
-  public static final String ERROR_SEVERITY_NOTICE = "NOTICE";
+  public static final String ERROR_SEVERITY_NOTICE = "notice";
 
 
 
   /**
    * The English name for the error log severity used for severe error messages.
    */
-  public static final String ERROR_SEVERITY_SEVERE_ERROR = "SEVERE_ERROR";
+  public static final String ERROR_SEVERITY_SEVERE_ERROR = "severe-error";
 
 
 
@@ -1165,7 +1165,7 @@
    * The English name for the error log severity used for severe warning
    * messages.
    */
-  public static final String ERROR_SEVERITY_SEVERE_WARNING = "SEVERE_WARNING";
+  public static final String ERROR_SEVERITY_SEVERE_WARNING = "severe-warning";
 
 
 

--
Gitblit v1.10.0