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 hostIOExceptionpublic 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 registrationIOExceptionInterruptedExceptionpublic void unregisterService(String path) throws IOException, InterruptedException
path - the path at which the service was registeredIOExceptionInterruptedExceptionpublic List<String> listServices(String path) throws IOException, InterruptedException
path - the path under which services are
 registeredIOExceptionInterruptedExceptionpublic String getServiceData(String path) throws IOException, InterruptedException
path - the path where the service is registeredIOExceptionInterruptedExceptionCopyright © 2008–2023 Apache Software Foundation. All rights reserved.