All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bardframework.flow.FlowHandler Maven / Gradle / Ivy

package org.bardframework.flow;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.RandomStringUtils;

import java.util.Locale;
import java.util.Map;

public interface FlowHandler {
    String TOKEN_HEADER_NAME = "X-Flow-Token";

    FlowResponse start(Map initValues, Locale locale, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws Exception;

    FlowResponse submit(String flowToken, Map formData, Locale locale, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws Exception;

    Object action(String flowToken, String action, Map formData, Locale locale, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws Exception;

    FlowResponse getCurrent(String flowToken, Locale locale, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws Exception;

    default String generateFlowToken() {
        return RandomStringUtils.randomAlphanumeric(10, 50);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy