Search in sources :

Example 1 with PostInstallFreeIpaFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed in project cloudbreak by hortonworks.

the class PostInstallFreeIpaHandler method accept.

@Override
public void accept(Event<PostInstallFreeIpaRequest> event) {
    PostInstallFreeIpaRequest request = event.getData();
    Selectable response;
    try {
        freeIpaPostInstallService.postInstallFreeIpa(request.getResourceId(), request.isFullPostInstall());
        response = new PostInstallFreeIpaSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("Post install tasks have failed", e);
        response = new PostInstallFreeIpaFailed(request.getResourceId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) PostInstallFreeIpaFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed) PostInstallFreeIpaSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess) PostInstallFreeIpaRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest)

Example 2 with PostInstallFreeIpaFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed in project cloudbreak by hortonworks.

the class PostInstallFreeIpaFailedToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    PostInstallFreeIpaFailed result = (PostInstallFreeIpaFailed) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Post installing FreeIPA", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : PostInstallFreeIpaFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)

Aggregations

PostInstallFreeIpaFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 PostInstallFreeIpaRequest (com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest)1 PostInstallFreeIpaSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess)1 UpscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)1