Search in sources :

Example 1 with HostMetadataSetupFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupFailed in project cloudbreak by hortonworks.

the class HostMetadataSetupHandler method accept.

@Override
public void accept(Event<HostMetadataSetupRequest> event) {
    StackEvent request = event.getData();
    LOGGER.debug("Host metadata setup request {}", request);
    Selectable response;
    try {
        hostMetadataSetup.setupHostMetadata(request.getResourceId());
        response = new HostMetadataSetupSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.debug("Host metadata setup failed", e);
        response = new HostMetadataSetupFailed(request.getResourceId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) HostMetadataSetupFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupFailed) HostMetadataSetupSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupSuccess)

Example 2 with HostMetadataSetupFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupFailed in project cloudbreak by hortonworks.

the class HostMetadataSetupFailedToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    HostMetadataSetupFailed result = (HostMetadataSetupFailed) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Host metadata setup", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : HostMetadataSetupFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupFailed) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)

Aggregations

HostMetadataSetupFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupFailed)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 HostMetadataSetupSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupSuccess)1 UpscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)1 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)1