From a83cb260d07d54aba1ea354f76f0eb8943cc8c6f Mon Sep 17 00:00:00 2001 From: lalber Date: Thu, 8 Apr 2021 12:41:01 +0200 Subject: Rename interface --- .../core/impl/idp/auth/services/IErrorService.java | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java') 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(); + } +} -- cgit v1.2.3 From b14c0c9ff91a9ef1a3236f5bbf41278f6d0a4725 Mon Sep 17 00:00:00 2001 From: lalber Date: Wed, 14 Apr 2021 20:10:38 +0200 Subject: ready for Tests --- .../at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java') 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 index 7c9c34c9..3f4b7f5e 100644 --- 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 @@ -29,6 +29,13 @@ public interface IErrorService { 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. * -- cgit v1.2.3 From 4a418d3a55752850891dbb9a6b10d03728a27520 Mon Sep 17 00:00:00 2001 From: lalber Date: Wed, 14 Apr 2021 21:54:08 +0200 Subject: log level via config --- .../eaaf/core/impl/idp/auth/services/IErrorService.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java') 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 index 3f4b7f5e..812a5171 100644 --- 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 @@ -4,6 +4,7 @@ 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 { /** @@ -82,18 +83,10 @@ public interface IErrorService { Throwable getThrowable(); /** - * Logs error to technical log. - */ - void log_error(); - - /** - * Logs info to technical log. - */ - void log_info(); - - /** - * Logs warn to technical log. + * Write a Exception to the MOA-ID-Auth internal technical log. + * + * @param logOnInfoLevel set of what to log on info logging lvl */ - void log_warn(); + void logExceptionToTechnicalLog(HashSet logOnInfoLevel); } } -- cgit v1.2.3