View Javadoc

1   /*
2    * GUMS2MapUser.java
3    *
4    * Created on June 9, 2004, 1:44 PM
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   * @author carcassi
21   * @depricated
22   */
23  public class ManualGroup_Remove extends RemoteCommand {
24      static {
25          command = new ManualGroup_Remove();
26      }
27  
28      /**
29       * Creates a new ManualGroup_Remove object.
30       */
31      public ManualGroup_Remove() {
32          syntax = "PERSISTANCE GROUP USERDN1 [USERDN2] ...";
33          description = "Removes a user from 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 ManualGroupRemove; 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().manualGroupRemove(persistenceFactory, groupName,
57                  cmd.getArgs()[nArg]);
58          }
59      }
60  }