Package io.helidon.security
Class SecurityContext.Builder
- java.lang.Object
-
- io.helidon.security.SecurityContext.Builder
-
- All Implemented Interfaces:
Builder<SecurityContext>
,Supplier<SecurityContext>
- Enclosing interface:
- SecurityContext
public static class SecurityContext.Builder extends Object implements Builder<SecurityContext>
Fluent API builder forSecurityContext
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityContext
build()
Build the instance from this builder.SecurityContext.Builder
endpointConfig(EndpointConfig ec)
Set the endpoint configuration to start with.SecurityContext.Builder
env(SecurityEnvironment env)
Set the security environment to start with.SecurityContext.Builder
executorService(ExecutorService executorService)
Executor service to use for requests within this context.SecurityContext.Builder
executorService(Supplier<ExecutorService> executorServiceSupplier)
Executor service to use for requests within this context.SecurityContext.Builder
id(String id)
Id of the new security context.SecurityContext.Builder
serverTime(SecurityTime serverTime)
SecurityTime to use when determining current time.SecurityContext.Builder
tracingSpan(SpanContext tracingSpan)
Open tracing span context to correctly trace security.SecurityContext.Builder
tracingTracer(Tracer tracingTracer)
Tracer used to create new span contexts when tracing security events.
-
-
-
Method Detail
-
build
public SecurityContext build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<SecurityContext>
- Returns:
- instance of the built type
-
id
public SecurityContext.Builder id(String id)
Id of the new security context. This should be usable for correlation of log records, traces etc.Use this method only if you need to override default behavior!
- Parameters:
id
- id to use, by default this used security UUID post-fixed by id you gave toSecurity.contextBuilder(String)
- Returns:
- updated builder instance
-
executorService
public SecurityContext.Builder executorService(Supplier<ExecutorService> executorServiceSupplier)
Executor service to use for requests within this context. By default uses a custom executor service that is configured when buildingSecurity
instance.Use this method only if you need to override default behavior!
- Parameters:
executorServiceSupplier
- supplier of an executor service- Returns:
- updated builder instance
-
executorService
public SecurityContext.Builder executorService(ExecutorService executorService)
Executor service to use for requests within this context. By default uses a custom executor service that is configured when buildingSecurity
instance.Use this method only if you need to override default behavior!
- Parameters:
executorService
- executor service- Returns:
- updated builder instance
-
serverTime
public SecurityContext.Builder serverTime(SecurityTime serverTime)
SecurityTime to use when determining current time. Used e.g. when creating a newSecurityEnvironment
. By default uses server time that is configured forSecurity
instanceUse this method only if you need to override default behavior!
- Parameters:
serverTime
- the server time to use- Returns:
- updated builder instance
-
tracingTracer
public SecurityContext.Builder tracingTracer(Tracer tracingTracer)
Tracer used to create new span contexts when tracing security events. By default uses tracer ofSecurity
instance.Use this method only if you need to override default behavior!
- Parameters:
tracingTracer
- tracer to use- Returns:
- updated builder instance
-
tracingSpan
public SecurityContext.Builder tracingSpan(SpanContext tracingSpan)
Open tracing span context to correctly trace security.- Parameters:
tracingSpan
- Open tracing span context of the request within which we create this security context- Returns:
- updated builder instance
-
env
public SecurityContext.Builder env(SecurityEnvironment env)
Set the security environment to start with.- Parameters:
env
- environment to use for security requests- Returns:
- updated builder instance
-
endpointConfig
public SecurityContext.Builder endpointConfig(EndpointConfig ec)
Set the endpoint configuration to start with.- Parameters:
ec
- configuration specific to an endpoint (including annotations, custom objects etc.)- Returns:
- updated builder instance
-
-