Class NodeConfigBuilder

java.lang.Object
io.vertigo.core.node.config.NodeConfigBuilder
All Implemented Interfaces:
Builder<NodeConfig>

public final class NodeConfigBuilder extends Object implements Builder<NodeConfig>
The NodeConfigBuilder builder allows you to create an NodeConfig using a fluent, simple style .
Author:
npiedeloup, pchretien
  • Method Details

    • withBoot

      public NodeConfigBuilder withBoot(BootConfig bootConfig)
      Opens the bootConfigBuilder. There is exactly one BootConfig per NodeConfig.
      Returns:
      this builder
    • withActiveFlags

      public NodeConfigBuilder withActiveFlags(Set<String> activeFlags)
      Keep track of activeFlags use for NodeConfig creation.
      Parameters:
      activeFlags - flags active for this node
      Returns:
      this builder
    • withAppName

      public NodeConfigBuilder withAppName(String appName)
      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

      public NodeConfigBuilder withNodeId(String nodeId)
      Associate an id to the current node (random UUID by default)
      Parameters:
      nodeId - the node id
      Returns:
      this builder
    • withEndPoint

      public NodeConfigBuilder withEndPoint(String endPoint)
      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

      public NodeConfigBuilder addModule(ModuleConfig moduleConfig)
      Adds a a moduleConfig.
      Parameters:
      moduleConfig - the moduleConfig
      Returns:
      this builder
    • build

      public NodeConfig build()
      Builds the nodeConfig.
      Specified by:
      build in interface Builder<NodeConfig>
      Returns:
      nodeConfig.