use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmFailedEvent in project cloudbreak by hortonworks.
the class UpgradeCcmOnDatalakeHandler method sendFailedEvent.
private void sendFailedEvent(Event<EnvironmentDto> environmentDtoEvent, EnvironmentDto environmentDto, Exception e) {
UpgradeCcmFailedEvent failedEvent = new UpgradeCcmFailedEvent(environmentDto, e, EnvironmentStatus.UPGRADE_CCM_ON_DATALAKE_FAILED);
eventSender().sendEvent(failedEvent, environmentDtoEvent.getHeaders());
LOGGER.debug("UPGRADE_CCM_ON_DATALAKE_FAILED event sent");
}
use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmFailedEvent in project cloudbreak by hortonworks.
the class UpgradeCcmTunnelUpdateHandler method accept.
@Override
public void accept(Event<EnvironmentDto> environmentDtoEvent) {
LOGGER.debug("In UpgradeCcmTunnelUpdateHandler.accept");
EnvironmentDto environmentDto = environmentDtoEvent.getData();
try {
environmentService.updateTunnelByEnvironmentId(environmentDto.getResourceId(), Tunnel.latestUpgradeTarget());
UpgradeCcmEvent upgradeCcmEvent = UpgradeCcmEvent.builder().withSelector(UpgradeCcmStateSelectors.UPGRADE_CCM_DATALAKE_EVENT.selector()).withResourceCrn(environmentDto.getResourceCrn()).withResourceId(environmentDto.getId()).withResourceName(environmentDto.getName()).build();
eventSender().sendEvent(upgradeCcmEvent, environmentDtoEvent.getHeaders());
LOGGER.debug("UPGRADE_CCM_DATALAKE_EVENT event sent");
} catch (Exception e) {
UpgradeCcmFailedEvent failedEvent = new UpgradeCcmFailedEvent(environmentDto, e, EnvironmentStatus.UPGRADE_CCM_TUNNEL_UPDATE_FAILED);
eventSender().sendEvent(failedEvent, environmentDtoEvent.getHeaders());
LOGGER.debug("UPGRADE_CCM_TUNNEL_UPDATE_FAILED event sent");
}
}
Aggregations