Beispiel #1
0
 public void users(String[] args) {
   context.println("Local Users");
   context.println("-------------");
   for (LocalUser user : userRegistry.getUsers()) {
     context.println(user.toString());
   }
 }
Beispiel #2
0
 @ScriptUsage(
     description = "add user",
     arguments = {
       @ScriptArgument(name = "login name", type = "string", description = "login name")
     })
 public void removeUser(String[] args) {
   userRegistry.remove(args[0]);
 }
Beispiel #3
0
  @ScriptUsage(
      description = "add user",
      arguments = {
        @ScriptArgument(name = "login name", type = "string", description = "login name"),
        @ScriptArgument(name = "password", type = "string", description = "password")
      })
  public void addUser(String[] args) {
    LocalUser user = new LocalUser();
    user.setLoginName(args[0]);
    user.setPassword(args[1]);

    userRegistry.add(user);
    context.println("user added");
  }