Package org.apache.curator.framework
Class CuratorFrameworkFactory
java.lang.Object
org.apache.curator.framework.CuratorFrameworkFactory
Factory methods for creating framework-style clients
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Return a new builder that builds a CuratorFrameworkstatic byte[]
Return the local address as bytes that can be used as a node payloadstatic CuratorFramework
newClient
(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy) Create a new clientstatic CuratorFramework
newClient
(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy, org.apache.zookeeper.client.ZKClientConfig zkClientConfig) Create a new clientstatic CuratorFramework
newClient
(String connectString, RetryPolicy retryPolicy) Create a new client with default session timeout and default connection timeout
-
Method Details
-
builder
Return a new builder that builds a CuratorFramework- Returns:
- new builder
-
newClient
Create a new client with default session timeout and default connection timeout- Parameters:
connectString
- list of servers to connect toretryPolicy
- 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 tosessionTimeoutMs
- session timeoutconnectionTimeoutMs
- connection timeoutretryPolicy
- 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 tosessionTimeoutMs
- session timeoutconnectionTimeoutMs
- connection timeoutretryPolicy
- retry policy to usezkClientConfig
- 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
-