use of com.emc.vipr.model.sys.licensing.LicenseFeature in project coprhd-controller by CoprHD.
the class Licensing method itemDetails.
public static void itemDetails(String id) {
License license = LicenseUtils.getLicense();
LicenseFeature lf = null;
for (LicenseFeature feature : license.getLicenseFeatures()) {
if (StringUtils.equalsIgnoreCase(feature.getModelId(), id)) {
lf = feature;
break;
}
}
render(lf);
}
use of com.emc.vipr.model.sys.licensing.LicenseFeature in project coprhd-controller by CoprHD.
the class LicenseManagerImpl method createLicenseFeatureFromLicenseInfoExt.
/**
* Create a LicenseFeature object from a LicenseInfoExt from coordinator service.
*
* @return LicenseFeature
*/
private LicenseFeature createLicenseFeatureFromLicenseInfoExt(LicenseInfoExt licenseInfo) {
if (licenseInfo == null) {
return null;
}
LicenseFeature licenseFeature = new LicenseFeature();
licenseFeature.setDateExpires(licenseInfo.getExpirationDate());
licenseFeature.setExpired(isExpired(licenseFeature.getDateExpires()));
licenseFeature.setStorageCapacity(licenseInfo.getStorageCapacity());
licenseFeature.setProductId(licenseInfo.getProductId());
licenseFeature.setSerial(licenseInfo.getProductId());
licenseFeature.setModelId(licenseInfo.getModelId());
licenseFeature.setDateIssued(licenseInfo.getIssuedDate());
licenseFeature.setLicenseIdIndicator(licenseInfo.getLicenseTypeIndicator());
licenseFeature.setVersion(licenseInfo.getVersion());
licenseFeature.setNotice(licenseInfo.getNotice());
licenseFeature.setTrialLicense(licenseInfo.isTrialLicense());
licenseFeature.setLicensed(true);
return licenseFeature;
}
use of com.emc.vipr.model.sys.licensing.LicenseFeature in project coprhd-controller by CoprHD.
the class LicensingServiceImpl method getLicense.
@Override
public License getLicense() throws Exception {
_log.info("Received GET /license request");
// Changing invalid 01/01/12006 license expiration date to null
License license = _licenseManager.getLicense();
if (license != null && license.getLicenseFeatures() != null) {
for (LicenseFeature feature : license.getLicenseFeatures()) {
if (LicenseConstants.LICENSE_EXPIRATION_DATE.equals(feature.getDateExpires())) {
feature.setDateExpires(null);
}
if (feature.getStorageCapacity().equals(LicenseInfo.VALUE_NOT_SET)) {
feature.setStorageCapacity(null);
}
}
}
return license;
}
use of com.emc.vipr.model.sys.licensing.LicenseFeature in project coprhd-controller by CoprHD.
the class LicenseTest method noLicenseDefinedTest.
@Test
public void noLicenseDefinedTest() {
LicenseFeature license = new LicenseFeature();
Assert.assertFalse(license.isExpired());
Assert.assertFalse(license.isLicensed());
}
use of com.emc.vipr.model.sys.licensing.LicenseFeature in project coprhd-controller by CoprHD.
the class LicenseTest method permanentLicenseTest.
/**
* Positive test for a permanent license.
*/
@Test
public void permanentLicenseTest() {
LicenseFeature license = new LicenseFeature();
license.setDateExpires(LicenseManager.PERMANENT_LICENSE);
license.setExpired(LicenseManagerImpl.isExpired(license.getDateExpires()));
Assert.assertFalse(license.isExpired());
}
Aggregations