diff options
author | Thomas <thomas.lenz@egiz.gv.at> | 2019-10-16 15:06:48 +0200 |
---|---|---|
committer | Thomas <thomas.lenz@egiz.gv.at> | 2019-10-16 15:06:48 +0200 |
commit | eb96b99fa4e72eeba245a2b0c81a9f6a32002866 (patch) | |
tree | fe840e6437526a9c985c9869d391ca84494b651e /eaaf_core/src | |
parent | fe41a2e6e0e2b9eb37515a63ff84aff827733386 (diff) | |
download | EAAF-Components-eb96b99fa4e72eeba245a2b0c81a9f6a32002866.tar.gz EAAF-Components-eb96b99fa4e72eeba245a2b0c81a9f6a32002866.tar.bz2 EAAF-Components-eb96b99fa4e72eeba245a2b0c81a9f6a32002866.zip |
Refactor AbstractLocaleAuthServletTask to faciltite 'processStop' in child classes
Diffstat (limited to 'eaaf_core/src')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java index e80a63e9..e8f2bb90 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java @@ -41,22 +41,9 @@ public abstract class AbstractLocaleAuthServletTask extends AbstractAuthServletT final String stopAuthFlag = request.getParameter(EAAFConstants.PARAM_HTTP_STOP_PROCESS); if (StringUtils.isNotEmpty(stopAuthFlag) && Boolean.parseBoolean(stopAuthFlag)) { - try { - log.info("Authentication process WAS stopped by entity. Stopping auth. process ... "); - revisionsLogger.logEvent(pendingReq, EAAFEventCodes.PROCESS_STOPPED_BY_USER); - pendingReq.setAbortedByUser(true); - pendingReq.setAuthenticated(false); - performRedirectToProtocolFinialization(executionContext, pendingReq, request, response); - - } catch (final EAAFException e) { - throw new TaskExecutionException(pendingReq, e.getMessage(), e); - - } catch (final Exception e) { - log.warn("Stopping auth.process FAILED", e); - throw new TaskExecutionException(pendingReq, e.getMessage(), e); - - } - + log.info("Authentication process WAS stopped by entity. Stopping auth. process ... "); + stopProcessFromUserDecision(executionContext, request, response); + } else executeWithLocale(executionContext, request, response); @@ -64,6 +51,24 @@ public abstract class AbstractLocaleAuthServletTask extends AbstractAuthServletT } + protected void stopProcessFromUserDecision(ExecutionContext executionContext, HttpServletRequest request, HttpServletResponse response) throws TaskExecutionException { + try { + revisionsLogger.logEvent(pendingReq, EAAFEventCodes.PROCESS_STOPPED_BY_USER); + pendingReq.setAbortedByUser(true); + pendingReq.setAuthenticated(false); + performRedirectToProtocolFinialization(executionContext, pendingReq, request, response); + + } catch (final EAAFException e) { + throw new TaskExecutionException(pendingReq, e.getMessage(), e); + + } catch (final Exception e) { + log.warn("Stopping auth.process FAILED", e); + throw new TaskExecutionException(pendingReq, e.getMessage(), e); + + } + + } + protected abstract void executeWithLocale(ExecutionContext executionContext, HttpServletRequest request, HttpServletResponse response) throws TaskExecutionException; |