Package io.helidon.security
Class EndpointConfig.Builder
- java.lang.Object
-
- io.helidon.security.EndpointConfig.Builder
-
- All Implemented Interfaces:
Builder<EndpointConfig>,Supplier<EndpointConfig>
- Enclosing class:
- EndpointConfig
public static final class EndpointConfig.Builder extends Object implements Builder<EndpointConfig>
A fluent API builder forEndpointConfig.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description EndpointConfig.BuilderaddAtribute(String key, Object value)Add an attribute to this endpoint configuration builder.EndpointConfig.Builderannotations(EndpointConfig.AnnotationScope scope, Map<Class<? extends Annotation>,List<Annotation>> annotations)Deprecated.Use thesecurityLevelsmethod.EndpointConfigbuild()Build the instance from this builder.EndpointConfig.Builderconfig(String configKey, Config configuration)Provide a configuration for provider to use.EndpointConfig.BuilderconfigMap(Map<String,Config> configMap)Provider a map of cofiguration keys to configurations for provider(s) to use.<U,V extends U>
EndpointConfig.BuildercustomObject(Class<U> objectClass, V anObject)Set or replace a custom object.EndpointConfig.BuildercustomObjects(ClassToInstanceStore<Object> customObjects)Provide custom object map to be sent to security providers.EndpointConfig.BuildersecurityLevels(List<SecurityLevel> securityLevels)Sets security levels to this endpoint configuration builder.
-
-
-
Method Detail
-
build
public EndpointConfig build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<EndpointConfig>- Returns:
- instance of the built type
-
customObject
public <U,V extends U> EndpointConfig.Builder customObject(Class<U> objectClass, V anObject)
Set or replace a custom object. This object will be provided to security provider. Objects are stored by class, so we can have multiple objects of different classes (e.g. when using multiple authorizers/authenticators). Class of object is defined by security provider.- Type Parameters:
U- Type of the custom object to be stored. The object instance is available ONLY under this classV- Type of instance (must be descendant of U)- Parameters:
objectClass- Class of object as expected by security provideranObject- Custom object to propagate to security provider- Returns:
- updated Builder instance
-
customObjects
public EndpointConfig.Builder customObjects(ClassToInstanceStore<Object> customObjects)
Provide custom object map to be sent to security providers.- Parameters:
customObjects- Class to its instance map of custom objects- Returns:
- Updated builder instance
- See Also:
customObject(Class, Object)
-
config
public EndpointConfig.Builder config(String configKey, Config configuration)
Provide a configuration for provider to use. This allows a provider to define a custom configuration key.- Parameters:
configKey- key this configuration is stored underconfiguration-configurationstored under the key, as expected by security provider- Returns:
- Updated builder instance
-
configMap
public EndpointConfig.Builder configMap(Map<String,Config> configMap)
Provider a map of cofiguration keys to configurations for provider(s) to use.- Parameters:
configMap- map of configurations- Returns:
- updated builder instance
-
annotations
@Deprecated public EndpointConfig.Builder annotations(EndpointConfig.AnnotationScope scope, Map<Class<? extends Annotation>,List<Annotation>> annotations)
Deprecated.Use thesecurityLevelsmethod.Add annotations of a specific scope to this request builder. Only used by frameworks that use annotations.- Parameters:
scope- Annotation scope to add annotations forannotations- Collected annotations based on security provider requirements.- Returns:
- updated Builder instance
-
addAtribute
public EndpointConfig.Builder addAtribute(String key, Object value)
Add an attribute to this endpoint configuration builder.- Parameters:
key- name of the attribute as expected by the security providervalue- value of this attribute- Returns:
- updated builder instance
-
securityLevels
public EndpointConfig.Builder securityLevels(List<SecurityLevel> securityLevels)
Sets security levels to this endpoint configuration builder.- Parameters:
securityLevels- list of security levels- Returns:
- updated builder instance
-
-