use of com.emc.storageos.coordinator.client.service.LicenseInfo in project coprhd-controller by CoprHD.
the class CoordinatorClientImpl method getLicenseInfo.
/**
* get License Info from coordinator for the specified license type
*
* @param licenseType
* @return LicenseInfo
*/
private LicenseInfo getLicenseInfo(LicenseType licenseType) {
final Configuration config = queryConfiguration(LicenseInfo.LICENSE_INFO_TARGET_PROPERTY, TARGET_PROPERTY_ID);
if (config == null || config.getConfig(TARGET_INFO) == null) {
return null;
}
final String infoStr = config.getConfig(TARGET_INFO);
try {
List<LicenseInfo> licenseInfoList = LicenseInfo.decodeLicenses(infoStr);
for (LicenseInfo licenseInfo : licenseInfoList) {
if (licenseType.equals(licenseInfo.getLicenseType())) {
log.debug("getLicenseInfo: " + licenseInfo);
return licenseInfo;
}
}
} catch (final Exception e) {
throw CoordinatorException.fatals.unableToDecodeLicense(e);
}
log.warn("getLicenseInfo: null");
return null;
}
Aggregations