rsanchez
2015-02-05 206f4698790d3845fd26fdd1692f57ede1f34c4c
#2283 fix - Excluding Date validation on lic renew
1 files modified
changed files
src/main/java/net/curisit/securis/LicenseManager.java patch | view | blame | history
src/main/java/net/curisit/securis/LicenseManager.java
....@@ -62,8 +62,7 @@
6262 }
6363
6464 /**
65
- * Validates the license stored in {@code licFile} and get the corresponding
66
- * LicenseBean
65
+ * Validates the license stored in {@code licFile} and get the corresponding LicenseBean
6766 * <p>
6867 * The validation includes:
6968 * <ul>
....@@ -83,8 +82,7 @@
8382 }
8483
8584 /**
86
- * Validates the license stored in {@code licFile} and get the corresponding
87
- * LicenseBean. The License date is not validated
85
+ * Validates the license stored in {@code licFile} and get the corresponding LicenseBean. The License date is not validated
8886 * <p>
8987 * The validation includes:
9088 * <ul>
....@@ -101,8 +99,7 @@
10199 public LicenseBean validateLicense(File licFile, boolean excludeDateValidation) throws SeCurisException {
102100 LicenseBean licBean = load(licFile);
103101 SignatureHelper.getInstance().validateSignature(licBean);
104
- LicenseValidator.getInstance().validateHW(licBean, Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE),
105
- Params.get(Params.KEYS.PACK_CODE));
102
+ LicenseValidator.getInstance().validateHW(licBean, Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE));
106103 LicenseValidator.getInstance().validateLogo(licBean);
107104
108105 if (!excludeDateValidation) {
....@@ -121,8 +118,7 @@
121118 * @throws SeCurisException
122119 */
123120 public SignedLicenseBean requestLicense(String nameOrReference, String email) throws SeCurisException {
124
- RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE),
125
- Params.get(Params.KEYS.PACK_CODE));
121
+ RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE));
126122
127123 SignedLicenseBean lic = requestLicenseToServer(req, nameOrReference, email);
128124 return lic;
....@@ -174,8 +170,7 @@
174170 }
175171
176172 /**
177
- * Creates a new request file with current hardware in the File passed as
178
- * parameter
173
+ * Creates a new request file with current hardware in the File passed as parameter
179174 *
180175 * @param outputRequestFile
181176 * File where the request data will be saved
....@@ -183,8 +178,7 @@
183178 * @throws SeCurisException
184179 */
185180 public RequestBean createRequestFile(File outputRequestFile) throws SeCurisException {
186
- RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE),
187
- Params.get(Params.KEYS.PACK_CODE));
181
+ RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE));
188182
189183 ReqGenerator.getInstance().save(req, outputRequestFile);
190184
....@@ -192,17 +186,15 @@
192186 }
193187
194188 /**
195
- * Send the current license file to server, which is previously validated,
196
- * to get a renewed one if it is prepared in server side.
189
+ * Send the current license file to server, which is previously validated, to get a renewed one if it is prepared in server side.
197190 *
198191 * @param licenseFile
199192 * Current and valid License file
200
- * @return New license bean if server creates a new one, otherwise the same
201
- * current License bean will be returned
193
+ * @return New license bean if server creates a new one, otherwise the same current License bean will be returned
202194 * @throws SeCurisException
203195 */
204196 public SignedLicenseBean renew(File licenseFile) throws SeCurisException {
205
- LicenseBean lic = validateLicense(licenseFile);
197
+ LicenseBean lic = validateLicense(licenseFile, true);
206198
207199 SignedLicenseBean newLic = ConnectionManager.getInstance().executePost(Command.RENEW_LIC, SignedLicenseBean.class, lic);
208200