115 LOG.trace(
"Validating license ...");
120 Optional<LicenseFile> licenseFile = LicenseFile.load();
121 if (!licenseFile.isPresent() || Strings.isNullOrEmpty(licenseFile.get().getEncodedLicense())) {
122 LOG.error(
"Failed to load license file : " + LicenseFile.getLicenseFile().getAbsolutePath());
126 if (StringUtils.isBlank(licenseFile.get().getLicenseId()) || !licenseFile.get().getLicenseId().equals(
conf.
getLicenseId())) {
127 LOG.info(String.format(
"Deleting license file ... license id in file (%s) does not match license id from oxd-conf.json (%s)", licenseFile.get().getLicenseId(),
conf.
getLicenseId()));
128 LicenseFile.deleteContent();
130 licenseFile = LicenseFile.load();
133 LicenseContent licenseContent = LicenseValidator.validate(
137 licenseFile.get().getEncodedLicense(),
142 metadata = licenseContent.getMetadata();
145 LOG.trace(
"License is validated successfully.");
148 }
catch (Exception e) {
149 LOG.error(e.getMessage(), e);
volatile LicenseMetadata metadata
Definition: LicenseService.java:51
static final Logger LOG
Definition: LicenseService.java:44
final OxdServerConfiguration conf
Definition: LicenseService.java:46
final TimeService timeService
Definition: LicenseService.java:48
String getLicensePassword()
Definition: OxdServerConfiguration.java:178
Date getCurrentLicenseServerTime()
Definition: TimeService.java:31
String getPublicPassword()
Definition: OxdServerConfiguration.java:194
void updateLicenseFromServer()
Definition: LicenseFileUpdateService.java:76
String getPublicKey()
Definition: OxdServerConfiguration.java:186
final LicenseFileUpdateService updateService
Definition: LicenseService.java:47
volatile boolean licenseValid
Definition: LicenseService.java:52
String getLicenseId()
Definition: OxdServerConfiguration.java:174