From 206f4698790d3845fd26fdd1692f57ede1f34c4c Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Thu, 05 Feb 2015 13:58:24 +0000
Subject: [PATCH] #2283 fix - Excluding Date validation on lic renew

---
 src/main/java/net/curisit/securis/LicenseManager.java |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/src/main/java/net/curisit/securis/LicenseManager.java b/src/main/java/net/curisit/securis/LicenseManager.java
index 96b5f9c..9f6a397 100644
--- a/src/main/java/net/curisit/securis/LicenseManager.java
+++ b/src/main/java/net/curisit/securis/LicenseManager.java
@@ -62,8 +62,7 @@
 	}
 
 	/**
-	 * Validates the license stored in {@code licFile} and get the corresponding
-	 * LicenseBean
+	 * Validates the license stored in {@code licFile} and get the corresponding LicenseBean
 	 * <p>
 	 * The validation includes:
 	 * <ul>
@@ -83,8 +82,7 @@
 	}
 
 	/**
-	 * Validates the license stored in {@code licFile} and get the corresponding
-	 * LicenseBean. The License date is not validated
+	 * Validates the license stored in {@code licFile} and get the corresponding LicenseBean. The License date is not validated
 	 * <p>
 	 * The validation includes:
 	 * <ul>
@@ -101,8 +99,7 @@
 	public LicenseBean validateLicense(File licFile, boolean excludeDateValidation) throws SeCurisException {
 		LicenseBean licBean = load(licFile);
 		SignatureHelper.getInstance().validateSignature(licBean);
-		LicenseValidator.getInstance().validateHW(licBean, Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE),
-				Params.get(Params.KEYS.PACK_CODE));
+		LicenseValidator.getInstance().validateHW(licBean, Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE));
 		LicenseValidator.getInstance().validateLogo(licBean);
 
 		if (!excludeDateValidation) {
@@ -121,8 +118,7 @@
 	 * @throws SeCurisException
 	 */
 	public SignedLicenseBean requestLicense(String nameOrReference, String email) throws SeCurisException {
-		RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE),
-				Params.get(Params.KEYS.PACK_CODE));
+		RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE));
 
 		SignedLicenseBean lic = requestLicenseToServer(req, nameOrReference, email);
 		return lic;
@@ -174,8 +170,7 @@
 	}
 
 	/**
-	 * Creates a new request file with current hardware in the File passed as
-	 * parameter
+	 * Creates a new request file with current hardware in the File passed as parameter
 	 * 
 	 * @param outputRequestFile
 	 *            File where the request data will be saved
@@ -183,8 +178,7 @@
 	 * @throws SeCurisException
 	 */
 	public RequestBean createRequestFile(File outputRequestFile) throws SeCurisException {
-		RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE),
-				Params.get(Params.KEYS.PACK_CODE));
+		RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE));
 
 		ReqGenerator.getInstance().save(req, outputRequestFile);
 
@@ -192,17 +186,15 @@
 	}
 
 	/**
-	 * Send the current license file to server, which is previously validated,
-	 * to get a renewed one if it is prepared in server side.
+	 * Send the current license file to server, which is previously validated, to get a renewed one if it is prepared in server side.
 	 * 
 	 * @param licenseFile
 	 *            Current and valid License file
-	 * @return New license bean if server creates a new one, otherwise the same
-	 *         current License bean will be returned
+	 * @return New license bean if server creates a new one, otherwise the same current License bean will be returned
 	 * @throws SeCurisException
 	 */
 	public SignedLicenseBean renew(File licenseFile) throws SeCurisException {
-		LicenseBean lic = validateLicense(licenseFile);
+		LicenseBean lic = validateLicense(licenseFile, true);
 
 		SignedLicenseBean newLic = ConnectionManager.getInstance().executePost(Command.RENEW_LIC, SignedLicenseBean.class, lic);
 

--
Gitblit v1.3.2