summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2021-04-19 09:23:41 +0000
committerThomas Lenz <thomas.lenz@egiz.gv.at>2021-04-19 09:23:41 +0000
commit9e072b7105c4353ea4a193e03efd00f2f63d824c (patch)
tree8d0cbfe50fc41ed592ec1b42b83c0c6cae6bbd44 /eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java
parent2725ea4a3412a97a8f7ff7031f69970a8382423d (diff)
parent3e734a0f1fedba00e594bd69e72bd2f18a0a60bf (diff)
downloadEAAF-Components-9e072b7105c4353ea4a193e03efd00f2f63d824c.tar.gz
EAAF-Components-9e072b7105c4353ea4a193e03efd00f2f63d824c.tar.bz2
EAAF-Components-9e072b7105c4353ea4a193e03efd00f2f63d824c.zip
Merge branch 'feature/VT-21-016' into 'nightlyBuild'
Use custom SSLContext builder to generate BouncyCastle specific TrustManager... See merge request egiz/eaaf_components!23
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.java92
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..812a5171
--- /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;
+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<String> logOnInfoLevel);
+ }
+}