- java.lang.Object
-
- io.helidon.security.SecurityEnvironment.Builder
-
- All Implemented Interfaces:
Builder<SecurityEnvironment>,Supplier<SecurityEnvironment>
- Enclosing class:
- SecurityEnvironment
public static final class SecurityEnvironment.Builder extends Object implements Builder<SecurityEnvironment>
A fluent API builder forSecurityEnvironment.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_METHODDefault method is "GET".static StringDEFAULT_TRANSPORTDefault transport is "http".
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityEnvironment.BuilderaddAttribute(String key, Object value)Add an attribute to this environment.SecurityEnvironmentbuild()Build the instance from this builder.SecurityEnvironment.BuilderclearHeaders()We may want to clear existing headers, such as when deriving an environment for outbound calls.SecurityEnvironment.BuilderclearQueryParams()We may want to clear existing query parameters.SecurityEnvironment.Builderheader(String header, String value)Add a single-value header.SecurityEnvironment.Builderheader(String header, List<String> values)Add a multi-value header.SecurityEnvironment.Builderheaders(Map<String,List<String>> headers)Transport headers (such as HTTP headers, JMS headers).SecurityEnvironment.Buildermethod(String method)Method that is requested (such as GET/POST for http).SecurityEnvironment.Builderpath(String path)Path that is requested (such as URI for http, without protocol, server and port).SecurityEnvironment.BuilderqueryParam(String paramName, String value)Add a single-value query parameter.SecurityEnvironment.BuilderqueryParam(String paramName, List<String> values)Add a multivalued query parameter.SecurityEnvironment.BuilderqueryParams(Parameters queryParams)Add query parameters of the request.SecurityEnvironment.BuildertargetUri(URI uri)Configure target URI.SecurityEnvironment.Buildertime(SecurityTime time)Use the defined time to obtain current time.SecurityEnvironment.Buildertransport(String transport)Transport we are implementing (such as http, https).
-
-
-
Field Detail
-
DEFAULT_TRANSPORT
public static final String DEFAULT_TRANSPORT
Default transport is "http".- See Also:
- Constant Field Values
-
DEFAULT_METHOD
public static final String DEFAULT_METHOD
Default method is "GET".- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public SecurityEnvironment build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<SecurityEnvironment>- Returns:
- instance of the built type
-
addAttribute
public SecurityEnvironment.Builder addAttribute(String key, Object value)
Add an attribute to this environment.- Parameters:
key- name of the attributevalue- value of the attribute- Returns:
- updated builder instance
-
headers
public SecurityEnvironment.Builder headers(Map<String,List<String>> headers)
Transport headers (such as HTTP headers, JMS headers). Headers are case insensitive.- Parameters:
headers- header map- Returns:
- this instance
-
clearHeaders
public SecurityEnvironment.Builder clearHeaders()
We may want to clear existing headers, such as when deriving an environment for outbound calls.- Returns:
- this instance
-
header
public SecurityEnvironment.Builder header(String header, String value)
Add a single-value header. Note that if methodheaders(Map)is called after this method, it will remove changes by this method.- Parameters:
header- header namevalue- header value- Returns:
- this instance
-
header
public SecurityEnvironment.Builder header(String header, List<String> values)
Add a multi-value header. Note that if methodheaders(Map)is called after this method, it may remove changes by this method.- Parameters:
header- header namevalues- header values- Returns:
- this instance
-
targetUri
public SecurityEnvironment.Builder targetUri(URI uri)
Configure target URI.- Parameters:
uri- target URI being (or to be) called. If this is an unusual protocol, build the uri following similar pattern to HTTP (jms://host:port/connFactory/queueJndi; socket://host:port; teleport://newyork/broadway/44- Returns:
- this instance
-
path
public SecurityEnvironment.Builder path(String path)
Path that is requested (such as URI for http, without protocol, server and port).- Parameters:
path- the path- Returns:
- this instance
-
method
public SecurityEnvironment.Builder method(String method)
Method that is requested (such as GET/POST for http). Default is "GET".- Parameters:
method- the method- Returns:
- this instance
-
transport
public SecurityEnvironment.Builder transport(String transport)
Transport we are implementing (such as http, https). Default isDEFAULT_TRANSPORT.- Parameters:
transport- the transport- Returns:
- this instance
-
time
public SecurityEnvironment.Builder time(SecurityTime time)
Use the defined time to obtain current time.- Parameters:
time- SecurityTime that allows for explicit values being set (e.g. for unit tests)- Returns:
- updated builder instance
-
queryParam
public SecurityEnvironment.Builder queryParam(String paramName, String value)
Add a single-value query parameter. Note that if methodqueryParams(Parameters)is called after this method, it will remove changes by this method.- Parameters:
paramName- parameter namevalue- parameter value- Returns:
- this instance
-
queryParam
public SecurityEnvironment.Builder queryParam(String paramName, List<String> values)
Add a multivalued query parameter. Note that if methodqueryParams(Parameters)is called after this method, it will remove changes by this method.- Parameters:
paramName- parameter namevalues- parameter values- Returns:
- this instance
-
queryParams
public SecurityEnvironment.Builder queryParams(Parameters queryParams)
Add query parameters of the request.- Parameters:
queryParams- request query parameters- Returns:
- this instance
-
clearQueryParams
public SecurityEnvironment.Builder clearQueryParams()
We may want to clear existing query parameters.- Returns:
- this instance
-
-