Class CorsPathConfig.BuilderBase.CorsPathConfigImpl

java.lang.Object
io.helidon.webserver.cors.CorsPathConfig.BuilderBase.CorsPathConfigImpl
All Implemented Interfaces:
Prototype.Api, CorsPathConfig
Enclosing class:
CorsPathConfig.BuilderBase<BUILDER extends CorsPathConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends CorsPathConfig>

protected static class CorsPathConfig.BuilderBase.CorsPathConfigImpl extends Object implements CorsPathConfig
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Constructor Details

    • CorsPathConfigImpl

      protected CorsPathConfigImpl(CorsPathConfig.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • pathPattern

      public String pathPattern()
      Description copied from interface: CorsPathConfig
      Path pattern to apply this configuration for. Note that paths are checked in sequence, and the first path that matches the request will be used to configure CORS.

      Always configure the most restrictive rules first.

      Specified by:
      pathPattern in interface CorsPathConfig
      Returns:
      path pattern as understood by WebServer routing
    • exclusive

      public boolean exclusive()
      Description copied from interface: CorsPathConfig
      Whether this acts as an exclusive configuration for the configured pathPattern. If exclusive, any CORS request matching the pattern will be exclusively handled with this configuration. If not exclusive, only CORS request matching the pattern AND a method will be handled by this configuration.
      Specified by:
      exclusive in interface CorsPathConfig
      Returns:
      whether this is an exclusive configuration for the provided path, defaults to true
    • enabled

      public boolean enabled()
      Description copied from interface: CorsPathConfig
      Whether this CORS configuration should be enabled or not. If disabled, this configuration will be ignored, and the next path will be checked.
      Specified by:
      enabled in interface CorsPathConfig
      Returns:
      whether this configuration is enabled
    • allowOrigins

      public Set<String> allowOrigins()
      Description copied from interface: CorsPathConfig
      Set of allowed origins, defaults to all.

      If not empty, this will be used with "Access-Control-Allow-Origin" header. Note that allowed origins may be either a full origin, such as http://www.example.com, or a regular expression. Any origin that contains (\), or *, or curly braces is considered a regular expression (i.e. http://.*\.example\.com).

      If you configure a regular expression, it would never be returned if all allowed origins are returned in a pre-flight request.

      Specified by:
      allowOrigins in interface CorsPathConfig
      Returns:
      allowed origins
    • allowHeaders

      public Set<String> allowHeaders()
      Description copied from interface: CorsPathConfig
      Set of allowed headers, defaults to all.

      If not empty, this will be used in "Access-Control-Allow-Headers" header.

      Specified by:
      allowHeaders in interface CorsPathConfig
      Returns:
      allowed headers
    • allowMethods

      public Set<String> allowMethods()
      Description copied from interface: CorsPathConfig
      Set of allowed methods, defaults to all.
      Specified by:
      allowMethods in interface CorsPathConfig
      Returns:
      allowed methods
    • exposeHeaders

      public Set<String> exposeHeaders()
      Description copied from interface: CorsPathConfig
      Set of exposed headers, defaults to none.

      If not empty, this will be used in "Access-Control-Expose-Headers" header.

      Specified by:
      exposeHeaders in interface CorsPathConfig
      Returns:
      exposed headers
    • allowCredentials

      public boolean allowCredentials()
      Description copied from interface: CorsPathConfig
      Whether to allow credentials.

      If enabled, this will be used in "Access-Control-Allow-Credentials" header.

      Specified by:
      allowCredentials in interface CorsPathConfig
      Returns:
      whether to allow credentials, defaults to false
    • maxAge

      public Duration maxAge()
      Description copied from interface: CorsPathConfig
      Max age as a duration.

      This value will be used in "Access-Control-Max-Age" header (in seconds).

      For backward compatibility, you can specify the following when used from configuration:

      • integer (such as 3600) - number of seconds as a number
      • integer ms (such as 10000 ms) - number of milliseconds
      • duration format (such as PT1H) - format of Duration
      Specified by:
      maxAge in interface CorsPathConfig
      Returns:
      max age
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object