use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.certrenew.ClusterCertificateRedeploySuccess in project cloudbreak by hortonworks.
the class ClusterCertificateRedeployHandler method accept.
@Override
public void accept(Event<ClusterCertificateRedeployRequest> event) {
ClusterCertificateRedeployRequest data = event.getData();
Long stackId = data.getResourceId();
LOGGER.debug("Redeploy certificate for stack 'id:{}'", stackId);
Selectable response;
try {
clusterServiceRunner.redeployGatewayCertificate(stackId);
LOGGER.info("Certificate of the cluster has been redeployed successfully.");
response = new ClusterCertificateRedeploySuccess(stackId);
} catch (Exception ex) {
String msg = "Certificate couldn't be redeployed to the cluster: ";
LOGGER.warn(msg, ex);
response = new ClusterCertificateRenewFailed(stackId, new CloudbreakOrchestratorFailedException(msg + ex.getMessage(), ex));
}
eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Aggregations