use of com.sequenceiq.datalake.flow.cert.renew.event.SdxCertRenewalWaitEvent in project cloudbreak by hortonworks.
the class CertRenewalActions method certRenewInProgressAction.
@Bean(name = "CERT_RENEWAL_IN_PROGRESS_STATE")
public Action<?, ?> certRenewInProgressAction() {
return new AbstractSdxAction<>(SdxEvent.class) {
@Override
protected SdxContext createFlowContext(FlowParameters flowParameters, StateContext<FlowState, FlowEvent> stateContext, SdxEvent payload) {
return SdxContext.from(flowParameters, payload);
}
@Override
protected void doExecute(SdxContext context, SdxEvent payload, Map<Object, Object> variables) throws Exception {
LOGGER.info("Cert renewal is in progress. Start waiting to finish.");
sendEvent(context, new SdxCertRenewalWaitEvent(context));
}
@Override
protected Object getFailurePayload(SdxEvent payload, Optional<SdxContext> flowContext, Exception ex) {
return new SdxCertRenewalFailedEvent(payload, ex.getMessage());
}
};
}
Aggregations