use of com.sequenceiq.cloudbreak.reactor.api.event.resource.ClusterSyncRequest in project cloudbreak by hortonworks.
the class ClusterSyncHandler method accept.
@Override
public void accept(Event<ClusterSyncRequest> event) {
ClusterSyncRequest request = event.getData();
ClusterSyncResult result;
try {
Stack stack = stackService.getByIdWithLists(request.getStackId());
String proxyIp = stackUtil.extractAmbariIp(stack);
String contextPath = stack.getCluster().getGateway().getPath();
proxyRegistrator.register(stack.getName(), contextPath, proxyIp);
Cluster cluster = clusterService.retrieveClusterByStackId(request.getStackId());
ambariClusterStatusUpdater.updateClusterStatus(stack, cluster);
result = new ClusterSyncResult(request);
} catch (Exception e) {
result = new ClusterSyncResult(e.getMessage(), e, request);
}
eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Aggregations