Package org.glassfish.tyrus.core
Class RequestContext.Builder
- java.lang.Object
-
- org.glassfish.tyrus.core.RequestContext.Builder
-
- Enclosing class:
- RequestContext
public static final class RequestContext.Builder extends java.lang.Object
RequestContext
builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RequestContext.Builder.IsUserInRoleDelegate
Is user in role delegate.
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestContext
build()
BuildRequestContext
from given properties.static RequestContext.Builder
create()
Create empty builder.static RequestContext.Builder
create(RequestContext requestContext)
Create builder instance based on providedRequestContext
.RequestContext.Builder
httpSession(java.lang.Object httpSession)
Set http session.RequestContext.Builder
isUserInRoleDelegate(RequestContext.Builder.IsUserInRoleDelegate isUserInRoleDelegate)
Set delegate forRequestContext.isUserInRole(String)
method.RequestContext.Builder
parameterMap(java.util.Map<java.lang.String,java.lang.String[]> parameterMap)
Set parameter map.RequestContext.Builder
queryString(java.lang.String queryString)
Set query string.RequestContext.Builder
remoteAddr(java.lang.String remoteAddr)
Set remote address.RequestContext.Builder
requestURI(java.net.URI requestURI)
Set request URI.RequestContext.Builder
secure(boolean secure)
Set secure state.RequestContext.Builder
serverAddr(java.lang.String serverAddr)
Set server address or hostname.RequestContext.Builder
serverPort(int serverPort)
Set server port.RequestContext.Builder
tyrusProperties(java.util.Map<java.lang.String,java.lang.Object> tyrusProperties)
Set properties for Tyrus framework.RequestContext.Builder
userPrincipal(java.security.Principal principal)
SetPrincipal
.
-
-
-
Method Detail
-
create
public static RequestContext.Builder create()
Create empty builder.- Returns:
- empty builder instance.
-
create
public static RequestContext.Builder create(RequestContext requestContext)
Create builder instance based on providedRequestContext
.- Parameters:
requestContext
- request context.- Returns:
- builder instance.
-
requestURI
public RequestContext.Builder requestURI(java.net.URI requestURI)
Set request URI.- Parameters:
requestURI
- request URI to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
queryString
public RequestContext.Builder queryString(java.lang.String queryString)
Set query string.- Parameters:
queryString
- query string to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
httpSession
public RequestContext.Builder httpSession(java.lang.Object httpSession)
Set http session.- Parameters:
httpSession
-jakarta.servlet.http.HttpSession
session to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
secure
public RequestContext.Builder secure(boolean secure)
Set secure state.- Parameters:
secure
- secure state to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
userPrincipal
public RequestContext.Builder userPrincipal(java.security.Principal principal)
SetPrincipal
.- Parameters:
principal
- principal to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
isUserInRoleDelegate
public RequestContext.Builder isUserInRoleDelegate(RequestContext.Builder.IsUserInRoleDelegate isUserInRoleDelegate)
Set delegate forRequestContext.isUserInRole(String)
method.- Parameters:
isUserInRoleDelegate
- delegate forRequestContext.isUserInRole(String)
.- Returns:
- updated
RequestContext.Builder
instance.
-
parameterMap
public RequestContext.Builder parameterMap(java.util.Map<java.lang.String,java.lang.String[]> parameterMap)
Set parameter map.- Parameters:
parameterMap
- parameter map. Takes map returned from ServletRequest#getParameterMap.- Returns:
- updated
RequestContext.Builder
instance.
-
remoteAddr
public RequestContext.Builder remoteAddr(java.lang.String remoteAddr)
Set remote address.- Parameters:
remoteAddr
- remote address to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
serverAddr
public RequestContext.Builder serverAddr(java.lang.String serverAddr)
Set server address or hostname.- Parameters:
serverAddr
- server address to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
serverPort
public RequestContext.Builder serverPort(int serverPort)
Set server port.- Parameters:
serverPort
- server port to be set.- Returns:
- updated
RequestContext.Builder
instance.
-
tyrusProperties
public RequestContext.Builder tyrusProperties(java.util.Map<java.lang.String,java.lang.Object> tyrusProperties)
Set properties for Tyrus framework.- Parameters:
tyrusProperties
-
-
build
public RequestContext build()
BuildRequestContext
from given properties.- Returns:
- created
RequestContext
.
-
-