hazelcast 搭建_hazelcast Management Center 源码分析

2022-05-23 00:00:00 专区 订阅 付费 链接 原文

[Java] 纯文本查看 复制代码public static License checkLicenseKeyPerFeature(String licenseKey, String versionString, Feature feature) {

License license = getLicense(licenseKey, versionString);

if (!license.getFeatures().contains(feature)) {

throw new InvalidLicenseException("The Feature " + feature.getText() + " is not enabled for your license key." + "Please contact [email]sales@hazelcast.com[/email]");

}

return license;

}

public static License getLicense(String licenseKey, String versionString) {

if (licenseKey == null) {

throw new InvalidLicenseException("License Key not configured!");

}

License license = null;

try {

license = LicenseExtractorV2.extractLicense(licenseKey);

} catch (InvalidLicenseException e1) {

try {

license = LicenseExtractorV3.extractLicense(licenseKey);

} catch (InvalidLicenseException e2) {

license = LicenseExtractorV4.extractLicense(licenseKey);

}

}

int version = extractHazelcastMajorMinorVersionAsInt(versionString);

if ((license.getHazelcastVersion() != 99) && (license.getHazelcastVersion() != version)) {

throw new InvalidLicenseException("This license cannot work with your hazelcast version!");

}

if ((license.isTrial()) && (isExpired(license))) {

throw new InvalidLicenseException("Trial license has expired! Please contact [email]sales@hazelcast.com[/email]");

}

if (isExpired(license)) {

throw new InvalidLicenseException("Enterprise License has expired! Please contact [email]sales@hazelcast.com[/email]");

}

return license;

}
————————————————
版权声明:本文为CSDN博主「weixin_39559559」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_39559559/article/details/111985888

相关文章