Search in sources :

Example 1 with ChangePrimaryGatewaySuccess

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

the class ChangePrimaryGatewayHandler method accept.

@Override
public void accept(Event<ChangePrimaryGatewayRequest> event) {
    ChangePrimaryGatewayRequest request = event.getData();
    Selectable response;
    try {
        response = new ChangePrimaryGatewaySuccess(request.getStackId(), clusterServiceRunner.changePrimaryGateway(request.getStackId()));
    } catch (Exception e) {
        response = new ChangePrimaryGatewayFailed(request.getStackId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : ChangePrimaryGatewayRequest(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewayRequest) ChangePrimaryGatewaySuccess(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewaySuccess) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ChangePrimaryGatewayFailed(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewayFailed)

Aggregations

Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)1 ChangePrimaryGatewayFailed (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewayFailed)1 ChangePrimaryGatewayRequest (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewayRequest)1 ChangePrimaryGatewaySuccess (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewaySuccess)1