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 ManualMapping_Add extends RemoteCommand {
24 static {
25 command = new ManualMapping_Add();
26 }
27
28
29
30
31 public ManualMapping_Add() {
32 syntax = "PERSISTANCE GROUP USERDN USERNAME";
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 ManualMappingAdd; 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 < 4) {
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 String username = cmd.getArgs()[3];
55
56 getGums().manualMappingAdd(persistenceFactory, groupName, userDN, username);
57 }
58 }