Package io.vertigo.core.node.config
Class NodeConfigBuilder
java.lang.Object
io.vertigo.core.node.config.NodeConfigBuilder
- All Implemented Interfaces:
Builder<NodeConfig>
The NodeConfigBuilder builder allows you to create an NodeConfig using a fluent, simple style .
- Author:
- npiedeloup, pchretien
-
Method Summary
Modifier and TypeMethodDescriptionaddInitializer(Class<? extends ComponentInitializer> componentInitializerClass) Adds an initializer to the current config.addModule(ModuleConfig moduleConfig) Adds a a moduleConfig.build()Builds the nodeConfig.withActiveFlags(Set<String> activeFlags) Keep track of activeFlags use for NodeConfig creation.withAppName(String appName) Associate a common name that define the application as a whole.withBoot(BootConfig bootConfig) Opens the bootConfigBuilder.withEndPoint(String endPoint) Associate an optional endPoint to reach the current node.withNodeId(String nodeId) Associate an id to the current node (random UUID by default)
-
Method Details
-
withBoot
Opens the bootConfigBuilder. There is exactly one BootConfig per NodeConfig.- Returns:
- this builder
-
withActiveFlags
Keep track of activeFlags use for NodeConfig creation.- Parameters:
activeFlags- flags active for this node- Returns:
- this builder
-
withAppName
Associate a common name that define the application as a whole. (ex: Facebook, Pharos...) (myApp by default)- Parameters:
appName- the node name- Returns:
- this builder
-
withNodeId
Associate an id to the current node (random UUID by default)- Parameters:
nodeId- the node id- Returns:
- this builder
-
withEndPoint
Associate an optional endPoint to reach the current node.- Parameters:
endPoint- the endPoint to reach the node (protocol:port//host)- Returns:
- this builder
-
addInitializer
public NodeConfigBuilder addInitializer(Class<? extends ComponentInitializer> componentInitializerClass) Adds an initializer to the current config.- Parameters:
componentInitializerClass- Class of the initializer- Returns:
- this builder
-
addModule
Adds a a moduleConfig.- Parameters:
moduleConfig- the moduleConfig- Returns:
- this builder
-
build
Builds the nodeConfig.- Specified by:
buildin interfaceBuilder<NodeConfig>- Returns:
- nodeConfig.
-