use of com.sequenceiq.freeipa.flow.freeipa.downscale.event.stoptelemetry.StopTelemetryResponse in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method collectResourcesAction.
@Bean(name = "DOWNSCALE_COLLECT_RESOURCES_STATE")
public Action<?, ?> collectResourcesAction() {
return new AbstractDownscaleAction<>(StopTelemetryResponse.class) {
@Override
protected void doExecute(StackContext context, StopTelemetryResponse payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Collecting resources");
List<String> repairInstanceIds = getInstanceIds(variables);
List<CloudResource> cloudResources = getCloudResources(stack);
List<CloudInstance> cloudInstances = getCloudInstances(stack, repairInstanceIds);
DownscaleStackCollectResourcesRequest request = new DownscaleStackCollectResourcesRequest(context.getCloudContext(), context.getCloudCredential(), context.getCloudStack(), cloudResources, cloudInstances);
sendEvent(context, request.selector(), request);
}
};
}
use of com.sequenceiq.freeipa.flow.freeipa.downscale.event.stoptelemetry.StopTelemetryResponse in project cloudbreak by hortonworks.
the class StopTelemetryHandler method accept.
@Override
public void accept(Event<StopTelemetryRequest> event) {
StopTelemetryRequest request = event.getData();
LOGGER.info("Stop telemetry agents gracefully (if needed)...");
telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds());
StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId());
eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class), new Event<>(event.getHeaders(), response));
}
Aggregations