public class EtcdHelper extends Object
Constructor and Description |
---|
EtcdHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
createDirectory(String url, String keyPath)
Create a directory node in the etcd node structure.
|
static void |
deleteValue(String url, String keyPath, boolean isDirectory)
Delete a value from the etcd node structure.
|
static String |
getValue(String url, String keyPath)
Read a value from the etcd node structure.
|
static String |
makePath(String... nodes)
Build an ETCD path from a series of passed nodes
|
static EtcdDirectoryListing |
readDirectory(String url, String keyPath)
Read a directory listing from the etcd node structure.
|
static void |
setValue(String url, String keyPath, String value)
Set a value in the etcd node structure.
|
public static void setValue(String url, String keyPath, String value) throws IOException
url
- the URL of the etcd serverkeyPath
- the path to the node, including the keyvalue
- the value to be setIOException
- thrown in the event of an errorpublic static String getValue(String url, String keyPath) throws IOException
url
- the URL of the etcd serverkeyPath
- the path to the node, including the keyIOException
- thrown in the event of an errorpublic static void deleteValue(String url, String keyPath, boolean isDirectory) throws IOException
url
- the URL of the etcd server.keyPath
- the path to the node, including the key.isDirectory
- true if the etcd node is a directory.IOException
- thrown in the event of an errorpublic static void createDirectory(String url, String keyPath) throws IOException
url
- the URL of the etcd serverkeyPath
- the path to the directory node, including the keyIOException
- thrown in the event of an errorpublic static EtcdDirectoryListing readDirectory(String url, String keyPath) throws IOException
url
- the URL of the etcd serverkeyPath
- the path to the directory node, including the keyEtcdDirectoryListing
objectIOException
- thrown in the event of an error