1
2
3
4
5
6 package gov.bnl.gums.admin;
7
8
9 import org.apache.commons.cli.*;
10
11
12
13
14
15 public class ManualGroup_Add extends RemoteCommand {
16 static {
17 command = new ManualGroup_Add();
18 }
19
20
21
22
23 public ManualGroup_Add() {
24 syntax = "PERSISTANCE GROUP USERDN1 [USERDN2] ...";
25 description = "Adds a user to a manually managed group. " +
26 "PERSISTANCE is the 'persistenceFactory' as defined in the configuration for the group." +
27 "GROUP is the 'name' as defined in the configuration for the group." +
28 "NOTE: This command is depricated in favor of ManualGroupAdd; required with 1.1 server";
29 }
30
31 protected org.apache.commons.cli.Options buildOptions() {
32 Options options = new Options();
33
34 return options;
35 }
36
37 protected void execute(org.apache.commons.cli.CommandLine cmd)
38 throws Exception {
39 if (cmd.getArgs().length < 3) {
40 failForWrongParameters("Missing parameters...");
41 }
42
43 String[] userDN = (cmd.getArgs());
44 String persistenceFactory = cmd.getArgs()[0];
45 String groupName = cmd.getArgs()[1];
46
47 for (int nArg = 2; nArg < cmd.getArgs().length; nArg++) {
48 getGums().manualGroupAdd(persistenceFactory, groupName,
49 cmd.getArgs()[nArg]);
50 }
51 }
52 }