summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller
diff options
context:
space:
mode:
authorThomas <thomas.lenz@egiz.gv.at>2019-12-05 09:52:48 +0100
committerThomas <thomas.lenz@egiz.gv.at>2019-12-05 09:52:48 +0100
commit3fada6cef21c9b16467177d866df778203b51b4d (patch)
tree8fe8ed37b6ee9fe35a1e035ceba6c68808328415 /eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller
parent95b21a826e5d81fdeabcf4673a9e87047edaec9d (diff)
downloadEAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.tar.gz
EAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.tar.bz2
EAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.zip
some code code-style modifications
active code-quality checks!
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java59
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractProcessEngineSignalController.java27
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java35
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java48
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java16
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/FinalizeAuthenticationTask.java19
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/RestartAuthProzessManagement.java25
7 files changed, 120 insertions, 109 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
index b15dfeba..c09efc37 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
@@ -20,12 +20,21 @@
package at.gv.egiz.eaaf.core.impl.idp.controller;
import java.io.IOException;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+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.web.bind.annotation.ExceptionHandler;
+
import at.gv.egiz.components.eventlog.api.EventConstants;
import at.gv.egiz.eaaf.core.api.IRequest;
import at.gv.egiz.eaaf.core.api.IStatusMessenger;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
import at.gv.egiz.eaaf.core.api.data.ExceptionContainer;
import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP;
import at.gv.egiz.eaaf.core.api.idp.auth.services.IProtocolAuthenticationService;
@@ -37,13 +46,6 @@ import at.gv.egiz.eaaf.core.exceptions.ProcessExecutionException;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.utils.Random;
import at.gv.egiz.eaaf.core.impl.utils.ServletUtils;
-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.web.bind.annotation.ExceptionHandler;
-
/**
* Basic application controller that implements core error-handling.
@@ -72,16 +74,16 @@ public abstract class AbstractController {
/**
* EAAF framework exception handler.
*
- *<p>
- *This handler start a protocol-specific error handling.
- *</p>
+ * <p>
+ * This handler start a protocol-specific error handling.
+ * </p>
*
- * @param req http request
+ * @param req http request
* @param resp http response
- * @param e exception
+ * @param e exception
* @throws IOException in case of an exception handling error
*/
- @ExceptionHandler({EaafException.class})
+ @ExceptionHandler({ EaafException.class })
public void eaafExceptionHandler(final HttpServletRequest req, final HttpServletResponse resp,
final Exception e) throws IOException {
try {
@@ -102,15 +104,15 @@ public abstract class AbstractController {
* This handler wrote an internal server error into http response
* </p>
*
- * @param resp http response
+ * @param resp http response
* @param exception exception
* @throws IOException In case of an internal error.
*/
- @ExceptionHandler({Exception.class})
+ @ExceptionHandler({ Exception.class })
public void genericExceptionHandler(final HttpServletResponse resp, final Exception exception)
throws IOException {
log.error("Internel Server Error.", exception);
- resp.setContentType(EAAFConstants.CONTENTTYPE_HTML_UTF8);
+ resp.setContentType(EaafConstants.CONTENTTYPE_HTML_UTF8);
resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Internal Server Error!"
+ "(Errorcode=9199" + " | Description="
+ StringEscapeUtils.escapeHtml4(StringEscapeUtils.escapeEcmaScript(exception.getMessage()))
@@ -125,13 +127,13 @@ public abstract class AbstractController {
* This handler wrote an internal server error into http response
* </p>
*
- * @param resp http response
+ * @param resp http response
* @param exception exception
*/
- @ExceptionHandler({IOException.class})
+ @ExceptionHandler({ IOException.class })
public void ioExceptionHandler(final HttpServletResponse resp, final Throwable exception) {
log.error("Internel Server Error.", exception);
- resp.setContentType(EAAFConstants.CONTENTTYPE_HTML_UTF8);
+ resp.setContentType(EaafConstants.CONTENTTYPE_HTML_UTF8);
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
@@ -144,7 +146,8 @@ public abstract class AbstractController {
final Throwable extractedException =
extractOriginalExceptionFromProcessException(exceptionThrown);
- // extract pendingRequestID and originalException if it was a TaskExecutionException
+ // extract pendingRequestID and originalException if it was a
+ // TaskExecutionException
if (extractedException instanceof TaskExecutionException) {
// set original exception
loggedException = ((TaskExecutionException) extractedException).getOriginalException();
@@ -164,14 +167,14 @@ public abstract class AbstractController {
}
try {
- // switch to protocol-finalize method to generate a protocol-specific error message
+ // switch to protocol-finalize method to generate a protocol-specific error
+ // message
// log error directly in debug mode
if (log.isDebugEnabled()) {
log.warn(loggedException.getMessage(), loggedException);
}
-
// put exception into transaction store for redirect
final String key = Random.nextLongRandom();
if (pendingReq != null) {
@@ -187,7 +190,7 @@ public abstract class AbstractController {
String redirectUrl = null;
redirectUrl = ServletUtils.getBaseUrl(req);
redirectUrl += "/" + ProtocolFinalizationController.ENDPOINT_ERRORHANDLING + "?"
- + EAAFConstants.PARAM_HTTP_ERROR_CODE + "=" + key;
+ + EaafConstants.PARAM_HTTP_ERROR_CODE + "=" + key;
resp.setContentType("text/html");
resp.setStatus(302);
@@ -206,14 +209,12 @@ public abstract class AbstractController {
}
-
-
/**
* Extracts a TaskExecutionException of a ProcessExecutionExeception Stacktrace.
*
* @param exception error
- * @return Return the latest TaskExecutionExecption if exists, otherwise the latest
- * ProcessExecutionException
+ * @return Return the latest TaskExecutionExecption if exists, otherwise the
+ * latest ProcessExecutionException
*/
private Throwable extractOriginalExceptionFromProcessException(final Throwable exception) {
Throwable exholder = exception;
@@ -238,6 +239,4 @@ public abstract class AbstractController {
}
}
-
-
}
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractProcessEngineSignalController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractProcessEngineSignalController.java
index 9ff468d3..098bca4c 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractProcessEngineSignalController.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractProcessEngineSignalController.java
@@ -20,20 +20,23 @@
package at.gv.egiz.eaaf.core.impl.idp.controller;
import java.io.IOException;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.text.StringEscapeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
import at.gv.egiz.eaaf.core.api.IRequest;
import at.gv.egiz.eaaf.core.api.IRequestStorage;
import at.gv.egiz.eaaf.core.api.IStatusMessenger;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
import at.gv.egiz.eaaf.core.api.idp.process.ProcessEngine;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import at.gv.egiz.eaaf.core.exceptions.EaafIllegalStateException;
import at.gv.egiz.eaaf.core.impl.utils.TransactionIdUtils;
-import org.apache.commons.text.StringEscapeUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
/**
* Servlet that resumes a suspended process (in case of asynchronous tasks).
@@ -65,7 +68,7 @@ public abstract class AbstractProcessEngineSignalController extends AbstractCont
log.info("No PendingRequest with Id: " + pendingRequestID
+ " Maybe, a transaction timeout occure.");
throw new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_AUTH_TIMEOUT,
- new Object[] {pendingRequestID});
+ new Object[] { pendingRequestID });
}
@@ -75,7 +78,7 @@ public abstract class AbstractProcessEngineSignalController extends AbstractCont
// process instance is mandatory
if (pendingReq.getProcessInstanceId() == null) {
throw new EaafIllegalStateException(
- new Object[] {"MOA session does not provide process instance id."});
+ new Object[] { "MOA session does not provide process instance id." });
}
@@ -91,22 +94,22 @@ public abstract class AbstractProcessEngineSignalController extends AbstractCont
}
-
}
/**
- * Retrieves the current pending-request id from the HttpServletRequest parameter
+ * Retrieves the current pending-request id from the HttpServletRequest
+ * parameter
*
* <p/>
- * Note that this class/method can be overwritten by modules providing their own strategy of
- * retrieving the respective pending-request id.
+ * Note that this class/method can be overwritten by modules providing their own
+ * strategy of retrieving the respective pending-request id.
*
* @param request The unterlying HttpServletRequest.
* @return The current pending-request id.
*/
public String getPendingRequestId(final HttpServletRequest request) {
return StringEscapeUtils
- .escapeHtml4(request.getParameter(EAAFConstants.PARAM_HTTP_TARGET_PENDINGREQUESTID));
+ .escapeHtml4(request.getParameter(EaafConstants.PARAM_HTTP_TARGET_PENDINGREQUESTID));
}
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
index 7b350c3b..51a8aefd 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
@@ -20,15 +20,10 @@
package at.gv.egiz.eaaf.core.impl.idp.controller;
import java.io.IOException;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import at.gv.egiz.components.eventlog.api.EventConstants;
-import at.gv.egiz.eaaf.core.api.IRequest;
-import at.gv.egiz.eaaf.core.api.IRequestStorage;
-import at.gv.egiz.eaaf.core.api.IStatusMessenger;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
-import at.gv.egiz.eaaf.core.api.data.ExceptionContainer;
-import at.gv.egiz.eaaf.core.exceptions.EaafException;
+
import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,6 +32,14 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import at.gv.egiz.components.eventlog.api.EventConstants;
+import at.gv.egiz.eaaf.core.api.IRequest;
+import at.gv.egiz.eaaf.core.api.IRequestStorage;
+import at.gv.egiz.eaaf.core.api.IStatusMessenger;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
+import at.gv.egiz.eaaf.core.api.data.ExceptionContainer;
+import at.gv.egiz.eaaf.core.exceptions.EaafException;
+
/**
* Protocol finialization end-point.
*
@@ -55,17 +58,17 @@ public class ProtocolFinalizationController extends AbstractController {
/**
* End-Point to handle errors.
*
- * @param req http request
+ * @param req http request
* @param resp http response
* @throws EaafException In case of an internal error
- * @throws IOException In case of a servlet error
+ * @throws IOException In case of a servlet error
*/
- @RequestMapping(value = ENDPOINT_ERRORHANDLING, method = {RequestMethod.GET})
+ @RequestMapping(value = ENDPOINT_ERRORHANDLING, method = { RequestMethod.GET })
public void errorHandling(final HttpServletRequest req, final HttpServletResponse resp)
throws EaafException, IOException {
// receive an authentication error
final String errorid =
- StringEscapeUtils.escapeHtml4(req.getParameter(EAAFConstants.PARAM_HTTP_ERROR_CODE));
+ StringEscapeUtils.escapeHtml4(req.getParameter(EaafConstants.PARAM_HTTP_ERROR_CODE));
if (errorid != null) {
IRequest pendingReq = null;
try {
@@ -127,25 +130,25 @@ public class ProtocolFinalizationController extends AbstractController {
/**
* End-Point to finalize authentication protocol.
*
- * @param req http request
+ * @param req http request
* @param resp http response
* @throws EaafException In case of an internal error
- * @throws IOException In case of a servlet error
+ * @throws IOException In case of a servlet error
*/
- @RequestMapping(value = ENDPOINT_FINALIZEPROTOCOL, method = {RequestMethod.GET})
+ @RequestMapping(value = ENDPOINT_FINALIZEPROTOCOL, method = { RequestMethod.GET })
public void finalizeAuthProtocol(final HttpServletRequest req, final HttpServletResponse resp)
throws EaafException, IOException {
// read pendingRequest from http request
final String pendingRequestID = StringEscapeUtils
- .escapeHtml4(req.getParameter(EAAFConstants.PARAM_HTTP_TARGET_PENDINGREQUESTID));
+ .escapeHtml4(req.getParameter(EaafConstants.PARAM_HTTP_TARGET_PENDINGREQUESTID));
final IRequest pendingReq = requestStorage.getPendingRequest(pendingRequestID);
if (pendingReq == null) {
log.error("No PendingRequest with ID " + pendingRequestID + " found.!");
protAuthService.handleErrorNoRedirect(
new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_AUTH_TIMEOUT,
- new Object[] {pendingRequestID,}),
+ new Object[] { pendingRequestID, }),
req, resp, false);
} else {
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java
index 88dae874..07fc652a 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java
@@ -28,13 +28,22 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
+
import javax.annotation.Nonnull;
import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.lang.NonNull;
+import org.springframework.lang.Nullable;
+import org.springframework.util.Assert;
+
import at.gv.egiz.eaaf.core.api.IRequest;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
import at.gv.egiz.eaaf.core.api.idp.IConfiguration;
import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP;
-import at.gv.egiz.eaaf.core.api.idp.IspConfiguration;
+import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration;
import at.gv.egiz.eaaf.core.exceptions.EaafAuthenticationException;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import at.gv.egiz.eaaf.core.exceptions.EaafStorageException;
@@ -42,12 +51,6 @@ import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper;
import at.gv.egiz.eaaf.core.impl.utils.HttpUtils;
import at.gv.egiz.eaaf.core.impl.utils.Random;
import at.gv.egiz.eaaf.core.impl.utils.TransactionIdUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.lang.NonNull;
-import org.springframework.lang.Nullable;
-import org.springframework.util.Assert;
public abstract class RequestImpl implements IRequest, Serializable {
@@ -70,7 +73,7 @@ public abstract class RequestImpl implements IRequest, Serializable {
private String requestedServiceProviderIdentifer;
private String idpAuthUrl = null;
- private IspConfiguration spConfiguration = null;
+ private ISpConfiguration spConfiguration = null;
private boolean passiv = false;
private boolean force = false;
@@ -89,11 +92,10 @@ public abstract class RequestImpl implements IRequest, Serializable {
private final Map<String, Object> genericDataStorage = new HashMap<>();
-
/**
* Initialize this pendingRequest object.
*
- * @param req {@link HttpServletRequest}
+ * @param req {@link HttpServletRequest}
* @param authConfig {@link IConfiguration}
* @throws EaafException
*
@@ -107,10 +109,10 @@ public abstract class RequestImpl implements IRequest, Serializable {
/**
* Initialize this pendingRequest object.
*
- * @param req {@link HttpServletRequest}
- * @param authConfig {@link IConfiguration}
- * @param transactionId transactionId that should be used in this pendingRequest for logging. If
- * 'null' a new one will be generated
+ * @param req {@link HttpServletRequest}
+ * @param authConfig {@link IConfiguration}
+ * @param transactionId transactionId that should be used in this pendingRequest
+ * for logging. If 'null' a new one will be generated
*
* @throws EaafException
*
@@ -129,8 +131,9 @@ public abstract class RequestImpl implements IRequest, Serializable {
TransactionIdUtils.setTransactionId(uniqueTransactionIdentifer);
// initialize session object
- genericDataStorage.put(EAAFConstants.AUTH_DATA_CREATED, new Date());
- // genericDataStorage.put(EAAFConstants.VALUE_SESSIONID, Random.nextLongRandom());
+ genericDataStorage.put(EaafConstants.AUTH_DATA_CREATED, new Date());
+ // genericDataStorage.put(EAAFConstants.VALUE_SESSIONID,
+ // Random.nextLongRandom());
// check if End-Point is valid
final String authUrlString = HttpUtils.extractAuthUrlFromRequest(req);
@@ -140,19 +143,19 @@ public abstract class RequestImpl implements IRequest, Serializable {
} catch (final MalformedURLException e) {
log.error("IDP AuthenticationServiceURL Prefix is not a valid URL." + authUrlString, e);
- throw new EaafAuthenticationException("errorId", new Object[] {authUrlString}, e);
+ throw new EaafAuthenticationException("errorId", new Object[] { authUrlString }, e);
}
this.idpAuthUrl = authConfig.validateIdpUrl(authReqUrl);
if (this.idpAuthUrl == null) {
log.warn(
"Extract AuthenticationServiceURL: " + authReqUrl + " is NOT found in configuration.");
- throw new EaafAuthenticationException("errorId", new Object[] {authUrlString});
+ throw new EaafAuthenticationException("errorId", new Object[] { authUrlString });
}
// set unique session identifier
- final String uniqueID = (String) req.getAttribute(EAAFConstants.UNIQUESESSIONIDENTIFIER);
+ final String uniqueID = (String) req.getAttribute(EaafConstants.UNIQUESESSIONIDENTIFIER);
if (StringUtils.isNotEmpty(uniqueID)) {
this.uniqueSessionIdentifer = uniqueID;
} else {
@@ -267,10 +270,9 @@ public abstract class RequestImpl implements IRequest, Serializable {
}
@Override
- public final IspConfiguration getServiceProviderConfiguration() {
+ public final ISpConfiguration getServiceProviderConfiguration() {
return this.spConfiguration;
-
}
@Override
@@ -291,7 +293,7 @@ public abstract class RequestImpl implements IRequest, Serializable {
}
- public void setOnlineApplicationConfiguration(final IspConfiguration spConfig) {
+ public void setOnlineApplicationConfiguration(final ISpConfiguration spConfig) {
this.spConfiguration = spConfig;
}
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 3c8fd604..dcd5a1d1 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
@@ -10,8 +10,8 @@ import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
-import at.gv.egiz.eaaf.core.api.data.EAAFEventCodes;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
+import at.gv.egiz.eaaf.core.api.data.EaafEventCodes;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
@@ -28,22 +28,20 @@ public abstract class AbstractLocaleAuthServletTask extends AbstractAuthServletT
throws TaskExecutionException {
final Serializable changeLangFlag =
- executionContext.get(EAAFConstants.PROCESSCONTEXT_SWITCH_LANGUAGE);
+ executionContext.get(EaafConstants.PROCESSCONTEXT_SWITCH_LANGUAGE);
final String localeParam =
StringEscapeUtils.escapeHtml4(request.getParameter(PROP_REQ_PARAM_LOCALE));
if (StringUtils.isNotEmpty(localeParam)
&& (changeLangFlag == null || !((Boolean) changeLangFlag))) {
log.debug("Find {} parameter. Reload last task with new locale: {}", PROP_REQ_PARAM_LOCALE,
localeParam);
- executionContext.put(EAAFConstants.PROCESSCONTEXT_SWITCH_LANGUAGE, true);
-
-
+ executionContext.put(EaafConstants.PROCESSCONTEXT_SWITCH_LANGUAGE, true);
} else {
log.trace("Find {} parameter. Processing this task ... ", PROP_REQ_PARAM_LOCALE);
- executionContext.put(EAAFConstants.PROCESSCONTEXT_SWITCH_LANGUAGE, false);
+ executionContext.put(EaafConstants.PROCESSCONTEXT_SWITCH_LANGUAGE, false);
- if (parseFlagFromHttpRequest(request, EAAFConstants.PARAM_HTTP_STOP_PROCESS, false)) {
+ if (parseFlagFromHttpRequest(request, EaafConstants.PARAM_HTTP_STOP_PROCESS, false)) {
log.info("Authentication process WAS stopped by entity. Stopping auth. process ... ");
stopProcessFromUserDecision(executionContext, request, response);
@@ -59,7 +57,7 @@ public abstract class AbstractLocaleAuthServletTask extends AbstractAuthServletT
final HttpServletRequest request, final HttpServletResponse response)
throws TaskExecutionException {
try {
- revisionsLogger.logEvent(pendingReq, EAAFEventCodes.PROCESS_STOPPED_BY_USER);
+ revisionsLogger.logEvent(pendingReq, EaafEventCodes.PROCESS_STOPPED_BY_USER);
pendingReq.setAbortedByUser(true);
pendingReq.setAuthenticated(false);
performRedirectToProtocolFinialization(executionContext, pendingReq, request, response);
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/FinalizeAuthenticationTask.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/FinalizeAuthenticationTask.java
index 7991c093..892121c0 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/FinalizeAuthenticationTask.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/FinalizeAuthenticationTask.java
@@ -21,15 +21,17 @@ package at.gv.egiz.eaaf.core.impl.idp.controller.tasks;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
import at.gv.egiz.eaaf.core.api.idp.auth.IAuthenticationManager;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.idp.auth.modules.AbstractAuthServletTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
/**
* Finalize the authentication process-flow.
@@ -45,9 +47,9 @@ public class FinalizeAuthenticationTask extends AbstractAuthServletTask {
/*
* (non-Javadoc)
*
- * @see
- * at.gv.egovernment.moa.id.process.springweb.MoaIdTask#execute(at.gv.egovernment.moa.id.process.
- * api.ExecutionContext, javax.servlet.http.HttpServletRequest,
+ * @see at.gv.egovernment.moa.id.process.springweb.MoaIdTask#execute(at.gv.
+ * egovernment.moa.id.process. api.ExecutionContext,
+ * javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
@Override
@@ -61,7 +63,6 @@ public class FinalizeAuthenticationTask extends AbstractAuthServletTask {
IAuthenticationManager.EVENT_AUTHENTICATION_PROCESS_FINISHED);
performRedirectToProtocolFinialization(executionContext, pendingReq, request, response);
-
} catch (final EaafException e) {
throw new TaskExecutionException(pendingReq, e.getMessage(), e);
@@ -70,7 +71,7 @@ public class FinalizeAuthenticationTask extends AbstractAuthServletTask {
throw new TaskExecutionException(pendingReq, e.getMessage(), e);
} finally {
- executionContext.remove(EAAFConstants.PROCESS_ENGINE_PENDINGREQUESTID);
+ executionContext.remove(EaafConstants.PROCESS_ENGINE_PENDINGREQUESTID);
}
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/RestartAuthProzessManagement.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/RestartAuthProzessManagement.java
index 7a2c5f08..328a25c5 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/RestartAuthProzessManagement.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/RestartAuthProzessManagement.java
@@ -20,8 +20,15 @@
package at.gv.egiz.eaaf.core.impl.idp.controller.tasks;
import java.util.Set;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
import at.gv.egiz.eaaf.core.api.idp.process.ProcessEngine;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
@@ -30,10 +37,6 @@ import at.gv.egiz.eaaf.core.impl.idp.auth.modules.AbstractAuthServletTask;
import at.gv.egiz.eaaf.core.impl.idp.auth.modules.ModuleRegistration;
import at.gv.egiz.eaaf.core.impl.idp.controller.protocols.RequestImpl;
import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
/**
* Restart the authentication process-flow.
@@ -45,15 +48,17 @@ import org.springframework.stereotype.Component;
public class RestartAuthProzessManagement extends AbstractAuthServletTask {
private static final Logger log = LoggerFactory.getLogger(RestartAuthProzessManagement.class);
- @Autowired ProcessEngine processEngine;
- @Autowired ModuleRegistration moduleRegistration;
+ @Autowired
+ ProcessEngine processEngine;
+ @Autowired
+ ModuleRegistration moduleRegistration;
/*
* (non-Javadoc)
*
- * @see
- * at.gv.egovernment.moa.id.process.springweb.MoaIdTask#execute(at.gv.egovernment.moa.id.process.
- * api.ExecutionContext, javax.servlet.http.HttpServletRequest,
+ * @see at.gv.egovernment.moa.id.process.springweb.MoaIdTask#execute(at.gv.
+ * egovernment.moa.id.process. api.ExecutionContext,
+ * javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
@Override
@@ -82,7 +87,7 @@ public class RestartAuthProzessManagement extends AbstractAuthServletTask {
if (processDefinitionId == null) {
log.warn("No suitable authentication process found for SessionID "
+ pendingReq.getPendingRequestId());
- throw new EaafException("process.02", new Object[] {pendingReq.getPendingRequestId()});
+ throw new EaafException("process.02", new Object[] { pendingReq.getPendingRequestId() });
}
final String processInstanceId =