Fix for issue #3852 : dsconfig : in interactive mode, should not exit if parent component does not exist
| | |
| | | INFO_DSCFG_FINDER_PROMPT_SINGLE_1232=>>>> There is only one %s: "%s". Are you sure \ |
| | | that this is the correct one? |
| | | INFO_DSCFG_FINDER_PROMPT_MANY_1233=>>>> Select the %s from the following list: |
| | | SEVERE_ERR_DSCFG_ERROR_FINDER_NO_CHILDREN_NULL_1234=Unable to continue since there \ |
| | | is no such an object currently configured on the server |
| | | INFO_DSCFG_GENERAL_CHOICE_PROMPT_NOHELP_1237=Enter choice [1 - %d]: |
| | | INFO_DSCFG_GENERAL_CHOICE_PROMPT_HELP_1238=Enter choice [1 - %d, ? - help]: |
| | | SEVERE_ERR_DSCFG_ERROR_GENERAL_CHOICE_1239=Invalid response. Please enter a \ |
| | |
| | | if (!forceArgument.isPresent()) { |
| | | Message pufn = path.getManagedObjectDefinition().getUserFriendlyName(); |
| | | Message msg = ERR_DSCFG_ERROR_GET_PARENT_MONFE.get(pufn); |
| | | throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg); |
| | | if (app.isInteractive()) { |
| | | app.println(); |
| | | app.printVerboseMessage(msg); |
| | | return MenuResult.cancel(); |
| | | } else { |
| | | throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg); |
| | | } |
| | | } else { |
| | | return MenuResult.success(0); |
| | | } |
| | |
| | | } catch (ManagedObjectNotFoundException e) { |
| | | ufn = path.getManagedObjectDefinition().getUserFriendlyName(); |
| | | Message msg = ERR_DSCFG_ERROR_GET_PARENT_MONFE.get(ufn); |
| | | throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg); |
| | | if (app.isInteractive()) { |
| | | app.println(); |
| | | app.printVerboseMessage(msg); |
| | | return MenuResult.cancel(); |
| | | } else { |
| | | throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg); |
| | | } |
| | | } |
| | | |
| | | if (result.isQuit()) { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools.dsconfig; |
| | | |
| | |
| | | Message pufn = path.getManagedObjectDefinition() |
| | | .getUserFriendlyName(); |
| | | Message msg = ERR_DSCFG_ERROR_GET_PARENT_MONFE.get(pufn); |
| | | throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg); |
| | | if (app.isInteractive()) { |
| | | app.println(); |
| | | app.printVerboseMessage(msg); |
| | | return MenuResult.cancel(); |
| | | } else { |
| | | throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg); |
| | | } |
| | | } |
| | | |
| | | // Now let the user create the child component. |
| | |
| | | Message msg = ERR_DSCFG_ERROR_MODIFY_CME.get(ufn); |
| | | throw new ClientException(LDAPResultCode.CONSTRAINT_VIOLATION, msg); |
| | | } catch (ManagedObjectNotFoundException e) { |
| | | throw ArgumentExceptionFactory.unknownValueForChildComponent( |
| | | "\"" + names.get(names.size()-1) + "\""); |
| | | String objName = names.get(names.size() - 1); |
| | | ArgumentException except = null; |
| | | Message msg; |
| | | // if object name is 'null', get a user-friendly string to represent this |
| | | if (objName == null) { |
| | | msg = ERR_DSCFG_ERROR_FINDER_NO_CHILDREN_NULL.get(); |
| | | except = new ArgumentException(msg); |
| | | } else { |
| | | except = ArgumentExceptionFactory.unknownValueForChildComponent( |
| | | "\"" + objName + "\""); |
| | | } |
| | | if (app.isInteractive()) { |
| | | app.println(); |
| | | app.printVerboseMessage(except.getMessageObject()); |
| | | return MenuResult.cancel(); |
| | | } else { |
| | | throw except; |
| | | } |
| | | } |
| | | |
| | | if (result.isQuit()) { |