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/quicksetup/org/opends/quicksetup/util/InProcessServerController.java |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
index 8ccbf70..b6337be 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
@@ -27,8 +27,12 @@
 
 package org.opends.quicksetup.util;
 
+import org.opends.messages.Message;
+import org.opends.messages.MessageBuilder;
+import static org.opends.messages.QuickSetupMessages.*;
+
 import org.opends.quicksetup.*;
-import org.opends.quicksetup.i18n.ResourceProvider;
+
 import org.opends.server.loggers.debug.TextDebugLogPublisher;
 import org.opends.server.loggers.debug.DebugLogger;
 import org.opends.server.loggers.TextErrorLogPublisher;
@@ -137,7 +141,7 @@
                      OperationOutput output) {
       LOG.log(Level.INFO, "server start (debug log): " +
               record);
-      output.addDebugMessage(record);
+      output.addDebugMessage(Message.raw(record));
     }};
 
   static private ServerControllerTextWriter errorWriter =
@@ -146,7 +150,7 @@
                      OperationOutput output) {
       LOG.log(Level.INFO, "server start (error log): " +
               record);
-      output.addErrorMessage(record);
+      output.addErrorMessage(Message.raw(record));
     }
   };
 
@@ -156,7 +160,7 @@
                      OperationOutput output) {
       LOG.log(Level.INFO, "server start (access log): " +
               record);
-      output.addAccessMessage(record);
+      output.addAccessMessage(Message.raw(record));
     }
   };
 
@@ -255,7 +259,7 @@
     StandardOutputSuppressor.suppress();
     try {
       DirectoryServer.shutDown(getClass().getName(),
-              "quicksetup requests shutdown");
+              Message.raw("quicksetup requests shutdown")); // TODO: i18n
 
       // Note:  this should not be necessary in the future when a
       // the shutdown method will not return until everything is
@@ -399,10 +403,10 @@
                   modListToString(op.getModifications()));
         } else {
           // report the error to the user
-          StringBuilder error = op.getErrorMessage();
+          MessageBuilder error = op.getErrorMessage();
           throw new ApplicationException(
               ApplicationReturnCode.ReturnCode.IMPORT_ERROR,
-                  getMsg("error-apply-ldif-modify", dnByteString.toString(),
+                  INFO_ERROR_APPLY_LDIF_MODIFY.get(dnByteString.toString(),
                           error != null ? error.toString() : ""),
                   null);
         }
@@ -422,10 +426,10 @@
           LOG.log(Level.INFO, "processed server add " + addOp.getEntryDN());
         } else {
           // report the error to the user
-          StringBuilder error = addOp.getErrorMessage();
+          MessageBuilder error = addOp.getErrorMessage();
           throw new ApplicationException(
               ApplicationReturnCode.ReturnCode.IMPORT_ERROR,
-                  getMsg("error-apply-ldif-add", dnByteString.toString(),
+                  INFO_ERROR_APPLY_LDIF_ADD.get(dnByteString.toString(),
                           error != null ? error.toString() : ""),
                   null);
         }
@@ -439,10 +443,10 @@
                   delOp.getEntryDN());
         } else {
           // report the error to the user
-          StringBuilder error = delOp.getErrorMessage();
+          MessageBuilder error = delOp.getErrorMessage();
           throw new ApplicationException(
               ApplicationReturnCode.ReturnCode.IMPORT_ERROR,
-                  getMsg("error-apply-ldif-delete", dnByteString.toString(),
+                  INFO_ERROR_APPLY_LDIF_DELETE.get(dnByteString.toString(),
                           error != null ? error.toString() : ""),
                   null);
         }
@@ -450,7 +454,7 @@
       default:
         LOG.log(Level.SEVERE, "Unexpected record type " + cre.getClass());
         throw new ApplicationException(ApplicationReturnCode.ReturnCode.BUG,
-                getMsg("bug-msg"),
+                INFO_BUG_MSG.get(),
                 null);
     }
   }
@@ -500,8 +504,4 @@
     AccessLogger.removeAccessLogPublisher(startupAccessPublisher);
   }
 
-  static private String getMsg(String key, String... args) {
-    return ResourceProvider.getInstance().getMsg(key, args);
-  }
-
 }

--
Gitblit v1.10.0