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.commons.cli.*;
10  
11  /**
12   * @author carcassi
13   * @depricated
14   */
15  public class ManualGroup_Remove extends RemoteCommand {
16      static {
17          command = new ManualGroup_Remove();
18      }
19  
20      /**
21       * Creates a new ManualGroup_Remove object.
22       */
23      public ManualGroup_Remove() {
24          syntax = "PERSISTANCE GROUP USERDN1 [USERDN2] ...";
25          description = "Removes a user from 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 ManualGroupRemove; 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().manualGroupRemove(persistenceFactory, groupName,
49                  cmd.getArgs()[nArg]);
50          }
51      }
52  }