Search in sources :

Example 1 with HostMetadataSetupSuccess

use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupSuccess in project cloudbreak by hortonworks.

the class HostMetadataSetupHandler method accept.

@Override
public void accept(Event<HostMetadataSetupRequest> event) {
    StackEvent request = event.getData();
    Selectable response;
    try {
        hostMetadataSetup.setupHostMetadata(request.getStackId());
        response = new HostMetadataSetupSuccess(request.getStackId());
    } catch (Exception e) {
        response = new HostMetadataSetupFailed(request.getStackId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) HostMetadataSetupFailed(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupFailed) HostMetadataSetupSuccess(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupSuccess)

Aggregations

Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)1 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)1 HostMetadataSetupFailed (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupFailed)1 HostMetadataSetupSuccess (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupSuccess)1