Examples of DsFrameworkCliReturnCode


Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

      return ret;
    }

    // Check if we need a connection

    DsFrameworkCliReturnCode returnCode = SUCCESSFUL;


    // Should we initialize the server in client mode?
    if (initializeServer)
    {
      // Bootstrap and initialize directory data structures.
      DirectoryServer.bootstrapClient();

      // Bootstrap definition classes.
      try
      {
        ClassLoaderProvider.getInstance().enable();
      }
      catch (InitializationException e)
      {
        err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
        return ERROR_UNEXPECTED.getReturnCode();
      }
      catch (IllegalStateException e)
      {
        err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
        return ERROR_UNEXPECTED.getReturnCode();
      }
    }

    // perform the subCommand
    ADSContextException adsException = null;
    try
    {
      returnCode = argParser.performSubCommand(out, err);
    }
    catch (ADSContextException e)
    {
      adsException = e;
      returnCode = DsFrameworkCliReturnCode.getReturncodeFromAdsError(e
          .getError());
      if (returnCode == null)
      {
        returnCode = ERROR_UNEXPECTED;
      }
    }
    catch (ArgumentException ae)
    {
      Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());

      err.println(wrapText(message, MAX_LINE_WIDTH));
      return CANNOT_INITIALIZE_ARGS.getReturnCode();
    }

    Message msg = returnCode.getMessage();
    if ( (returnCode == SUCCESSFUL)
         ||
         (returnCode == SUCCESSFUL_NOP))
    {
      if (argParser.isVerbose())
      {
        out.println(wrapText(msg.toString(), MAX_LINE_WIDTH));
      }
    }
    else
    if (msg != null &&
            msg.getDescriptor().getId() != ERR_ADMIN_NO_MESSAGE.getId())
    {
      MessageBuilder mb = new MessageBuilder(INFO_ADMIN_ERROR.get());
      mb.append(msg);
      err.println(wrapText(mb.toString(), MAX_LINE_WIDTH));
      if (argParser.isVerbose() && (adsException != null))
      {
        adsException.printStackTrace();
      }
    }
    return returnCode.getReturnCode();
  }
View Full Code Here

Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

      throws ADSContextException, ArgumentException
  {
    ADSContext adsCtx = null ;
    InitialLdapContext ctx = null ;

    DsFrameworkCliReturnCode returnCode = ERROR_UNEXPECTED;

    try
    {
      //
      // create-ads subcommand
View Full Code Here

Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

      throws ADSContextException, ArgumentException
  {
    ADSContext adsCtx = null ;
    InitialLdapContext ctx = null ;

    DsFrameworkCliReturnCode returnCode = ERROR_UNEXPECTED;
    try
    {
      // -----------------------
      // create-group subcommand
      // -----------------------
View Full Code Here

Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

   */
  static DsFrameworkCliReturnCode removeServerFromGroup(ADSContext adsCtx,
      String groupId, String serverId)
      throws ADSContextException
  {
    DsFrameworkCliReturnCode returnCode = SUCCESSFUL;

    // get the current group member list
    Set<String> memberList = adsCtx.getServerGroupMemberList(groupId);
    if (memberList == null)
    {
View Full Code Here

Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

   */
  static DsFrameworkCliReturnCode addServerTogroup(ADSContext adsCtx,
      String groupId, Map<ServerProperty, Object> map)
      throws ADSContextException
  {
    DsFrameworkCliReturnCode returnCode = SUCCESSFUL;
    String serverId = (String) map.get(ServerProperty.ID);

    // Add the server inside the group
    HashMap<ServerGroupProperty, Object> serverGroupProperties =
      new HashMap<ServerGroupProperty, Object>();
View Full Code Here

Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

      throws ADSContextException, ArgumentException
  {

    ADSContext adsCtx = null;
    InitialLdapContext ctx = null;
    DsFrameworkCliReturnCode returnCode = ERROR_UNEXPECTED;

    try
    {
      // -----------------------
      // register-server subcommand
View Full Code Here

Examples of org.nasutekds.server.admin.client.cli.DsFrameworkCliReturnCode

      throws ADSContextException, ArgumentException
  {

    ADSContext adsCtx = null;
    InitialLdapContext ctx = null;
    DsFrameworkCliReturnCode returnCode = ERROR_UNEXPECTED;

    try
    {
      // -----------------------
      // create-admin-user subcommand.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.