summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-07-01 12:40:24 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-07-01 12:40:24 +0200
commitfd6ffb7bf3ffbc00bb96c0eb215d89edbbb021e3 (patch)
tree9d30caea5b5099d1f0fe289b4d44771c6d5f3362 /eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
parent234cee5815f8688d45146b792ebe3c8015a7dc74 (diff)
downloadEAAF-Components-fd6ffb7bf3ffbc00bb96c0eb215d89edbbb021e3.tar.gz
EAAF-Components-fd6ffb7bf3ffbc00bb96c0eb215d89edbbb021e3.tar.bz2
EAAF-Components-fd6ffb7bf3ffbc00bb96c0eb215d89edbbb021e3.zip
update log message in case of SL2.0 VDA connection error
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
index fbf19429..72fa1faf 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
@@ -29,17 +29,6 @@ import javax.naming.ConfigurationException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.text.StringEscapeUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.lang.NonNull;
-import org.springframework.lang.Nullable;
-import org.springframework.stereotype.Service;
-
import at.gv.egiz.components.eventlog.api.EventConstants;
import at.gv.egiz.eaaf.core.api.IRequest;
import at.gv.egiz.eaaf.core.api.IRequestStorage;
@@ -76,6 +65,17 @@ import at.gv.egiz.eaaf.core.impl.idp.controller.ProtocolFinalizationController;
import at.gv.egiz.eaaf.core.impl.idp.controller.protocols.RequestImpl;
import at.gv.egiz.eaaf.core.impl.utils.ServletUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.text.StringEscapeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.lang.NonNull;
+import org.springframework.lang.Nullable;
+import org.springframework.stereotype.Service;
+
@Service
public class ProtocolAuthenticationService implements IProtocolAuthenticationService {
private static final Logger log = LoggerFactory.getLogger(ProtocolAuthenticationService.class);
@@ -213,7 +213,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
revisionsLogger.logEvent(EventConstants.TRANSACTION_DESTROYED,
pendingReq.getUniqueTransactionIdentifier());
}
-
+
}
@Override
@@ -276,6 +276,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
// return error to Web browser
if (throwable instanceof EaafException || throwable instanceof ProcessExecutionException) {
internalMoaidExceptionHandler(req, resp, (Exception) throwable, false);
+
} else {
// write generic message for general exceptions
final String msg =
@@ -289,34 +290,34 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
@Override
public void forwardToErrorHandler(Pair<IRequest, Throwable> errorToHandle, String errorKey,
final HttpServletRequest req, final HttpServletResponse resp) throws GuiBuildException {
- IGuiBuilderConfiguration parentHopGuiConfig =
+ final IGuiBuilderConfiguration parentHopGuiConfig =
evaluateRequiredErrorHandlingMethod(errorToHandle.getFirst(), errorKey);
if (parentHopGuiConfig != null) {
log.trace("iFrame to parent hop requested. Building GUI step for error handling ... ");
guiBuilder.build(req, resp, parentHopGuiConfig, "iFrame-to-parent");
-
- } else {
+
+ } else {
// build up redirect URL
final String redirectUrl = generateErrorRedirectUrl(req, errorKey);
resp.setContentType("text/html");
resp.setStatus(302);
resp.addHeader("Location", redirectUrl);
log.debug("REDIRECT TO: " + redirectUrl);
-
+
}
}
-
+
private IGuiBuilderConfiguration evaluateRequiredErrorHandlingMethod(IRequest first, String errorId) {
if (first != null && first.isProcessInIframe()) {
- return guiConfigFactory.getDefaultIFrameParentHopGui(first,
+ return guiConfigFactory.getDefaultIFrameParentHopGui(first,
"/" + ProtocolFinalizationController.ENDPOINT_ERRORHANDLING,
errorId);
-
+
}
return null;
}
-
+
private String generateErrorRedirectUrl(final HttpServletRequest req, String errorKey) {
String redirectUrl = null;
redirectUrl = ServletUtils.getBaseUrl(req);
@@ -325,7 +326,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
return redirectUrl;
}
-
+
public void setGuiBuilder(final IGuiFormBuilder guiBuilder) {
this.guiBuilder = guiBuilder;
}