Module io.helidon.webserver.cors
Package io.helidon.webserver.cors
Class CorsSupportBase.Builder<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>>
- java.lang.Object
-
- io.helidon.webserver.cors.CorsSupportBase.Builder<Q,R,T,B>
-
- Type Parameters:
Q
- request type wrapped by request adapterR
- response type wrapped by response adapterT
- specific subtype ofCorsSupportBase
the builder createsB
- type of the builder
- All Implemented Interfaces:
Builder<CorsSupportBase<Q,R,T,B>>
,Supplier<CorsSupportBase<Q,R,T,B>>
- Direct Known Subclasses:
CorsSupport.Builder
- Enclosing class:
- CorsSupportBase<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>>
public abstract static class CorsSupportBase.Builder<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>> extends Object implements Builder<CorsSupportBase<Q,R,T,B>>
Builder forCorsSupportBase
instances.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description B
addCrossOrigin(CrossOriginConfig crossOrigin)
Adds cross origin information associated with the default path.B
addCrossOrigin(String path, CrossOriginConfig crossOrigin)
Adds cross origin information associated with a given path.B
allowCredentials(boolean allowCredentials)
B
allowHeaders(String... allowHeaders)
B
allowMethods(String... allowMethods)
B
allowOrigins(String... origins)
abstract T
build()
Build the instance from this builder.B
config(Config config)
Merges CORS config information.B
enabled(boolean value)
Sets whether CORS support should be enabled or not.B
exposeHeaders(String... exposeHeaders)
B
mappedConfig(Config config)
Merges mapped CORS config information.B
maxAgeSeconds(long maxAgeSeconds)
protected abstract B
me()
B
name(String name)
Sets the name to be used for the CORS support instance.protected CorsSupportBase.Builder
requestDefaultBehaviorIfNone()
protected CorsSupportBase.Builder<Q,R,T,B>
secondaryLookupSupplier(Supplier<Optional<CrossOriginConfig>> secondaryLookupSupplier)
Not for developer use. Sets a back-up way to provide aCrossOriginConfig
instance if, during look-up for a given request, none is found from the aggregator.
-
-
-
Method Detail
-
me
protected abstract B me()
-
build
public abstract T build()
Description copied from interface:Builder
Build the instance from this builder.
-
config
public B config(Config config)
Merges CORS config information. Typically, the app or component will retrieve the providedConfig
instance from its own config.- Parameters:
config
- the CORS config- Returns:
- the updated builder
-
mappedConfig
public B mappedConfig(Config config)
Merges mapped CORS config information. Typically, the app or component will retrieve the providedConfig
instance from its own config.- Parameters:
config
- the mapped CORS config information- Returns:
- the updated builder
-
enabled
public B enabled(boolean value)
Sets whether CORS support should be enabled or not.- Parameters:
value
- whether to use CORS support- Returns:
- updated builder
-
addCrossOrigin
public B addCrossOrigin(String path, CrossOriginConfig crossOrigin)
Adds cross origin information associated with a given path.- Parameters:
path
- the path to which the cross origin information appliescrossOrigin
- the cross origin information- Returns:
- updated builder
-
addCrossOrigin
public B addCrossOrigin(CrossOriginConfig crossOrigin)
Adds cross origin information associated with the default path.- Parameters:
crossOrigin
- the cross origin information- Returns:
- updated builder
-
name
public B name(String name)
Sets the name to be used for the CORS support instance.- Parameters:
name
- name to use- Returns:
- updated builder
-
allowCredentials
public B allowCredentials(boolean allowCredentials)
-
maxAgeSeconds
public B maxAgeSeconds(long maxAgeSeconds)
-
secondaryLookupSupplier
protected CorsSupportBase.Builder<Q,R,T,B> secondaryLookupSupplier(Supplier<Optional<CrossOriginConfig>> secondaryLookupSupplier)
Not for developer use. Sets a back-up way to provide aCrossOriginConfig
instance if, during look-up for a given request, none is found from the aggregator.- Parameters:
secondaryLookupSupplier
- supplier of a CrossOriginConfig- Returns:
- updated builder
-
requestDefaultBehaviorIfNone
protected CorsSupportBase.Builder requestDefaultBehaviorIfNone()
-
-