Class EndpointConfig.Builder

java.lang.Object
io.helidon.security.EndpointConfig.Builder
All Implemented Interfaces:
Builder<EndpointConfig.Builder,EndpointConfig>, Supplier<EndpointConfig>
Enclosing class:
EndpointConfig

public static final class EndpointConfig.Builder extends Object implements Builder<EndpointConfig.Builder,EndpointConfig>
A fluent API builder for EndpointConfig.
  • Method Details

    • build

      public EndpointConfig build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<EndpointConfig.Builder,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 class
      V - Type of instance (must be descendant of U)
      Parameters:
      objectClass - Class of object as expected by security provider
      anObject - 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:
    • 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 under
      configuration - configuration stored 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
    • 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 provider
      value - 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