package at.gv.egiz.eaaf.core.impl.idp.auth.services; import at.gv.egiz.eaaf.core.api.gui.ModifyableGuiBuilderConfiguration; import at.gv.egiz.eaaf.core.exceptions.EaafException; import javax.servlet.http.HttpServletRequest; import java.util.HashSet; public interface IErrorService { /** * Describes the kind of action that should be taken. */ enum ActionType { TICKET_REDIRECT("ticket_redirect"), TICKET_NOREDIRECT("ticket_noredirect"), NOTICKET_REDIRECT( "noticket_redirect"), NOTICKET_NOREDIRECT("noticket_noredirect"), NOTICKET_AUTOREDIRECT( "noticket_autoredirect"); private final String name; ActionType(final String text) { this.name = text; } @Override public String toString() { return name; } } String PARAM_GUI_TICKET = "supportTicket"; String PARAM_GUI_REDIRECT = "redirectLink"; /** * Maps internal error codes to external ones. * @param internalCode internal error code * @return external error code */ String getExternalCodeFromInternal(String internalCode); /** * creates error handling data. * * @param throwable error * @param req http request * @return eror handle Data * @throws EaafException In case of an internal error */ IHandleData createHandleData(Throwable throwable, HttpServletRequest req) throws EaafException; /** * Displays the error using suitable errordata. * * @param c guibuilder * @param errorData Data to handle * @throws EaafException In case of an internal error */ void displayErrorData(ModifyableGuiBuilderConfiguration c, IErrorService.IHandleData errorData) throws EaafException; /** * Contains all the Model data for Error Handling. */ interface IHandleData { /** * Describes the kind of action that should be taken. * * @return The appropriate action */ ActionType getActionType(); /** * Get internal errorCode describing the problem. * * @return internal error Code. */ String getInternalErrorCode(); /** * Get the original throwable of the error. * * @return causing throwable */ Throwable getThrowable(); /** * Write a Exception to the MOA-ID-Auth internal technical log. * * @param logOnInfoLevel set of what to log on info logging lvl */ void logExceptionToTechnicalLog(HashSet logOnInfoLevel); } }