1
2
3
4
5
6 package gov.bnl.gums.admin;
7
8 import gov.bnl.gums.configuration.Configuration;
9
10
11
12
13 public class GenerateFqanMapfile extends GenerateMap {
14 static {
15 command = new GenerateFqanMapfile();
16 }
17
18
19
20
21 public GenerateFqanMapfile() {
22 syntax = "[-g GUMSURL] [-f FILENAME] [SERVICEDN]";
23 description = "Generates the FQAN-mapfile for a service/host.";
24
25
26 }
27
28 protected String generateMap(String hostname, String gumsUrl) throws Exception {
29 String map = null;
30 map = getGums(gumsUrl).generateFqanMapfile(hostname);
31 if (map == null) {
32 System.err.println("Could not create FQAN-mapfile.");
33 System.out.print("The GUMS server configuration may not be correct. ");
34 System.out.print("Please contact your administrator, or if you are the administrator, make sure you have the following elements in your gums.config (which can be easily configured from the web interface):\n");
35 System.out.print("\t1) A hostToGroupMapping element which matches the requesting host name: "+hostname+"\n");
36 System.out.print("\t2) A groupToAccountMapping (referenced by the hostToGroupMapping) element which contains a user group and account mapper\n");
37 System.out.print("\t3) A userGroup element (referenced by the groupToAccountMapping) to validate membership of the requested DN\n");
38 System.out.print("\t4) A accountMapper element (referenced by the groupToAccountMapping) to return the account for the requested DN\n");
39 System.exit(-1);
40 }
41 return map;
42 }
43 }