use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoListExt in project coprhd-controller by CoprHD.
the class CallHomeServiceImpl method sendHeartbeatEvent.
@Override
public Response sendHeartbeatEvent() {
// if not configured for callhome, do not continue.
_callHomeEventManager.validateSendEvent();
LicenseInfoListExt licenseList = null;
try {
licenseList = _licenseManager.getLicenseInfoListFromCoordinator();
} catch (Exception e) {
throw APIException.internalServerErrors.licenseInfoNotFoundForType("all license types");
}
if (licenseList != null) {
// send heart beat events for each registered license type
for (LicenseInfoExt licenseInfo : licenseList.getLicenseList()) {
if (licenseInfo.isTrialLicense()) {
_log.warn("Cannot send heartbeat event to SYR for trial license {} ", licenseInfo.getLicenseType().toString());
throw APIException.forbidden.permissionDeniedForTrialLicense(licenseInfo.getLicenseType().toString());
}
_callHomeEventsFacade.sendHeartBeatEvent(licenseInfo, getMediaType());
}
}
auditCallhome(OperationTypeEnum.SEND_HEARTBEAT, AuditLogManager.AUDITLOG_SUCCESS, null);
return Response.ok().build();
}
use of com.emc.storageos.systemservices.impl.licensing.LicenseInfoListExt in project coprhd-controller by CoprHD.
the class CallHomeServiceImpl method internalSendRegistrationEvent.
void internalSendRegistrationEvent() {
_callHomeEventManager.validateSendEvent();
LicenseInfoListExt licenseList = null;
try {
licenseList = _licenseManager.getLicenseInfoListFromCoordinator();
} catch (Exception e) {
throw APIException.internalServerErrors.licenseInfoNotFoundForType("all license types");
}
if (licenseList != null) {
// send registration events for each registered license type
for (LicenseInfoExt licenseInfo : licenseList.getLicenseList()) {
if (licenseInfo.isTrialLicense()) {
_log.warn("Cannot send regisration event to SYR for trial license {}", licenseInfo.getLicenseType().toString());
throw APIException.forbidden.permissionDeniedForTrialLicense(licenseInfo.getLicenseType().toString());
}
_callHomeEventsFacade.sendRegistrationEvent(licenseInfo, getMediaType());
}
}
auditCallhome(OperationTypeEnum.SEND_REGISTRATION, AuditLogManager.AUDITLOG_SUCCESS, null);
}
Aggregations