use of com.emc.fapiclient.ws.LicenseState in project coprhd-controller by CoprHD.
the class RecoverPointUtils method isSiteLicensed.
/**
* Returns true if the specified RecoverPoint site is licensed.
*
* @param impl
* @return boolean
* @throws Exception
*/
public static boolean isSiteLicensed(FunctionalAPIImpl impl) throws Exception {
// A bad license will be caught hear 99% of the time.
try {
AccountState accountState = impl.getAccountState();
List<LicenseState> licenseStates = accountState.getLicensesStates();
for (LicenseState licenseState : licenseStates) {
if (licenseState.getLicenseStatus().equals(LicenseStatus.ACTIVE)) {
logger.info("Found an active license");
return true;
}
}
logger.error("RecoverPoint licenses do not exist, are invalid, or have expired. Check your RP configuration");
} catch (FunctionalAPIActionFailedException_Exception e) {
return false;
} catch (FunctionalAPIInternalError_Exception e) {
;
return false;
} catch (Exception f) {
throw f;
}
return false;
}
Aggregations