public class ZKClient extends Object
Constructor and Description |
---|
ZKClient(String string)
the zookeeper client library to
talk to zookeeper
|
Modifier and Type | Method and Description |
---|---|
String |
getServiceData(String path)
get data published by the service at the registration address
|
List<String> |
listServices(String path)
list the services registered under a path
|
void |
registerService(String path,
String data)
register the service to a specific path
|
void |
unregisterService(String path)
unregister the service.
|
public ZKClient(String string) throws IOException
string
- the hostIOException
public void registerService(String path, String data) throws IOException, InterruptedException
path
- the path in zookeeper namespace to register todata
- the data that is part of this registrationIOException
InterruptedException
public void unregisterService(String path) throws IOException, InterruptedException
path
- the path at which the service was registeredIOException
InterruptedException
public List<String> listServices(String path) throws IOException, InterruptedException
path
- the path under which services are
registeredIOException
InterruptedException
public String getServiceData(String path) throws IOException, InterruptedException
path
- the path where the service is registeredIOException
InterruptedException
Copyright © 2015 Apache Software Foundation. All Rights Reserved.