public static final class ZKClientService.Builder extends Object
ZKClientService
.
The default client timeout is 10000ms.Modifier and Type | Method and Description |
---|---|
ZKClientService.Builder |
addAuthInfo(String schema,
byte[] auth)
Adds an authorization information.
|
ZKClientService |
build()
Creates an instance of
ZKClientService with the settings of this builder. |
static ZKClientService.Builder |
of(String connectStr)
Creates a
ZKClientService.Builder with the given ZooKeeper connection string. |
ZKClientService.Builder |
setConnectionWatcher(org.apache.zookeeper.Watcher watcher)
Sets a
Watcher that will be called whenever connection state change. |
ZKClientService.Builder |
setSessionTimeout(int timeout)
Sets the client timeout to the give milliseconds.
|
public static ZKClientService.Builder of(String connectStr)
ZKClientService.Builder
with the given ZooKeeper connection string.connectStr
- The connection string.public ZKClientService.Builder setSessionTimeout(int timeout)
timeout
- timeout in milliseconds.public ZKClientService.Builder setConnectionWatcher(org.apache.zookeeper.Watcher watcher)
Watcher
that will be called whenever connection state change.watcher
- The watcher to set.public ZKClientService.Builder addAuthInfo(String schema, byte[] auth)
schema
- The authorization schema.auth
- The authorization bytes.public ZKClientService build()
ZKClientService
with the settings of this builder.ZKClientService
.Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.