Search in sources :

Example 1 with SetupRecoverySuccess

use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.SetupRecoverySuccess in project cloudbreak by hortonworks.

the class RecoverySetupHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<SetupRecoveryRequest> event) {
    Long stackId = event.getData().getResourceId();
    try {
        if (event.getData().getProvisionType() == ProvisionType.RECOVERY) {
            LOGGER.debug("Provision type is recovery, so running recovery setup state.");
            rdsRecoverySetupService.addRecoverRole(stackId);
        } else {
            LOGGER.debug("Provision type is not recovery, skipping recovery specific logic..");
        }
        return new SetupRecoverySuccess(stackId);
    } catch (Exception e) {
        LOGGER.error("Recovery setup failed", e);
        return new SetupRecoveryFailed(stackId, e);
    }
}
Also used : SetupRecoverySuccess(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.SetupRecoverySuccess) SetupRecoveryFailed(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.SetupRecoveryFailed)

Aggregations

SetupRecoveryFailed (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.SetupRecoveryFailed)1 SetupRecoverySuccess (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.SetupRecoverySuccess)1