From 7e2f79375c043bfba205a2c2a69dad5cbb9ab8f4 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Thu, 1 Jun 2023 10:52:14 +0200 Subject: refact(core): change custom object-serialization to protected to re-use it in specific AuthSession implementations --- .../impl/idp/auth/data/AuthProcessDataWrapper.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/AuthProcessDataWrapper.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/AuthProcessDataWrapper.java index dc391902..526edda6 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/AuthProcessDataWrapper.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/AuthProcessDataWrapper.java @@ -427,7 +427,14 @@ public class AuthProcessDataWrapper } - private Object objectSaveJsonSerialization(Object object) throws EaafStorageException { + /** + * Object save JSON serialization of arbitrary objects. + * + * @param object Element to store + * @return Object for putting into cache + * @throws EaafStorageException In case of a JSON serialization error + */ + protected final Object objectSaveJsonSerialization(Object object) throws EaafStorageException { try { if (object == null || object instanceof String || object instanceof Boolean || object instanceof Integer) { @@ -446,6 +453,23 @@ public class AuthProcessDataWrapper } } + /** + * Object save JSON serialization of arbitrary objects. + * + * @param object Element to store + * @return Object for putting into cache + */ + protected final Object failSaveObjectSaveJsonSerialization(Object object) { + try { + return objectSaveJsonSerialization(object); + + } catch (EaafStorageException e) { + log.error("Can not store object: {} into session. Return null ... ", object.getClass().getName(), e); + return null; + + } + } + private Object objectSaveJsonDeserialization(Object data) { try { if (data == null) { -- cgit v1.2.3