Package org.nasutekds.server.util.cli

Examples of org.nasutekds.server.util.cli.CommandBuilder


    if (commandName == null)
    {
      commandName = "dsconfig";
    }

    CommandBuilder commandBuilder =
      new CommandBuilder(commandName, handler.getSubCommand().getName());

    commandBuilder.append(handler.getCommandBuilder());

    if ((factory != null) && (factory.getContextCommandBuilder() != null))
    {
      commandBuilder.append(factory.getContextCommandBuilder());
    }

    if (verboseArgument.isPresent())
    {
      commandBuilder.addArgument(verboseArgument);
    }

    if (scriptFriendlyArgument.isPresent())
    {
      commandBuilder.addArgument(scriptFriendlyArgument);
    }

    commandBuilder.addArgument(noPromptArgument);

    if (propertiesFileArgument.isPresent())
    {
      commandBuilder.addArgument(propertiesFileArgument);
    }

    if (noPropertiesFileArgument.isPresent())
    {
      commandBuilder.addArgument(noPropertiesFileArgument);
    }

    return commandBuilder;
  }
View Full Code Here


    if (commandName == null)
    {
      commandName = "dsconfig";
    }

    CommandBuilder commandBuilder =
      new CommandBuilder(commandName, subcommandName);

    if ((factory != null) && (factory.getContextCommandBuilder() != null))
    {
      commandBuilder.append(factory.getContextCommandBuilder());
    }

    if (verboseArgument.isPresent())
    {
      commandBuilder.addArgument(verboseArgument);
    }

    if (scriptFriendlyArgument.isPresent())
    {
      commandBuilder.addArgument(scriptFriendlyArgument);
    }

    commandBuilder.addArgument(noPromptArgument);

    if (propertiesFileArgument.isPresent())
    {
      commandBuilder.addArgument(propertiesFileArgument);
    }

    if (noPropertiesFileArgument.isPresent())
    {
      commandBuilder.addArgument(noPropertiesFileArgument);
    }

    return commandBuilder;
  }
View Full Code Here

                    if ((app instanceof DSConfig) && app.isInteractive())
                    {
                      DSConfig dsConfig = (DSConfig)app;
                      String subCommandName = "set-" +
                      path.getRelationDefinition().getName() + "-prop";
                      CommandBuilder builder =
                        dsConfig.getCommandBuilder(subCommandName);

                      if (path.getRelationDefinition() instanceof
                          InstantiableRelationDefinition<?, ?>)
                      {
                        String argName =
                          CLIProfile.getInstance().getNamingArgument(
                              path.getRelationDefinition());
                        try
                        {
                          StringArgument arg = new StringArgument(argName, null,
                              argName, false, true,
                              INFO_NAME_PLACEHOLDER.get(),
                              INFO_DSCFG_DESCRIPTION_NAME.get(
                                  d.getUserFriendlyName()));
                          arg.addValue(name);
                          builder.addArgument(arg);
                        }
                        catch (Throwable t)
                        {
                          // Bug
                          throw new RuntimeException("Unexpected error: "+t, t);
                        }
                      }

                      try
                      {
                        StringArgument arg = new StringArgument(
                            OPTION_DSCFG_LONG_SET, OPTION_DSCFG_SHORT_SET,
                            OPTION_DSCFG_LONG_SET, false, true, true,
                            INFO_VALUE_SET_PLACEHOLDER.get(), null, null,
                            INFO_DSCFG_DESCRIPTION_PROP_VAL.get());
                        PropertyDefinition<?> propertyDefinition =
                          cvc.getPropertyDefinition();
                        arg.addValue(propertyDefinition.getName()+':'+
                            castAndGetArgumentValue(propertyDefinition,
                                cvc.getValue()));
                        builder.addArgument(arg);
                      }
                      catch (Throwable t)
                      {
                        // Bug
                        throw new RuntimeException("Unexpected error: "+t, t);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public CommandBuilder getContextCommandBuilder() {
    // No implementation required.
    return new CommandBuilder(null, null);
  }
View Full Code Here

   */
  public final CommandBuilder getCommandBuilder()
  {
    if (commandBuilder == null)
    {
      commandBuilder = new CommandBuilder(
            System.getProperty(ServerConstants.PROPERTY_SCRIPT_NAME),
            getSubCommand().getName());
    }
    return commandBuilder;
  }
View Full Code Here

  {
    if (mustPrintCommandBuilder())
    {
      try
      {
        CommandBuilder commandBuilder = createCommandBuilder(
            ReplicationCliArgumentParser.PURGE_HISTORICAL_SUBCMD_NAME,
            uData);
        printCommandBuilder(commandBuilder);
      }
      catch (Throwable t)
View Full Code Here

    }
    uData.setReplicationPort1(replicationPort1);
    uData.setSecureReplication1(secureReplication1);
    uData.setConfigureReplicationServer1(configureReplicationServer1);
    uData.setConfigureReplicationDomain1(configureReplicationDomain1);
    firstServerCommandBuilder = new CommandBuilder(null);
    if (mustPrintCommandBuilder())
    {
      firstServerCommandBuilder.append(ci.getCommandBuilder());
    }
View Full Code Here

      uData.setPortSource(portSource);
      uData.setAdminUid(adminUid);
      uData.setAdminPwd(adminPwd);
    }

    firstServerCommandBuilder = new CommandBuilder(null);
    if (mustPrintCommandBuilder())
    {
      firstServerCommandBuilder.append(ci.getCommandBuilder());
    }
View Full Code Here

        if (mustPrintCommandBuilder())
        {
          try
          {
            CommandBuilder commandBuilder = createCommandBuilder(
                ReplicationCliArgumentParser.ENABLE_REPLICATION_SUBCMD_NAME,
                uData);
            printCommandBuilder(commandBuilder);
          }
          catch (Throwable t)
View Full Code Here

        if (mustPrintCommandBuilder())
        {
          try
          {
            CommandBuilder commandBuilder = createCommandBuilder(
                ReplicationCliArgumentParser.DISABLE_REPLICATION_SUBCMD_NAME,
                uData);
            printCommandBuilder(commandBuilder);
          }
          catch (Throwable t)
View Full Code Here

TOP

Related Classes of org.nasutekds.server.util.cli.CommandBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.