public enum ZooKeeperConnection extends Enum<ZooKeeperConnection>
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
static void |
configure(String quorumAddresses)
Configure the ZooKeeper quorum addresses.
|
static void |
deregisterObserver(ZooKeeperConnectionObserver observer) |
static org.apache.zookeeper.ZooKeeper |
get()
Get the ZooKeeper connection object.
|
static void |
registerObserver(ZooKeeperConnectionObserver observer) |
static void |
reset()
Remove any preexisting ZooKeeper connection instance.
|
static ZooKeeperConnection |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ZooKeeperConnection[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ZooKeeperConnection INSTANCE
public static ZooKeeperConnection[] values()
for (ZooKeeperConnection c : ZooKeeperConnection.values()) System.out.println(c);
public static ZooKeeperConnection valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static org.apache.zookeeper.ZooKeeper get()
throws IOException
IOException - Thrown when connecting to the ZooKeeper quorum fails.public static void registerObserver(ZooKeeperConnectionObserver observer)
public static void deregisterObserver(ZooKeeperConnectionObserver observer)
public static void reset()
get() will establish a new connection.public static void configure(String quorumAddresses)
quorumAddresses - The server address string expected by ZooKeeper.Copyright © 2014–2015 Lable. All rights reserved.