diff options
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java | 31 |
1 files changed, 27 insertions, 4 deletions
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 5667fad7..f037f4ab 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 @@ -35,13 +35,13 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import javax.naming.ConfigurationException; 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 at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.data.EAAFConstants; @@ -96,14 +96,37 @@ public abstract class RequestImpl implements IRequest, Serializable{ private final Map<String, Object> genericDataStorage = new HashMap<String, Object>(); + /** + * Initialize this pendingRequest object + * + * @param req {@link HttpServletRequest} + * @param authConfig {@link IConfiguration} + * @throws EAAFException + * + */ + public final void initialize(HttpServletRequest req, IConfiguration authConfig) throws EAAFException { + initialize(req, authConfig, null); + + } /** - * @throws ConfigurationException + * 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 + * + * @throws EAAFException * */ - public final void initialize(HttpServletRequest req, IConfiguration authConfig) throws EAAFException { + public final void initialize(@NonNull HttpServletRequest req, @NonNull IConfiguration authConfig, @Nullable String transactionId) throws EAAFException { + //use external transactionId or create new one if empty or null + if (StringUtils.isNotEmpty(transactionId)) + uniqueTransactionIdentifer = transactionId; + else + uniqueTransactionIdentifer = Random.nextLongRandom(); + //set unique transaction identifier for logging - uniqueTransactionIdentifer = Random.nextLongRandom(); TransactionIDUtils.setTransactionId(uniqueTransactionIdentifer); //initialize session object |