Class HttpServletRequestSupport
java.lang.Object
com.c4_soft.springaddons.security.oidc.starter.synchronised.HttpServletRequestSupport
Support class to statically access current request.
It is mainly intended at parsing additional headers when authorizing requests.
- Author:
- ch4mp
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNonEmptyRequestHeaderValues(String headerName) static Optional<jakarta.servlet.http.HttpServletRequest>static Optional<jakarta.servlet.http.HttpSession>static ObjectgetSessionAttribute(String name) static StringgetUniqueRequestHeader(String headerName) static voidsetSessionAttribute(String name, Object value)
-
Constructor Details
-
HttpServletRequestSupport
public HttpServletRequestSupport()
-
-
Method Details
-
getRequest
- Returns:
- the request in current context
-
getSession
-
getSessionAttribute
-
setSessionAttribute
-
getUniqueRequestHeader
public static String getUniqueRequestHeader(String headerName) throws HttpServletRequestSupport.MissingHeaderException, HttpServletRequestSupport.MultiValuedHeaderException - Parameters:
headerName- name of the header to retrieve- Returns:
- the unique value for the given header in current request
- Throws:
HttpServletRequestSupport.MissingHeaderException- if no non-empty value is found for that headerHttpServletRequestSupport.MultiValuedHeaderException- if more than one non-empty value is found for that header
-
getNonEmptyRequestHeaderValues
- Parameters:
headerName- the name of the header to retrieve- Returns:
- a stream of non empty values for a given header from the request in current context
-