use of com.emc.vipr.model.sys.licensing.License in project coprhd-controller by CoprHD.
the class LicenseManagerImpl method getLicense.
/**
* Returns a full license object complete with features.
*
* @return
*/
public License getLicense() throws Exception {
LicenseInfoListExt licenseInfoList = getLicenseInfoListFromCoordinator();
License license = new License();
if (licenseInfoList != null) {
// create a license object from the above license features.
createLicenseObject(licenseInfoList.getLicenseList(), license);
}
// get the raw license text from coordinator.
LicenseTextInfo licenseTextInfo = getLicenseTextFromCoordinator();
// is not licensed.
if (licenseTextInfo != null) {
license.setLicenseText(licenseTextInfo.getLicenseText());
} else {
license.setLicenseText("The product is not licensed");
}
return license;
}
use of com.emc.vipr.model.sys.licensing.License 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.License in project coprhd-controller by CoprHD.
the class LicenseManagerTest method testForNoLicense.
@Test
public void testForNoLicense() throws Exception {
LicenseManager manager = new LicenseManagerImpl() {
public License getLicense() {
return new License();
}
};
License license = manager.getLicense();
Assert.assertEquals(license.getLicenseFeatures().size(), 0);
}
use of com.emc.vipr.model.sys.licensing.License in project coprhd-controller by CoprHD.
the class AdminDashboard method version.
@Restrictions({ @Restrict("SYSTEM_MONITOR"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void version() {
License license = AdminDashboardUtils.getLicense();
Map<String, Promise<?>> promises = Maps.newHashMap();
promises.put("clusterInfo", AdminDashboardUtils.clusterInfo());
trySetRenderArgs(promises);
// Add lastUpdated render args after promises are redeemed
Date clusterInfoLastUpdated = AdminDashboardUtils.getClusterInfoLastUpdated();
render(license, clusterInfoLastUpdated);
}
use of com.emc.vipr.model.sys.licensing.License 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);
}
Aggregations