Search in sources :

Example 1 with RemoveReplicationAgreementsResponse

use of com.sequenceiq.freeipa.flow.freeipa.downscale.event.removereplication.RemoveReplicationAgreementsResponse in project cloudbreak by hortonworks.

the class RemoveReplicationAgreementsHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<RemoveReplicationAgreementsRequest> event) {
    RemoveReplicationAgreementsRequest request = event.getData();
    try {
        Long stackId = request.getResourceId();
        Stack stack = stackService.getStackById(stackId);
        freeIpaTopologyService.updateReplicationTopologyWithRetry(stack, request.getHosts());
        return new RemoveReplicationAgreementsResponse(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("Downscale removing replication agreements failed", e);
        return new DownscaleFailureEvent(REMOVE_REPLICATION_AGREEMENTS_FAILED_EVENT.event(), request.getResourceId(), "Downscale Remove Replication Agreements", Set.of(), Map.of(), e);
    }
}
Also used : RemoveReplicationAgreementsRequest(com.sequenceiq.freeipa.flow.freeipa.downscale.event.removereplication.RemoveReplicationAgreementsRequest) DownscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.downscale.event.DownscaleFailureEvent) RemoveReplicationAgreementsResponse(com.sequenceiq.freeipa.flow.freeipa.downscale.event.removereplication.RemoveReplicationAgreementsResponse) Stack(com.sequenceiq.freeipa.entity.Stack)

Aggregations

Stack (com.sequenceiq.freeipa.entity.Stack)1 DownscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.downscale.event.DownscaleFailureEvent)1 RemoveReplicationAgreementsRequest (com.sequenceiq.freeipa.flow.freeipa.downscale.event.removereplication.RemoveReplicationAgreementsRequest)1 RemoveReplicationAgreementsResponse (com.sequenceiq.freeipa.flow.freeipa.downscale.event.removereplication.RemoveReplicationAgreementsResponse)1