#0 fix - Minor changes on method params names
| .. | .. |
|---|
| 30 | 30 | */ |
|---|
| 31 | 31 | public class LicenseManager { |
|---|
| 32 | 32 | |
|---|
| 33 | | - private static final Logger LOG = LogManager.getLogger(License.class); |
|---|
| 33 | + private static final Logger LOG = LogManager.getLogger(LicenseManager.class); |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | private static LicenseManager singleton = new LicenseManager(); |
|---|
| 36 | 36 | |
|---|
| .. | .. |
|---|
| 58 | 58 | } |
|---|
| 59 | 59 | } |
|---|
| 60 | 60 | |
|---|
| 61 | | - public void validateHW(RequestBean reqBean, String appCode, String customerCode, String packCode) throws SeCurisException { |
|---|
| 62 | | - RequestBean currentHW = ReqGenerator.getInstance().createRequest(appCode, customerCode, packCode); |
|---|
| 61 | + public void validateHW(RequestBean reqBean, String licTypeCode, String customerCode, String packCode) throws SeCurisException { |
|---|
| 62 | + RequestBean currentHW = ReqGenerator.getInstance().createRequest(licTypeCode, customerCode, packCode); |
|---|
| 63 | 63 | if (!currentHW.match(reqBean)) { |
|---|
| 64 | 64 | throw new SeCurisException("Current System info mismatch the License System info:\n Licensed: \n" + JsonUtils.toPrettyJSON(reqBean) |
|---|
| 65 | 65 | + "\n Expected: \n" + JsonUtils.toPrettyJSON(currentHW)); |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.util.Collections; |
|---|
| 4 | 4 | import java.util.List; |
|---|
| 5 | 5 | |
|---|
| 6 | +import net.curisit.securis.SeCurisException; |
|---|
| 7 | +import net.curisit.securis.utils.JsonUtils; |
|---|
| 8 | + |
|---|
| 6 | 9 | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|---|
| 7 | 10 | import com.fasterxml.jackson.annotation.JsonInclude; |
|---|
| 8 | 11 | import com.fasterxml.jackson.annotation.JsonInclude.Include; |
|---|
| .. | .. |
|---|
| 132 | 135 | public void setLicenseTypeCode(String licenseTypeCode) { |
|---|
| 133 | 136 | this.licenseTypeCode = licenseTypeCode; |
|---|
| 134 | 137 | } |
|---|
| 138 | + |
|---|
| 139 | + public static void main(String[] args) { |
|---|
| 140 | + String requestData = "{\n \"licenseTypeCode\": \"CI01\",\n \"packCode\": \"CIBP01\",\n \"arch\": \"amd64\",\n \"osName\": \"Windows Server 2012\",\n \"customerCode\": \"BP01\",\n \"macAddresses\": [\n \"02-71-1A-0E-5D-7C\"\n ],\n \"crcLogo\": \"153e09683eaa26d23c951f6605af5f874b533a917f73681e3e0a1f175aae3981\"\n}"; |
|---|
| 141 | + try { |
|---|
| 142 | + JsonUtils.json2object(requestData, RequestBean.class); |
|---|
| 143 | + } catch (SeCurisException e) { |
|---|
| 144 | + // TODO Auto-generated catch block |
|---|
| 145 | + e.printStackTrace(); |
|---|
| 146 | + } |
|---|
| 147 | + } |
|---|
| 135 | 148 | } |
|---|