Package com.zaranux.os.client.commands

Source Code of com.zaranux.os.client.commands.adduser

package com.zaranux.os.client.commands;

import com.zaranux.client.api.AsyncCallback;
import com.zaranux.client.java.io.PrintStream;

import com.zaranux.os.client.util.Log;

public class adduser extends Command {

  @Override
  protected void execute(final AsyncCallback<Boolean> callback) {
    String[] args = getArgs();
    if(args.length == 2)
    {
      String id = args[0];
      String pass = args[1];
     
      systemcall.createuser(id, pass, new AsyncCallback<Boolean>()
        {
          public void onSuccess(final Boolean b)
          {
            final PrintStream outPS = (PrintStream) System.out;
                 
            outPS.print("added : " + b ,new AsyncCallback<Boolean>()
            {
              public void onSuccess(Boolean b)
              {
                  callback.onSuccess(true);
              }
              public void onFailure(Throwable t)
              {
                callback.onFailure(t);
              }
            });

          }
          public void onFailure(Throwable T)
          {
           
          }
        }
      );
  }
  }
}
TOP

Related Classes of com.zaranux.os.client.commands.adduser

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.