Search in sources :

Example 1 with License

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;
}
Also used : License(com.emc.vipr.model.sys.licensing.License)

Example 2 with 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;
}
Also used : LicenseFeature(com.emc.vipr.model.sys.licensing.LicenseFeature) License(com.emc.vipr.model.sys.licensing.License)

Example 3 with 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);
}
Also used : License(com.emc.vipr.model.sys.licensing.License) Test(org.junit.Test)

Example 4 with License

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);
}
Also used : Promise(play.libs.F.Promise) License(com.emc.vipr.model.sys.licensing.License) Date(java.util.Date) Restrictions(controllers.deadbolt.Restrictions)

Example 5 with License

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);
}
Also used : LicenseFeature(com.emc.vipr.model.sys.licensing.LicenseFeature) License(com.emc.vipr.model.sys.licensing.License)

Aggregations

License (com.emc.vipr.model.sys.licensing.License)13 LicenseFeature (com.emc.vipr.model.sys.licensing.LicenseFeature)7 ELMFeatureDetail (com.emc.cams.elm.ELMFeatureDetail)1 ELMLicenseProps (com.emc.cams.elm.ELMLicenseProps)1 ELMLicenseSource (com.emc.cams.elm.ELMLicenseSource)1 ELMLicenseException (com.emc.cams.elm.exception.ELMLicenseException)1 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)1 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)1 CoordinatorClientException (com.emc.storageos.systemservices.exceptions.CoordinatorClientException)1 LocalRepositoryException (com.emc.storageos.systemservices.exceptions.LocalRepositoryException)1 SysClientException (com.emc.storageos.systemservices.exceptions.SysClientException)1 ClientResponse (com.sun.jersey.api.client.ClientResponse)1 Restrictions (controllers.deadbolt.Restrictions)1 IOException (java.io.IOException)1 Override (java.lang.Override)1 ParseException (java.text.ParseException)1 Date (java.util.Date)1 Test (org.junit.Test)1 Promise (play.libs.F.Promise)1 StorageStatsWrapper (util.StorageStatsWrapper)1