Roberto Sánchez
2014-07-11 261509641ae2f405c50744134d12f261f30e81e3
#0 feature - Changed server parameter to properties file, new version
0.9.3
5 files modified
changed files
pom.xml patch | view | blame | history
src/main/java/net/curisit/securis/License.java patch | view | blame | history
src/main/java/net/curisit/securis/LicenseManager.java patch | view | blame | history
src/main/java/net/curisit/securis/utils/Params.java patch | view | blame | history
src/main/resources/securis-client.properties patch | view | blame | history
pom.xml
....@@ -3,7 +3,7 @@
33 <modelVersion>4.0.0</modelVersion>
44 <groupId>net.curisit</groupId>
55 <artifactId>securis-client</artifactId>
6
- <version>0.9.2-SNAPSHOT</version>
6
+ <version>0.9.3-SNAPSHOT</version>
77 <build>
88 <plugins>
99 <plugin>
src/main/java/net/curisit/securis/License.java
....@@ -88,17 +88,12 @@
8888 if (cmd.hasOption('c')) {
8989 String reqFilename = cmd.getOptionValue("rfile");
9090 checkMandatoryParameter(reqFilename, "rfile");
91
- String server = cmd.getOptionValue("server");
92
- checkMandatoryParameter(server, "server");
9391
9492 log.warn("This command is not yet implemented");
9593 System.exit(0);
9694 }
9795
9896 if (cmd.hasOption('t')) {
99
- String server = cmd.getOptionValue("server");
100
- checkMandatoryParameter(server, "server");
101
-
10297 log.warn("This command is not yet implemented");
10398 System.exit(0);
10499 }
....@@ -106,9 +101,6 @@
106101 if (cmd.hasOption('r')) {
107102 String licFilename = cmd.getOptionValue("renew");
108103 checkMandatoryParameter(licFilename, "renew");
109
- String server = cmd.getOptionValue("server");
110
- checkMandatoryParameter(server, "server");
111
-
112104 log.warn("This command is not yet implemented");
113105 System.exit(0);
114106 }
....@@ -173,13 +165,13 @@
173165
174166 options.addOption("h", "help", false, "Show help.");
175167 options.addOption(OptionBuilder.withArgName("req_file").withLongOpt("rfile").withDescription("Set request file for its generation or for license requesting.").hasArg(true).create('r'));
176
- options.addOption(OptionBuilder.withArgName("url_license_server").withLongOpt("server").withDescription("License server url.").hasArg(true).create('s'));
168
+ // options.addOption(OptionBuilder.withArgName("url_license_server").withLongOpt("server").withDescription("License server url.").hasArg(true).create('s'));
177169 options.addOption(OptionBuilder.withArgName("lic_file").withLongOpt("validate").withDescription("Validate lic file.").hasArg(true).create('l'));
178170
179171 options.addOption("g", "gen_request", false, "Generate request file. If --rfile parameter is missing then It is generated in current directory.");
180
- options.addOption(OptionBuilder.withArgName("lic_file").withLongOpt("create").withDescription("Request a license file from server. --server parameters is mandatory.").hasArg(true).create('c'));
172
+ options.addOption(OptionBuilder.withArgName("lic_file").withLongOpt("create").withDescription("Request a license file from server.").hasArg(true).create('c'));
181173 options.addOption("t", "test_lc", false, "Test if License Server (LC) is available. --server parameter is mandatory.");
182
- options.addOption(OptionBuilder.withArgName("lic_file").withLongOpt("renew").withDescription("Synchronize/renew the current license file. --server parameter is mandatory.").hasArg(true).create('r'));
174
+ options.addOption(OptionBuilder.withArgName("lic_file").withLongOpt("renew").withDescription("Synchronize/renew the current license file.").hasArg(true).create('r'));
183175
184176 return options;
185177 }
src/main/java/net/curisit/securis/LicenseManager.java
....@@ -29,7 +29,10 @@
2929
3030 private static LicenseManager singleton = new LicenseManager();
3131
32
+ String serverUrl = null;
33
+
3234 private LicenseManager() {
35
+ serverUrl = Params.get(Params.KEYS.LICENSE_SERVER_URL);
3336 }
3437
3538 public static LicenseManager getInstance() {
src/main/java/net/curisit/securis/utils/Params.java
....@@ -190,6 +190,8 @@
190190 public static final String APPLICATION_CODE = "app.code";
191191
192192 public static final String CUSTOMER_CODE = "customer.code";
193
+
194
+ public static final String LICENSE_SERVER_URL = "license.server.url";
193195 }
194196
195197 }
src/main/resources/securis-client.properties
....@@ -1,3 +1,4 @@
1
+license.server.url = https://securis.curistec.com/securis/api
12 public.key.file = __ADD_PUBLIC_KEY_FILE__
23 app.code = __ADD_APP_CODE__
34 customer.code = __ADD_CUSTOMER_CODE__