use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterProxyReRegistrationRequest in project cloudbreak by hortonworks.
the class StackUpscaleActions method reRegisterWithClusterProxy.
@Bean(name = "RE_REGISTER_WITH_CLUSTER_PROXY_STATE")
public Action<?, ?> reRegisterWithClusterProxy() {
return new AbstractStackUpscaleAction<>(StackEvent.class) {
@Inject
private ClusterProxyEnablementService clusterProxyEnablementService;
@Override
protected void doExecute(StackScalingFlowContext context, StackEvent payload, Map<Object, Object> variables) {
if (clusterProxyEnablementService.isClusterProxyApplicable(context.getStack().cloudPlatform())) {
stackUpscaleService.reRegisterWithClusterProxy(context.getStack().getId());
sendEvent(context);
} else {
LOGGER.info("Cluster Proxy integration is DISABLED, skipping re-registering with Cluster Proxy service");
StackEvent bootstrapNewNodesEvent = new StackEvent(StackUpscaleEvent.CLUSTER_PROXY_RE_REGISTRATION_FINISHED_EVENT.event(), payload.getResourceId());
sendEvent(context, bootstrapNewNodesEvent);
}
}
@Override
protected Selectable createRequest(StackScalingFlowContext context) {
return new ClusterProxyReRegistrationRequest(context.getStack().getId(), context.getStack().getCloudPlatform(), StackUpscaleEvent.CLUSTER_PROXY_RE_REGISTRATION_FINISHED_EVENT.event());
}
};
}
use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterProxyReRegistrationRequest in project cloudbreak by hortonworks.
the class ClusterProxyReRegistrationHandler method accept.
@Override
public void accept(Event<ClusterProxyReRegistrationRequest> event) {
ClusterProxyReRegistrationRequest request = event.getData();
Selectable response = registerCluster(request);
eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Aggregations