[java-opensaml] 01/02: IDP-1793 Use Suppliers for HttpRequest/Response

Rod Widdowson rdw at steadingsoftware.com
Sun Aug 14 14:05:32 UTC 2022


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=83151aa149111702ac8664c9af98a9ec725f1705

commit 83151aa149111702ac8664c9af98a9ec725f1705
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Jul 31 14:18:51 2022 +0100

    IDP-1793  Use Suppliers for HttpRequest/Response
    
    https://shibboleth.atlassian.net/browse/IDP-1793
    
    org.opensaml.messaging.decoder.servlet.HttpServletRequestMessageDecoder
    (an API interface) gains a setter for a Supplier for the HttpServletRequest
---
 .../servlet/HttpServletRequestMessageDecoder.java       | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/opensaml-messaging-api/src/main/java/org/opensaml/messaging/decoder/servlet/HttpServletRequestMessageDecoder.java b/opensaml-messaging-api/src/main/java/org/opensaml/messaging/decoder/servlet/HttpServletRequestMessageDecoder.java
index 49b14ce25..07edbfbbf 100644
--- a/opensaml-messaging-api/src/main/java/org/opensaml/messaging/decoder/servlet/HttpServletRequestMessageDecoder.java
+++ b/opensaml-messaging-api/src/main/java/org/opensaml/messaging/decoder/servlet/HttpServletRequestMessageDecoder.java
@@ -17,6 +17,8 @@
 
 package org.opensaml.messaging.decoder.servlet;
 
+import java.util.function.Supplier;
+
 import javax.annotation.Nullable;
 
 import org.opensaml.messaging.decoder.MessageDecoder;
@@ -31,16 +33,25 @@ public interface HttpServletRequestMessageDecoder extends MessageDecoder {
     
     /**
      * Get the HTTP servlet request on which to operate.
-     * 
+     *
      * @return the HTTP servlet request
      */
     @Nullable HttpServletRequest getHttpServletRequest();
     
     /**
      * Set the HTTP servlet request on which to operate.
-     * 
+     *
      * @param request the HTTP servlet request
      */
+    @Deprecated(forRemoval = true, since="4.3")
     void setHttpServletRequest(@Nullable final HttpServletRequest request);
-    
+    /**
+     * Set the supplier for the HTTP servlet request on which to operate.
+     *
+     * @param requestSupplier the HTTP servlet request
+     */
+    default void setHttpServletRequestSupplier(@Nullable final Supplier<HttpServletRequest> requestSupplier) {
+        setHttpServletRequest(requestSupplier.get());
+    }
 }
+

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list