1
2
3
4
5
6
7
8
9
10
11 package gov.bnl.gums.admin;
12
13 import java.io.File;
14
15 import org.apache.commons.cli.Option;
16 import org.apache.commons.cli.Options;
17
18
19
20
21
22 public class ServerVersion extends RemoteCommand {
23
24 static {
25 command = new ServerVersion();
26 }
27
28
29
30
31 public ServerVersion() {
32 syntax = "[-g GUMSURL]";
33 description = "Returns the version of GUMS server being used.";
34 }
35
36 protected org.apache.commons.cli.Options buildOptions() {
37 Options options = new Options();
38
39 Option gumsUrl = new Option("g", "GUMS URL", true,
40 "Fully Qualified GUMS URL to override gums.location within the gums-client.properties file");
41 options.addOption(gumsUrl);
42
43 return options;
44 }
45
46 protected void execute(org.apache.commons.cli.CommandLine cmd) throws Exception {
47 String gumsUrl = (cmd.getOptionValue("g", null));
48
49 System.out.println("GUMS server version " + getGums(gumsUrl).getVersion());
50 }
51
52 }