use of com.licensespring.LicenseManager in project jans by JanssenProject.
the class LicenseDetailsService method activateLicense.
public Boolean activateLicense(LicenseRequest licenseRequest) {
AUIConfiguration auiConfiguration = auiConfigurationService.getAUIConfiguration();
LicenseManager licenseManager = auiConfiguration.getLicenseConfiguration().getLicenseManager();
try {
log.debug("Trying to activate License.");
ActivationLicense keyBased = ActivationLicense.fromKey(licenseRequest.getLicenseKey());
License license = licenseManager.activateLicense(keyBased);
log.debug("License activated : {} ", license.getProduct());
return !license.getData().isExpired();
} catch (Exception e) {
log.error(ErrorResponse.ACTIVATE_LICENSE_ERROR.getDescription(), e);
return false;
}
}
Aggregations