diff options
author | Thomas <> | 2023-06-01 10:52:14 +0200 |
---|---|---|
committer | Thomas <> | 2023-06-01 10:52:14 +0200 |
commit | 7e2f79375c043bfba205a2c2a69dad5cbb9ab8f4 (patch) | |
tree | 8ba44da0b2a2337cb824748e7922a2a2ec8be652 | |
parent | b182f8ec4d0cf247a6846408f37bfe3a28d71342 (diff) | |
download | EAAF-Components-7e2f79375c043bfba205a2c2a69dad5cbb9ab8f4.tar.gz EAAF-Components-7e2f79375c043bfba205a2c2a69dad5cbb9ab8f4.tar.bz2 EAAF-Components-7e2f79375c043bfba205a2c2a69dad5cbb9ab8f4.zip |
refact(core): change custom object-serialization to protected to re-use it in specific AuthSession implementations
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/AuthProcessDataWrapper.java | 26 |
1 files changed, 25 insertions, 1 deletions
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) { |