ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.embedded

## Class ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder

- java.lang.Object
- - org.apache.zookeeper.server.embedded.ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder

- Enclosing interface:
    ZooKeeperServerEmbedded

      public static class ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
      extends Object

  Builder for ZooKeeperServerEmbedded.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZookKeeperServerEmbeddedBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder` | `baseDir(Path baseDir)` Base directory of the server.
    `ZooKeeperServerEmbedded` | `build()` Validate the configuration and create the server, without starting it.
    `ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder` | `configuration(Properties configuration)` Set the contents of the main configuration as it would be in zk_server.conf file.
    `ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder` | `exitHandler(ExitHandler exitHandler)` Set the behaviour in case of hard system errors, see `ExitHandler`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ZookKeeperServerEmbeddedBuilder

          public ZookKeeperServerEmbeddedBuilder()

  - ### Method Detail

    - #### baseDir

          public ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder baseDir(Path baseDir)

      Base directory of the server. The system will create a temporary configuration file inside this directory. Please remember that dynamic configuration files wil be saved into this directory by default.

      If you do not set a 'dataDir' configuration entry the system will use a subdirectory of baseDir.

      Parameters:
        `baseDir` -
      Returns:
        the builder

    - #### configuration

          public ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder configuration(Properties configuration)

      Set the contents of the main configuration as it would be in zk_server.conf file.
      Parameters:
        `configuration` - the configuration
      Returns:
        the builder

    - #### exitHandler

          public ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder exitHandler(ExitHandler exitHandler)

      Set the behaviour in case of hard system errors, see `ExitHandler`.
      Parameters:
        `exitHandler` - the handler
      Returns:
        the builder

    - #### build

          public ZooKeeperServerEmbedded build()
                                        throws Exception

      Validate the configuration and create the server, without starting it.
      Returns:
        the new server
      Throws:
        `Exception`
      See Also:
        `ZooKeeperServerEmbedded.start()`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.