Class CrossOriginConfig

java.lang.Object
io.helidon.cors.CrossOriginConfig

@Deprecated(forRemoval=true, since="4.4.0") public class CrossOriginConfig extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
this module will be removed, CORS configuration is centralized to module helidon-webserver-cors with io.helidon.webserver.cors.CorsFeature either from ServiceRegistry, or through one of the feature's static factory or builder methods; paths configured in config are registered first, before paths configured through service registry; this class will be removed in a future version of Helidon
Represents information about cross origin request sharing. Applications can obtain a new instance in three ways:
  • Use a Builder explicitly.

    Obtain a suitable builder by:

    and then invoke methods on the builder as needed. Finally invoke the builder's build method to create the instance.
  • Invoke the static create(Config) method, passing a config node containing the cross-origin information to be converted. This is a convenience method equivalent to creating a builder using the config node and then invoking build().
  • Invoke the static create() method which returns a CrossOriginConfig instance which implements the default CORS behavior.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builder for CrossOriginConfig.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Allow-Credentials.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Allow-Headers.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Allow-Methods.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Allow-Origin.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Expose-Headers.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Max-Age.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Request-Headers.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Header Access-Control-Request-Method.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Key for the node within the CORS config that contains the list of path information.
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Default cache expiration in seconds.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    builder(Config config)
    Deprecated, for removal: This API element is subject to removal in a future version.
    builder(Config config)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new CrossOriginConfig.Builder using the provided config node.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Initializes a new CrossOriginConfig.Builder from the values in an existing CrossOriginConfig object.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new CrossOriginConfig instance which represents the default CORS behavior.
    create(Config config)
    Deprecated, for removal: This API element is subject to removal in a future version.
    create(Config corsConfig)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new CrossOriginConfig instance based on the provided configuration node.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    matches(String method)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reports whether the specified HTTP method name matches this CrossOriginConfig.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • CORS_PATHS_CONFIG_KEY

      public static final String CORS_PATHS_CONFIG_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      Key for the node within the CORS config that contains the list of path information.
      See Also:
    • ACCESS_CONTROL_ALLOW_HEADERS

      public static final String ACCESS_CONTROL_ALLOW_HEADERS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Allow-Headers.
      See Also:
    • ACCESS_CONTROL_ALLOW_METHODS

      public static final String ACCESS_CONTROL_ALLOW_METHODS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Allow-Methods.
      See Also:
    • ACCESS_CONTROL_ALLOW_CREDENTIALS

      public static final String ACCESS_CONTROL_ALLOW_CREDENTIALS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Allow-Credentials.
      See Also:
    • ACCESS_CONTROL_MAX_AGE

      public static final String ACCESS_CONTROL_MAX_AGE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Max-Age.
      See Also:
    • ACCESS_CONTROL_EXPOSE_HEADERS

      public static final String ACCESS_CONTROL_EXPOSE_HEADERS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Expose-Headers.
      See Also:
    • ACCESS_CONTROL_ALLOW_ORIGIN

      public static final String ACCESS_CONTROL_ALLOW_ORIGIN
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Allow-Origin.
      See Also:
    • ACCESS_CONTROL_REQUEST_HEADERS

      public static final String ACCESS_CONTROL_REQUEST_HEADERS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Request-Headers.
      See Also:
    • ACCESS_CONTROL_REQUEST_METHOD

      public static final String ACCESS_CONTROL_REQUEST_METHOD
      Deprecated, for removal: This API element is subject to removal in a future version.
      Header Access-Control-Request-Method.
      See Also:
    • DEFAULT_AGE

      public static final long DEFAULT_AGE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Default cache expiration in seconds.
      See Also:
  • Method Details

    • builder

      public static CrossOriginConfig.Builder builder()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      a new builder for basic cross origin config
    • builder

      @Deprecated(since="4.4.0", forRemoval=true) public static CrossOriginConfig.Builder builder(Config config)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new CrossOriginConfig.Builder using the provided config node.
      Parameters:
      config - node containing cross-origin information
      Returns:
      new CrossOriginConfig.Builder instance based on the configuration
    • builder

      public static CrossOriginConfig.Builder builder(Config config)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new CrossOriginConfig.Builder using the provided config node.

      Although this method is equivalent to builder().config(config) it conveniently combines those two steps for use as a method reference.

      Parameters:
      config - node containing cross-origin information
      Returns:
      new CrossOriginConfig.Builder instance based on the configuration
    • builder

      public static CrossOriginConfig.Builder builder(CrossOriginConfig original)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Initializes a new CrossOriginConfig.Builder from the values in an existing CrossOriginConfig object.
      Parameters:
      original - the existing cross-origin config object
      Returns:
      new Builder initialized from the existing object's settings
    • create

      public static CrossOriginConfig create()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new CrossOriginConfig instance which represents the default CORS behavior.
      Returns:
      new default CrossOriginConfig instance
    • create

      @Deprecated(since="4.4.0", forRemoval=true) public static CrossOriginConfig create(Config config)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new CrossOriginConfig instance based on the provided configuration node.
      Parameters:
      config - node containing CORS information
      Returns:
      new CrossOriginConfig based on the configuration
    • create

      public static CrossOriginConfig create(Config corsConfig)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new CrossOriginConfig instance based on the provided configuration node.
      Parameters:
      corsConfig - node containing CORS information
      Returns:
      new CrossOriginConfig based on the configuration
    • pathPattern

      public String pathPattern()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the configured path expression; defaults to a "match-everything" pattern
    • isEnabled

      public boolean isEnabled()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      whether this cross-origin config is enabled
    • allowOrigins

      public String[] allowOrigins()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the allowed origins
    • allowHeaders

      public String[] allowHeaders()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the allowed headers
    • exposeHeaders

      public String[] exposeHeaders()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      headers OK to expose in responses
    • allowMethods

      public String[] allowMethods()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      allowed methods
    • allowCredentials

      public boolean allowCredentials()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      allowed credentials
    • maxAgeSeconds

      public long maxAgeSeconds()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      maximum age
    • matches

      public boolean matches(String method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Reports whether the specified HTTP method name matches this CrossOriginConfig.
      Parameters:
      method - HTTP method name to check
      Returns:
      true if this CrossOriginConfig matches the specified method; false otherwise
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object