Search in sources :

Example 1 with InstallFreeIpaServicesFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed in project cloudbreak by hortonworks.

the class InstallFreeIpaServicesHandler method accept.

@Override
public void accept(Event<InstallFreeIpaServicesRequest> event) {
    StackEvent request = event.getData();
    Selectable response;
    try {
        freeIpaInstallService.installFreeIpa(request.getResourceId());
        response = new InstallFreeIpaServicesSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("FreeIPA service install failed", e);
        response = new InstallFreeIpaServicesFailed(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) InstallFreeIpaServicesSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess) InstallFreeIpaServicesFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed)

Example 2 with InstallFreeIpaServicesFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed in project cloudbreak by hortonworks.

the class InstallFreeIpaServicesFailedToUpscaleFailureEventConverter method convert.

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

Aggregations

InstallFreeIpaServicesFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 InstallFreeIpaServicesSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess)1 UpscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)1 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)1