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