Search in sources :

Example 1 with ExtendHostMetadataResult

use of com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataResult in project cloudbreak by hortonworks.

the class ExtendHostMetadataHandler method accept.

@Override
public void accept(Event<ExtendHostMetadataRequest> event) {
    ExtendHostMetadataRequest request = event.getData();
    ExtendHostMetadataResult result;
    try {
        hostMetadataSetup.setupNewHostMetadata(request.getStackId(), request.getUpscaleCandidateAddresses());
        result = new ExtendHostMetadataResult(request);
    } catch (Exception e) {
        result = new ExtendHostMetadataResult(e.getMessage(), e, request);
    }
    eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Also used : ExtendHostMetadataResult(com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataResult) ExtendHostMetadataRequest(com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataRequest)

Aggregations

ExtendHostMetadataRequest (com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataRequest)1 ExtendHostMetadataResult (com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataResult)1