use of com.sequenceiq.datalake.flow.cert.rotation.event.SdxCertRotationWaitEvent in project cloudbreak by hortonworks.
the class CertRotationActions method certRotationInProgressAction.
@Bean(name = "CERT_ROTATION_IN_PROGRESS_STATE")
public Action<?, ?> certRotationInProgressAction() {
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) {
LOGGER.info("Cert rotation is in progress. Start waiting to finish");
SdxCertRotationWaitEvent event = new SdxCertRotationWaitEvent(context);
sendEvent(context, event);
}
@Override
protected Object getFailurePayload(SdxEvent payload, Optional<SdxContext> flowContext, Exception ex) {
return new SdxCertRotationFailedEvent(payload, ex);
}
};
}
Aggregations