Interface CorsConfig

All Superinterfaces:
Comparable<Weighted>, Prototype.Api, Prototype.Factory<CorsFeature>, Weighted
All Known Implementing Classes:
CorsConfig.BuilderBase.CorsConfigImpl

public interface CorsConfig extends Prototype.Api
Configuration of CORS feature.
See Also:
  • Method Details

    • builder

      static CorsConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static CorsConfig.Builder builder(CorsConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static CorsConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static CorsConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static CorsConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • weight

      double weight()
      Weight of the CORS feature. As it is used by other features, the default is quite high: 850.0.
      Specified by:
      weight in interface Weighted
      Returns:
      weight of the feature
    • sockets

      Set<String> sockets()
      List of sockets to register this feature on. If empty, it would get registered on all sockets.
      Returns:
      socket names to register on, defaults to empty (all available sockets)
    • name

      String name()
      Name of this instance.
      Returns:
      instance name
    • enabled

      boolean enabled()
      This feature can be disabled. This feature is automatically enabled if there is at least one paths() defined.
      Returns:
      whether the feature is enabled
    • paths

      default List<CorsPathConfig> paths()
      Per path configuration. Default path is added, unless addDefaults() is set to false.
      Returns:
      per path configurations
    • addDefaults

      default boolean addDefaults()
      Whether to add a default path configuration, that matches all paths, GET, HEAD, POST methods, and allows all origins, methods, and headers. This is always added as a last path.
      Returns:
      whether to add defaults as the last path, defaults to true
    • config

      @Deprecated(since="4.4.0", forRemoval=true) Optional<Config> config()
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method will be removed without a replacement, path based configuration is now handled by paths()
      Access to config that was used to create this feature.
      Returns:
      configuration