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.io.FileNotFoundException;
14  import java.io.FileOutputStream;
15  import java.io.PrintStream;
16  
17  import java.net.ConnectException;
18  import java.net.InetAddress;
19  import java.net.URL;
20  
21  
22  /***
23   * @author carcassi
24   */
25  public class GenerateGrid3UserVoMap extends GenerateMap {
26      static {
27          command = new GenerateGrid3UserVoMap();
28      }
29  
30      /***
31       * Creates a new GenerateGrid3UserVoMap object.
32       */
33      public GenerateGrid3UserVoMap() {
34          syntax = "[-f FILENAME] [SERVICEDN]";
35          description = "Generates the grid3-user-vo-map.txt for a service/host. " +
36              "When using ./bin/gums, SERVICEDN must be specified. " +
37              "When using ./bin/gums-host, SERVICEDN defaults to the host certificate DN.";
38      }
39  
40      protected String generateMap(String hostname) throws Exception {
41          String map = null;
42          map = getGums().generateGrid3UserVoMap(hostname);
43          if (map == null) {
44              System.err.println("No map was found for the service/host " + hostname);
45              System.exit(-1);
46          }
47          return map;
48      }
49  }