class StackImageUpdateActions {

    @Bean(name = "STACK_IMAGE_UPDATE_FINISHED")
    public AbstractStackImageUpdateAction<?> finishAction() {
        return new AbstractStackImageUpdateAction<>(CloudPlatformResult.class) {
            @Override
            protected void doExecute(StackContext context, CloudPlatformResult payload, Map<Object, Object> variables) {
                getFlowMessageService().fireEventAndLog(context.getStack().getId(), Status.AVAILABLE.name(), STACK_IMAGE_UPDATE_FINISHED);
                getStackUpdater().updateStackStatus(context.getStack().getId(), DetailedStackStatus.AVAILABLE);
                sendEvent(context, new StackEvent(STACK_IMAGE_UPDATE_FINISHED_EVENT.event(), context.getStack().getId()));
            }
        };
    }

}