public class ZKClient
extends java.lang.Object
| Constructor | Description |
|---|---|
ZKClient(java.lang.String string) |
the zookeeper client library to
talk to zookeeper
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getServiceData(java.lang.String path) |
get data published by the service at the registration address.
|
java.util.List<java.lang.String> |
listServices(java.lang.String path) |
list the services registered under a path.
|
void |
registerService(java.lang.String path,
java.lang.String data) |
register the service to a specific path.
|
void |
unregisterService(java.lang.String path) |
unregister the service.
|
public ZKClient(java.lang.String string)
throws java.io.IOException
string - the hostjava.io.IOException - if there are I/O errors.public void registerService(java.lang.String path,
java.lang.String data)
throws java.io.IOException,
java.lang.InterruptedException
path - the path in zookeeper namespace to register todata - the data that is part of this registrationjava.io.IOException - if there are I/O errors.java.lang.InterruptedException - if any thread has interrupted.public void unregisterService(java.lang.String path)
throws java.io.IOException,
java.lang.InterruptedException
path - the path at which the service was registeredjava.io.IOException - if there are I/O errors.java.lang.InterruptedException - if any thread has interrupted.public java.util.List<java.lang.String> listServices(java.lang.String path)
throws java.io.IOException,
java.lang.InterruptedException
path - the path under which services are
registeredjava.io.IOException - if there are I/O errors.java.lang.InterruptedException - if any thread has interrupted.public java.lang.String getServiceData(java.lang.String path)
throws java.io.IOException,
java.lang.InterruptedException
path - the path where the service is registeredjava.io.IOException - if there are I/O errors.java.lang.InterruptedException - if any thread has interrupted.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.