summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java74
1 files changed, 24 insertions, 50 deletions
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 a0ac57d1..099aa180 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
@@ -29,7 +29,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.util.SerializationUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -85,32 +84,23 @@ public class ProtocolFinalizationController extends AbstractController {
log.debug("Searching exception with internal error-token: {}", errorId);
// load stored exception from database
- final byte[] containerSerialized = transactionStorage.get(errorId, byte[].class);
- if (containerSerialized != null) {
+ final ExceptionContainer container = transactionStorage.get(errorId, ExceptionContainer.class);
+ if (container != null) {
// remove exception if it was found
transactionStorage.remove(errorId);
log.trace("Find exception with internal error-token: {}", errorId);
- //final Object containerObj = EaafSerializationUtils.deserialize(containerSerialized,
- // Arrays.asList(
- // ExceptionContainer.class.getName()
- // ));
- final Object containerObj = SerializationUtils.deserialize(containerSerialized);
-
- if (containerObj instanceof ExceptionContainer) {
- final ExceptionContainer container = (ExceptionContainer) containerObj;
- final Throwable throwable = container.getExceptionThrown();
- pendingReq = container.getPendingRequest();
-
- if (pendingReq != null) {
- IModulInfo handlingModule = ProtocolAuthenticationService
- .extractShibbolethHandling(pendingReq, applicationContext);
- if (!handlingModule.generateErrorMessage(throwable, req, resp, pendingReq)) {
- protAuthService.handleErrorNoRedirect(new EaafException("process.90", null), req, resp, false);
-
- }
+ final Throwable throwable = container.getExceptionThrown();
+ pendingReq = container.getPendingRequest();
+
+ if (pendingReq != null) {
+ IModulInfo handlingModule = ProtocolAuthenticationService
+ .extractShibbolethHandling(pendingReq, applicationContext);
+ if (!handlingModule.generateErrorMessage(throwable, req, resp, pendingReq)) {
+ protAuthService.handleErrorNoRedirect(new EaafException("process.90", null), req, resp, false);
+
}
- }
+ }
} else {
log.info("Find no exception with internal error-token: {}", errorId);
protAuthService
@@ -162,45 +152,29 @@ public class ProtocolFinalizationController extends AbstractController {
log.debug("Searching exception with internal error-token: {}", errorId);
// load stored exception from database
- final byte[] containerSerialized = transactionStorage.get(errorId, byte[].class);
- if (containerSerialized != null) {
+ final ExceptionContainer container = transactionStorage.get(errorId, ExceptionContainer.class);
+ if (container != null) {
// remove exception if it was found
transactionStorage.remove(errorId);
log.trace("Find exception with internal error-token: {}", errorId);
- //final Object containerObj = EaafSerializationUtils.deserialize(containerSerialized,
- // Arrays.asList(
- // ExceptionContainer.class.getName()
- // ));
- final Object containerObj = SerializationUtils.deserialize(containerSerialized);
-
- if (containerObj instanceof ExceptionContainer) {
- final ExceptionContainer container = (ExceptionContainer) containerObj;
- final Throwable throwable = container.getExceptionThrown();
- pendingReq = container.getPendingRequest();
+ final Throwable throwable = container.getExceptionThrown();
+ pendingReq = container.getPendingRequest();
- if (pendingReq != null) {
- //set MDC variables
- TransactionIdUtils.setAllLoggingVariables(pendingReq);
+ if (pendingReq != null) {
+ // set MDC variables
+ TransactionIdUtils.setAllLoggingVariables(pendingReq);
- // build protocol-specific error message if possible
- protAuthService.buildProtocolSpecificErrorResponse(throwable, req, resp, pendingReq);
+ // build protocol-specific error message if possible
+ protAuthService.buildProtocolSpecificErrorResponse(throwable, req, resp, pendingReq);
- // remove active user-session
- transactionStorage.remove(pendingReq.getPendingRequestId());
-
- } else {
- protAuthService.handleErrorNoRedirect(throwable, req, resp, true);
-
- }
+ // remove active user-session
+ transactionStorage.remove(pendingReq.getPendingRequestId());
} else {
- protAuthService
- .handleErrorNoRedirect(new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC, null), req,
- resp, false);
+ protAuthService.handleErrorNoRedirect(throwable, req, resp, true);
}
-
} else {
log.info("Find no exception with internal error-token: {}", errorId);
protAuthService