From 7fa3260d1b3d3902f71f98392b1f8cf0483bc941 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Wed, 01 Aug 2007 09:40:28 +0000
Subject: [PATCH] Use DsframeworkReturnCode enum in a more 'classical' way

---
 opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java b/opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java
index 247cdc0..0aca974 100644
--- a/opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java
+++ b/opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliGlobalAdmin.java
@@ -48,7 +48,6 @@
 import org.opends.admin.ads.ADSContextException;
 import org.opends.admin.ads.ADSContext.AdministratorProperty;
 import org.opends.admin.ads.ADSContextException.ErrorType;
-import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.ReturnCode;
 import org.opends.server.tools.dsconfig.ArgumentExceptionFactory;
 import org.opends.server.util.args.Argument;
 import org.opends.server.util.args.ArgumentException;
@@ -58,6 +57,7 @@
 import org.opends.server.util.table.TableBuilder;
 import org.opends.server.util.table.TextTablePrinter;
 
+import static org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.*;
 /**
  * This class is handling user Admin CLI.
  */
@@ -414,14 +414,14 @@
   /**
    * {@inheritDoc}
    */
-  public ReturnCode performSubCommand(SubCommand subCmd,
+  public DsFrameworkCliReturnCode performSubCommand(SubCommand subCmd,
       OutputStream outStream, OutputStream errStream)
       throws ADSContextException, ArgumentException
   {
 
     ADSContext adsCtx = null;
     InitialLdapContext ctx = null;
-    ReturnCode returnCode = ReturnCode.ERROR_UNEXPECTED;
+    DsFrameworkCliReturnCode returnCode = ERROR_UNEXPECTED;
 
     try
     {
@@ -438,12 +438,12 @@
         ctx = argParser.getContext(outStream, errStream);
         if (ctx == null)
         {
-          return ReturnCode.CANNOT_CONNECT_TO_ADS;
+          return CANNOT_CONNECT_TO_ADS;
         }
         adsCtx = new ADSContext(ctx);
         adsCtx.createAdministrator(map);
 
-        returnCode = ReturnCode.SUCCESSFUL;
+        returnCode = SUCCESSFUL;
       }
       else
       // -----------------------
@@ -459,12 +459,12 @@
         ctx = argParser.getContext(outStream, errStream);
         if (ctx == null)
         {
-          return ReturnCode.CANNOT_CONNECT_TO_ADS;
+          return CANNOT_CONNECT_TO_ADS;
         }
         adsCtx = new ADSContext(ctx);
         adsCtx.deleteAdministrator(map);
 
-        returnCode = ReturnCode.SUCCESSFUL;
+        returnCode = SUCCESSFUL;
       }
       else
       // -----------------------
@@ -475,7 +475,7 @@
         ctx = argParser.getContext(outStream, errStream);
         if (ctx == null)
         {
-          return ReturnCode.CANNOT_CONNECT_TO_ADS;
+          return CANNOT_CONNECT_TO_ADS;
         }
         adsCtx = new ADSContext(ctx);
         Set<Map<AdministratorProperty, Object>> adminUserList = adsCtx
@@ -488,7 +488,7 @@
           out.println(AdministratorProperty.UID.getAttributeName() + ": "
               + user.get(AdministratorProperty.UID));
         }
-        returnCode = ReturnCode.SUCCESSFUL;
+        returnCode = SUCCESSFUL;
       }
       else
       // -----------------------
@@ -499,7 +499,7 @@
         ctx = argParser.getContext(outStream, errStream);
         if (ctx == null)
         {
-          return ReturnCode.CANNOT_CONNECT_TO_ADS;
+          return CANNOT_CONNECT_TO_ADS;
         }
         adsCtx = new ADSContext(ctx);
         Set<Map<AdministratorProperty, Object>> adsAdminUserList = adsCtx
@@ -529,7 +529,7 @@
           }
           out.println();
         }
-        returnCode = ReturnCode.SUCCESSFUL;
+        returnCode = SUCCESSFUL;
       }
       else
       // -----------------------
@@ -551,11 +551,11 @@
         ctx = argParser.getContext(outStream, errStream);
         if (ctx == null)
         {
-          return ReturnCode.CANNOT_CONNECT_TO_ADS;
+          return CANNOT_CONNECT_TO_ADS;
         }
         adsCtx = new ADSContext(ctx);
         adsCtx.updateAdministrator(map, newServerId);
-        returnCode = ReturnCode.SUCCESSFUL;
+        returnCode = SUCCESSFUL;
       }
       else
       // -----------------------
@@ -605,7 +605,7 @@
         }
         TextTablePrinter printer = new TextTablePrinter(outStream);
         table.print(printer);
-        returnCode = ReturnCode.SUCCESSFUL;
+        returnCode = SUCCESSFUL;
       }
       // -----------------------
       // ERROR

--
Gitblit v1.10.0