From cfc513043c5830b5a967733066068c7097b42e3c Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.

---
 opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java
index a706310..0a4f630 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java
@@ -25,10 +25,11 @@
  *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.replication.server;
+import org.opends.messages.Message;
+import org.opends.messages.MessageBuilder;
 
 import static org.opends.server.loggers.ErrorLogger.logError;
-import static org.opends.server.messages.MessageHandler.getMessage;
-import static org.opends.server.messages.ReplicationMessages.*;
+import static org.opends.messages.ReplicationMessages.*;
 import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
 
 import java.io.File;
@@ -36,8 +37,6 @@
 
 import org.opends.server.types.DN;
 import org.opends.server.types.DirectoryException;
-import org.opends.server.types.ErrorLogCategory;
-import org.opends.server.types.ErrorLogSeverity;
 
 import com.sleepycat.je.Cursor;
 import com.sleepycat.je.Database;
@@ -134,11 +133,9 @@
             baseDn = DN.decode(str[1]);
           } catch (DirectoryException e)
           {
-            int    msgID   = MSGID_IGNORE_BAD_DN_IN_DATABASE_IDENTIFIER;
-            String message = getMessage(msgID, str[1]);
-            logError(ErrorLogCategory.SYNCHRONIZATION,
-                     ErrorLogSeverity.SEVERE_ERROR,
-                     message, msgID);
+            Message message =
+                ERR_IGNORE_BAD_DN_IN_DATABASE_IDENTIFIER.get(str[1]);
+            logError(message);
           }
           DbHandler dbHandler =
             new DbHandler(serverId, baseDn, replicationServer, this);
@@ -147,12 +144,15 @@
         } catch (NumberFormatException e)
         {
           // should never happen
-          throw new ReplicationDBException(0,
-              "replicationServer state database has a wrong format");
+          // TODO: i18n
+          throw new ReplicationDBException(Message.raw(
+              "replicationServer state database has a wrong format"));
         } catch (UnsupportedEncodingException e)
         {
           // should never happens
-          throw new ReplicationDBException(0, "need UTF-8 support");
+          // TODO: i18n
+          throw new ReplicationDBException(Message.raw(
+                  "need UTF-8 support"));
         }
         status = cursor.getNext(key, data, LockMode.DEFAULT);
       }
@@ -236,11 +236,10 @@
       dbEnvironment.close();
     } catch (DatabaseException e)
     {
-      int    msgID   = MSGID_ERROR_CLOSING_CHANGELOG_ENV;
-      String message = getMessage(msgID) + stackTraceToSingleLineString(e);
-      logError(ErrorLogCategory.SYNCHRONIZATION,
-               ErrorLogSeverity.SEVERE_ERROR,
-               message, msgID);
+      MessageBuilder mb = new MessageBuilder();
+      mb.append(ERR_ERROR_CLOSING_CHANGELOG_ENV.get());
+      mb.append(stackTraceToSingleLineString(e));
+      logError(mb.toMessage());
     }
   }
 

--
Gitblit v1.10.0