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 ManualMapping_Remove extends RemoteCommand {
24      static {
25          command = new ManualMapping_Remove();
26      }
27  
28      /**
29       * Creates a new ManualMapping_Remove object.
30       */
31      public ManualMapping_Remove() {
32          syntax = "PERSISTANCE GROUP USERDN";
33          description = "Maps a DN to a user in a manually managed mapping. " +
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 ManualMappingRemove; 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 persistenceFactory = cmd.getArgs()[0];
52          String groupName = cmd.getArgs()[1];
53          String userDN = cmd.getArgs()[2];
54  
55          getGums().manualMappingRemove(persistenceFactory, groupName, userDN);
56      }
57  }