rename dsservice to dsframework
8 files renamed
2 files modified
| File was renamed from opendj-sdk/opends/resource/bin/dsservice |
| | |
| | | |
| | | # This script may be used to perform LDAP add, delete, modify, and modify DN |
| | | # operations. |
| | | OPENDS_INVOKE_CLASS="org.opends.server.admin.client.cli.DsServiceCliMain" |
| | | OPENDS_INVOKE_CLASS="org.opends.server.admin.client.cli.DsFrameworkCliMain" |
| | | export OPENDS_INVOKE_CLASS |
| | | |
| | | SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=dsservice" |
| | | SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=dsframework" |
| | | export SCRIPT_NAME_ARG |
| | | |
| | | SCRIPT_DIR=`dirname "${0}"` |
| File was renamed from opendj-sdk/opends/resource/bin/dsservice.bat |
| | |
| | | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.admin.client.cli.DsServiceCliMain" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=dsservice" |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.admin.client.cli.DsFrameworkCliMain" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=dsframework" |
| | | call "%~dP0\..\lib\_client-script.bat" %* |
| | | |
| File was renamed from opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliAds.java |
| | |
| | | import org.opends.admin.ads.ADSContext; |
| | | import org.opends.admin.ads.ADSContextException; |
| | | import org.opends.admin.ads.ADSContextHelper; |
| | | import org.opends.server.admin.client.cli.DsServiceCliReturnCode.ReturnCode; |
| | | import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.ReturnCode; |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.BooleanArgument; |
| | | import org.opends.server.util.args.SubCommand; |
| | |
| | | /** |
| | | * This class is handling server group CLI. |
| | | */ |
| | | public class DsServiceCliAds implements DsServiceCliSubCommandGroup |
| | | public class DsFrameworkCliAds implements DsFrameworkCliSubCommandGroup |
| | | { |
| | | /** |
| | | * The enumeration containing the different subCommand names. |
| File was renamed from opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java |
| | |
| | | import org.opends.server.types.NullOutputStream; |
| | | import org.opends.server.util.args.ArgumentException; |
| | | |
| | | import static org.opends.server.admin.client.cli.DsServiceCliReturnCode.*; |
| | | import static org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.AdminMessages.*; |
| | | import static org.opends.server.messages.ToolMessages.*; |
| | |
| | | |
| | | |
| | | /** |
| | | * This class provides a tool that can be used to Directory Server services. |
| | | * This class provides a tool that can be used to Directory Server framework |
| | | * services. |
| | | */ |
| | | public class DsServiceCliMain |
| | | public class DsFrameworkCliMain |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.admin.client.cli.DsServiceCliMain"; |
| | | "org.opends.server.admin.client.cli.DsFrameworkCliMain"; |
| | | |
| | | // The print stream to use for standard error. |
| | | private PrintStream err; |
| | |
| | | |
| | | |
| | | /** |
| | | * Constructor for the DsServiceCLI object. |
| | | * Constructor for the DsFrameworkCLI object. |
| | | * |
| | | * @param out The print stream to use for standard output. |
| | | * @param err The print stream to use for standard error. |
| | | */ |
| | | public DsServiceCliMain(PrintStream out, PrintStream err) |
| | | public DsFrameworkCliMain(PrintStream out, PrintStream err) |
| | | { |
| | | this.out = out; |
| | | this.err = err; |
| | | } |
| | | |
| | | /** |
| | | * The main method for dsservice tool. |
| | | * The main method for dsframework tool. |
| | | * |
| | | * @param args The command-line arguments provided to this program. |
| | | */ |
| | |
| | | |
| | | /** |
| | | * Parses the provided command-line arguments and uses that information to |
| | | * run the dsservice tool. |
| | | * run the dsframework tool. |
| | | * |
| | | * @param args The command-line arguments provided to this program. |
| | | * |
| | |
| | | |
| | | /** |
| | | * Parses the provided command-line arguments and uses that information to |
| | | * run the dsservice tool. |
| | | * run the dsframework tool. |
| | | * |
| | | * @param args The command-line arguments provided to this |
| | | * program. |
| | |
| | | err = new PrintStream(errStream); |
| | | } |
| | | |
| | | DsServiceCliMain dsServiceCli = new DsServiceCliMain(out, err); |
| | | return dsServiceCli.execute(args,initializeServer); |
| | | DsFrameworkCliMain dsFrameworkCli = new DsFrameworkCliMain(out, err); |
| | | return dsFrameworkCli.execute(args,initializeServer); |
| | | } |
| | | |
| | | /** |
| | | * Parses the provided command-line arguments and uses that information to |
| | | * run the dsservice tool. |
| | | * run the dsframework tool. |
| | | * |
| | | * @param args The command-line arguments provided to this |
| | | * program. |
| | |
| | | { |
| | | // Create the command-line argument parser for use with this |
| | | // program. |
| | | DsServiceCliParser argParser ; |
| | | DsFrameworkCliParser argParser ; |
| | | try |
| | | { |
| | | String toolDescription = getMessage(MSGID_ADMIN_TOOL_DESCRIPTION); |
| | | argParser = new DsServiceCliParser(CLASS_NAME, |
| | | argParser = new DsFrameworkCliParser(CLASS_NAME, |
| | | toolDescription, false); |
| | | argParser.initializeParser(out); |
| | | } |
| | |
| | | catch (ADSContextException e) |
| | | { |
| | | adsException = e; |
| | | returnCode = DsServiceCliReturnCode.getReturncodeFromAdsError(e |
| | | returnCode = DsFrameworkCliReturnCode.getReturncodeFromAdsError(e |
| | | .getError()); |
| | | if (returnCode == null) |
| | | { |
| File was renamed from opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliParser.java |
| | |
| | | import org.opends.admin.ads.ADSContextException; |
| | | import org.opends.admin.ads.util.ApplicationKeyManager; |
| | | import org.opends.admin.ads.util.ApplicationTrustManager; |
| | | import org.opends.server.admin.client.cli.DsServiceCliReturnCode.ReturnCode; |
| | | import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.ReturnCode; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.util.PasswordReader; |
| | |
| | | /** |
| | | * This class will parser CLI arguments. |
| | | */ |
| | | public class DsServiceCliParser extends SubCommandArgumentParser |
| | | public class DsFrameworkCliParser extends SubCommandArgumentParser |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | |
| | | * The Logger. |
| | | */ |
| | | static private final Logger LOG = |
| | | Logger.getLogger(DsServiceCliParser.class.getName()); |
| | | Logger.getLogger(DsFrameworkCliParser.class.getName()); |
| | | |
| | | /** |
| | | * The diferent CLI group. |
| | | */ |
| | | public HashSet<DsServiceCliSubCommandGroup> cliGroup; |
| | | public HashSet<DsFrameworkCliSubCommandGroup> cliGroup; |
| | | |
| | | |
| | | |
| | |
| | | * Indicates whether subcommand and long argument names |
| | | * should be treated in a case-sensitive manner. |
| | | */ |
| | | public DsServiceCliParser(String mainClassName, String toolDescription, |
| | | public DsFrameworkCliParser(String mainClassName, String toolDescription, |
| | | boolean longArgumentsCaseSensitive) |
| | | { |
| | | super(mainClassName, toolDescription, longArgumentsCaseSensitive); |
| | | cliGroup = new HashSet<DsServiceCliSubCommandGroup>(); |
| | | cliGroup = new HashSet<DsFrameworkCliSubCommandGroup>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | initializeGlobalOption(outStream); |
| | | |
| | | // ads Group cli |
| | | cliGroup.add(new DsServiceCliAds()); |
| | | cliGroup.add(new DsFrameworkCliAds()); |
| | | |
| | | // Server Group cli |
| | | cliGroup.add(new DsServiceCliServerGroup()); |
| | | cliGroup.add(new DsFrameworkCliServerGroup()); |
| | | |
| | | // Initialization |
| | | for (DsServiceCliSubCommandGroup oneCli : cliGroup) |
| | | for (DsFrameworkCliSubCommandGroup oneCli : cliGroup) |
| | | { |
| | | oneCli.initializeCliGroup(this, verboseArg); |
| | | } |
| | |
| | | { |
| | | SubCommand subCmd = getSubCommand(); |
| | | |
| | | for (DsServiceCliSubCommandGroup oneCli : cliGroup) |
| | | for (DsFrameworkCliSubCommandGroup oneCli : cliGroup) |
| | | { |
| | | if (oneCli.isSubCommand(subCmd)) |
| | | { |
| File was renamed from opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliReturnCode.java |
| | |
| | | /** |
| | | * This class is handling server group CLI. |
| | | */ |
| | | public final class DsServiceCliReturnCode |
| | | public final class DsFrameworkCliReturnCode |
| | | { |
| | | /** |
| | | * |
| | |
| | | private static boolean initialized = false ; |
| | | |
| | | // Prevent instantiation. |
| | | private void DsServiceCliReturnCode() |
| | | private void DsFrameworkCliReturnCode() |
| | | { |
| | | // Do nothing. |
| | | } |
| File was renamed from opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliServerGroup.java |
| | |
| | | import org.opends.admin.ads.ADSContext; |
| | | import org.opends.admin.ads.ADSContextException; |
| | | import org.opends.admin.ads.ADSContext.ServerGroupProperty; |
| | | import org.opends.server.admin.client.cli.DsServiceCliReturnCode.ReturnCode; |
| | | import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.ReturnCode; |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.BooleanArgument; |
| | | import org.opends.server.util.args.StringArgument; |
| | |
| | | /** |
| | | * This class is handling server group CLI. |
| | | */ |
| | | public class DsServiceCliServerGroup implements DsServiceCliSubCommandGroup |
| | | public class DsFrameworkCliServerGroup implements DsFrameworkCliSubCommandGroup |
| | | { |
| | | |
| | | /** |
| File was renamed from opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliSubCommandGroup.java |
| | |
| | | |
| | | import org.opends.admin.ads.ADSContext; |
| | | import org.opends.admin.ads.ADSContextException; |
| | | import org.opends.server.admin.client.cli.DsServiceCliReturnCode.ReturnCode; |
| | | import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.ReturnCode; |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.BooleanArgument; |
| | | import org.opends.server.util.args.SubCommand; |
| | |
| | | /** |
| | | * This Interface defines method that a group of subcommand shoud implement. |
| | | */ |
| | | public interface DsServiceCliSubCommandGroup |
| | | public interface DsFrameworkCliSubCommandGroup |
| | | { |
| | | |
| | | /** |
| | |
| | | import org.testng.annotations.*; |
| | | import org.opends.admin.ads.ADSContext.ServerGroupProperty; |
| | | import org.opends.admin.ads.ADSContextException.ErrorType; |
| | | import org.opends.server.admin.client.cli.DsServiceCliReturnCode.ReturnCode; |
| | | import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.ReturnCode; |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.SubCommandArgumentParser; |
| | | |
| | |
| | | { |
| | | for (ErrorType error: ErrorType.values()) |
| | | { |
| | | assertNotNull(DsServiceCliReturnCode.getReturncodeFromAdsError(error), |
| | | assertNotNull(DsFrameworkCliReturnCode.getReturncodeFromAdsError(error), |
| | | "ErrorType." + error + " is not associated with a return code"); |
| | | } |
| | | } |
| | |
| | | @Test |
| | | public void testServerGroupAttributeDisplayName() |
| | | { |
| | | DsServiceCliServerGroup cli = new DsServiceCliServerGroup(); |
| | | DsFrameworkCliServerGroup cli = new DsFrameworkCliServerGroup(); |
| | | |
| | | try |
| | | { |
| | |
| | | |
| | | import static org.testng.Assert.*; |
| | | |
| | | import static org.opends.server.admin.client.cli.DsServiceCliReturnCode.*; |
| | | import static org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.*; |
| | | |
| | | |
| | | |
| | |
| | | "admin" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "admin" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-w", "password" |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, null, null) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, null, null) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-w", "password" |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, System.out, System.err) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-w", "wrongPassword" |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, System.out, System.err) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-j", validPasswordFile, |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-j",invalidPasswordFile |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, System.out, System.err) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-X" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-P", trustStorePath |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-X" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-P", trustStorePath |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | public void testHelp() |
| | | { |
| | | String[] args = { "--help" }; |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, null), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, null), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | |
| | | args = new String[] { "-H" }; |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, null), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, null), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | |
| | | args = new String[] { "-?" }; |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, null), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, null), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | } |