From c37b0d815d222d000d2a220e929b488ecff665c3 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Fri, 14 Feb 2014 15:29:34 +0000
Subject: [PATCH]
---
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/ArgumentExceptionFactory.java | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/ArgumentExceptionFactory.java b/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/ArgumentExceptionFactory.java
index 748787a..4c2d579 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/ArgumentExceptionFactory.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/ArgumentExceptionFactory.java
@@ -41,9 +41,12 @@
import org.opends.server.admin.client.ManagedObjectDecodingException;
import org.opends.server.admin.client.MissingMandatoryPropertiesException;
import org.opends.server.admin.client.OperationRejectedException;
+
import com.forgerock.opendj.cli.Argument;
import com.forgerock.opendj.cli.ArgumentException;
-import com.forgerock.opendj.cli.CLIException;
+import com.forgerock.opendj.cli.ClientException;
+import com.forgerock.opendj.cli.ReturnCode;
+
import org.opends.server.util.cli.ConsoleApplication;
import org.opends.server.util.table.TableBuilder;
import org.opends.server.util.table.TextTablePrinter;
@@ -57,16 +60,16 @@
public final class ArgumentExceptionFactory {
/**
- * Creates a CLI exception from an illegal managed object name
+ * Creates a ClientException exception from an illegal managed object name
* exception.
*
* @param e
* The illegal managed object name exception.
* @param d
* The managed object definition.
- * @return Returns a CLI exception.
+ * @return Returns a ClientException exception.
*/
- public static CLIException adaptIllegalManagedObjectNameException(
+ public static ClientException adaptIllegalManagedObjectNameException(
IllegalManagedObjectNameException e,
AbstractManagedObjectDefinition<?, ?> d) {
String illegalName = e.getIllegalName();
@@ -75,11 +78,11 @@
if (illegalName.length() == 0) {
LocalizableMessage message =
ERR_DSCFG_ERROR_ILLEGAL_NAME_EMPTY.get(d.getUserFriendlyPluralName());
- return new CLIException(message);
+ return new ClientException(ReturnCode.ERROR_USER_DATA, message);
} else if (illegalName.trim().length() == 0) {
LocalizableMessage message =
ERR_DSCFG_ERROR_ILLEGAL_NAME_BLANK.get(d.getUserFriendlyPluralName());
- return new CLIException(message);
+ return new ClientException(ReturnCode.ERROR_USER_DATA, message);
} else if (pd != null) {
try {
pd.decodeValue(illegalName);
@@ -90,13 +93,13 @@
LocalizableMessage message = ERR_DSCFG_ERROR_ILLEGAL_NAME_SYNTAX.get(
illegalName, d.getUserFriendlyName(), syntax);
- return new CLIException(message);
+ return new ClientException(ReturnCode.ERROR_USER_DATA, message);
}
}
LocalizableMessage message = ERR_DSCFG_ERROR_ILLEGAL_NAME_UNKNOWN.get(
illegalName, d.getUserFriendlyName());
- return new CLIException(message);
+ return new ClientException(ReturnCode.ERROR_USER_DATA, message);
}
@@ -640,13 +643,13 @@
* The definition of the managed object that was retrieved.
*
* @param subcommandName the sub-command name.
- * @return Returns a CLI exception.
+ * @return Returns a Client exception.
*/
- public static CLIException wrongManagedObjectType(RelationDefinition<?, ?> r,
+ public static ClientException wrongManagedObjectType(RelationDefinition<?, ?> r,
ManagedObjectDefinition<?, ?> d, String subcommandName) {
LocalizableMessage msg = ERR_DSCFG_ERROR_TYPE_UNRECOGNIZED_FOR_SUBCOMMAND.get(
d.getUserFriendlyName(), subcommandName);
- return new CLIException(msg);
+ return new ClientException(ReturnCode.ERROR_USER_DATA, msg);
}
--
Gitblit v1.10.0