use of com.sequenceiq.cloudbreak.core.flow2.validate.kerberosconfig.config.KerberosConfigValidationEvent in project cloudbreak by hortonworks.
the class KerberosConfigValidationActions method kerberosConfigValidationFailureAction.
@Bean(name = "VALIDATE_KERBEROS_CONFIG_FAILED_STATE")
public Action<?, ?> kerberosConfigValidationFailureAction() {
return new AbstractStackFailureAction<KerberosConfigValidationState, KerberosConfigValidationEvent>() {
@Override
protected StackFailureContext createFlowContext(FlowParameters flowParameters, StateContext<KerberosConfigValidationState, KerberosConfigValidationEvent> stateContext, StackFailureEvent payload) {
Flow flow = getFlow(flowParameters.getFlowId());
StackView stackView = stackService.getViewByIdWithoutAuth(payload.getResourceId());
MDCBuilder.buildMdcContext(stackView);
flow.setFlowFailed(payload.getException());
return new StackFailureContext(flowParameters, stackView);
}
@Override
protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) {
stackUpdaterService.updateStatusAndSendEventWithArgs(context.getStackView().getId(), DetailedStackStatus.PROVISION_FAILED, ResourceEvent.KERBEROS_CONFIG_VALIDATION_FAILED, payload.getException().getMessage(), payload.getException().getMessage());
sendEvent(context);
}
@Override
protected Selectable createRequest(StackFailureContext context) {
return new StackEvent(KerberosConfigValidationEvent.VALIDATE_KERBEROS_CONFIG_FAILURE_HANDLED_EVENT.selector(), context.getStackView().getId());
}
};
}
Aggregations