public class EtcdClient extends Object
| Constructor and Description |
|---|
EtcdClient(URI baseUri) |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.common.util.concurrent.ListenableFuture<EtcdResult> |
asyncExecute(org.apache.http.client.methods.HttpUriRequest request,
int[] expectedHttpStatusCodes,
int... expectedErrorCodes) |
protected com.google.common.util.concurrent.ListenableFuture<org.apache.http.HttpResponse> |
asyncExecuteHttp(org.apache.http.client.methods.HttpUriRequest request) |
protected com.google.common.util.concurrent.ListenableFuture<com.justinsb.etcd.EtcdClient.JsonResponse> |
asyncExecuteJson(org.apache.http.client.methods.HttpUriRequest request,
int[] expectedHttpStatusCodes) |
EtcdResult |
cas(String key,
String prevValue,
String value)
Sets a key to a new value, if the value is a specified value
|
static void |
close(org.apache.http.HttpResponse response) |
EtcdResult |
createDirectory(String key)
Creates a directory
|
EtcdResult |
delete(String key)
Deletes the given key
|
EtcdResult |
deleteDirectory(String key)
Delete a directory
|
protected com.justinsb.etcd.EtcdClient.JsonResponse |
extractJsonResponse(org.apache.http.HttpResponse httpResponse,
int[] expectedHttpStatusCodes) |
static String |
format(Object o) |
EtcdResult |
get(String key)
Retrieves a key.
|
String |
getVersion()
Gets the etcd version
|
EtcdResult |
listChildren(String key) |
List<EtcdNode> |
listDirectory(String key)
Lists a directory
|
EtcdResult |
set(String key,
String value)
Sets a key to a new value
|
EtcdResult |
set(String key,
String value,
Integer ttl)
Sets a key to a new value with an (optional) ttl
|
protected EtcdResult |
syncExecute(org.apache.http.client.methods.HttpUriRequest request,
int[] expectedHttpStatusCodes,
int... expectedErrorCodes) |
protected com.justinsb.etcd.EtcdClient.JsonResponse |
syncExecuteJson(org.apache.http.client.methods.HttpUriRequest request,
int... expectedHttpStatusCodes) |
protected List<EtcdResult> |
syncExecuteList(org.apache.http.client.methods.HttpUriRequest request) |
protected static String |
urlEscape(String s) |
com.google.common.util.concurrent.ListenableFuture<EtcdResult> |
watch(String key)
Watches the given subtree
|
com.google.common.util.concurrent.ListenableFuture<EtcdResult> |
watch(String key,
Long index,
boolean recursive)
Watches the given subtree
|
public EtcdClient(URI baseUri)
public EtcdResult get(String key) throws EtcdClientException
EtcdClientExceptionpublic EtcdResult delete(String key) throws EtcdClientException
EtcdClientExceptionpublic EtcdResult set(String key, String value) throws EtcdClientException
EtcdClientExceptionpublic EtcdResult set(String key, String value, Integer ttl) throws EtcdClientException
EtcdClientExceptionpublic EtcdResult createDirectory(String key) throws EtcdClientException
EtcdClientExceptionpublic List<EtcdNode> listDirectory(String key) throws EtcdClientException
EtcdClientExceptionpublic EtcdResult deleteDirectory(String key) throws EtcdClientException
EtcdClientExceptionpublic EtcdResult cas(String key, String prevValue, String value) throws EtcdClientException
EtcdClientExceptionpublic com.google.common.util.concurrent.ListenableFuture<EtcdResult> watch(String key) throws EtcdClientException
EtcdClientExceptionpublic com.google.common.util.concurrent.ListenableFuture<EtcdResult> watch(String key, Long index, boolean recursive) throws EtcdClientException
EtcdClientExceptionpublic String getVersion() throws EtcdClientException
EtcdClientExceptionpublic EtcdResult listChildren(String key) throws EtcdClientException
EtcdClientExceptionprotected com.google.common.util.concurrent.ListenableFuture<EtcdResult> asyncExecute(org.apache.http.client.methods.HttpUriRequest request, int[] expectedHttpStatusCodes, int... expectedErrorCodes) throws EtcdClientException
EtcdClientExceptionprotected EtcdResult syncExecute(org.apache.http.client.methods.HttpUriRequest request, int[] expectedHttpStatusCodes, int... expectedErrorCodes) throws EtcdClientException
EtcdClientExceptionprotected List<EtcdResult> syncExecuteList(org.apache.http.client.methods.HttpUriRequest request) throws EtcdClientException
EtcdClientExceptionprotected com.justinsb.etcd.EtcdClient.JsonResponse syncExecuteJson(org.apache.http.client.methods.HttpUriRequest request,
int... expectedHttpStatusCodes)
throws EtcdClientException
EtcdClientExceptionprotected com.google.common.util.concurrent.ListenableFuture<com.justinsb.etcd.EtcdClient.JsonResponse> asyncExecuteJson(org.apache.http.client.methods.HttpUriRequest request,
int[] expectedHttpStatusCodes)
throws EtcdClientException
EtcdClientExceptionprotected com.justinsb.etcd.EtcdClient.JsonResponse extractJsonResponse(org.apache.http.HttpResponse httpResponse,
int[] expectedHttpStatusCodes)
throws EtcdClientException
EtcdClientExceptionprotected com.google.common.util.concurrent.ListenableFuture<org.apache.http.HttpResponse> asyncExecuteHttp(org.apache.http.client.methods.HttpUriRequest request)
public static void close(org.apache.http.HttpResponse response)
Copyright © 2014. All Rights Reserved.