Class CuratorFrameworkFactory

java.lang.Object
org.apache.curator.framework.CuratorFrameworkFactory

public class CuratorFrameworkFactory extends Object
Factory methods for creating framework-style clients
  • Method Details

    • builder

      public static CuratorFrameworkFactory.Builder builder()
      Return a new builder that builds a CuratorFramework
      Returns:
      new builder
    • newClient

      public static CuratorFramework newClient(String connectString, RetryPolicy retryPolicy)
      Create a new client with default session timeout and default connection timeout
      Parameters:
      connectString - list of servers to connect to
      retryPolicy - retry policy to use
      Returns:
      client
    • newClient

      public static CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy)
      Create a new client
      Parameters:
      connectString - list of servers to connect to
      sessionTimeoutMs - session timeout
      connectionTimeoutMs - connection timeout
      retryPolicy - retry policy to use
      Returns:
      client
    • newClient

      public static CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy, org.apache.zookeeper.client.ZKClientConfig zkClientConfig)
      Create a new client
      Parameters:
      connectString - list of servers to connect to
      sessionTimeoutMs - session timeout
      connectionTimeoutMs - connection timeout
      retryPolicy - retry policy to use
      zkClientConfig - ZKClientConfig
      Returns:
      client
      Since:
      5.1.1, supported from ZooKeeper 3.6.1 and above.
    • getLocalAddress

      public static byte[] getLocalAddress()
      Return the local address as bytes that can be used as a node payload
      Returns:
      local address bytes