diff options
author | lalber <lukas.alber@iaik.tugraz.at> | 2021-04-08 12:41:01 +0200 |
---|---|---|
committer | lalber <lukas.alber@iaik.tugraz.at> | 2021-04-08 12:41:01 +0200 |
commit | a83cb260d07d54aba1ea354f76f0eb8943cc8c6f (patch) | |
tree | f960263c0d0473b54797261e7c08ef00be65f2b3 /eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java | |
parent | f18e44490057ba6e5fa719fefc47c8fd2e039b04 (diff) | |
download | EAAF-Components-a83cb260d07d54aba1ea354f76f0eb8943cc8c6f.tar.gz EAAF-Components-a83cb260d07d54aba1ea354f76f0eb8943cc8c6f.tar.bz2 EAAF-Components-a83cb260d07d54aba1ea354f76f0eb8943cc8c6f.zip |
Rename interface
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java new file mode 100644 index 00000000..7c9c34c9 --- /dev/null +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java @@ -0,0 +1,92 @@ +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; + +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"; + + /** + * 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(); + + /** + * Logs error to technical log. + */ + void log_error(); + + /** + * Logs info to technical log. + */ + void log_info(); + + /** + * Logs warn to technical log. + */ + void log_warn(); + } +} |