|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.orbitz.consul.KeyValueClient
public class KeyValueClient
HTTP Client for /v1/kv/ endpoints.
| Method Summary | |
|---|---|
boolean |
acquireLock(java.lang.String key,
java.lang.String session)
Aquire a lock for a given key. |
boolean |
acquireLock(java.lang.String key,
java.lang.String value,
java.lang.String session)
Aquire a lock for a given key. |
void |
deleteKey(java.lang.String key)
Deletes a specified key. |
void |
deleteKeys(java.lang.String key)
Deletes a specified key and any below it. |
java.util.List<java.lang.String> |
getKeys(java.lang.String key)
Retrieves a list of matching keys for the given key. |
com.google.common.base.Optional<java.lang.String> |
getSession(java.lang.String key)
Retrieves a session string for a specific key from the key/value store. |
com.google.common.base.Optional<Value> |
getValue(java.lang.String key)
Retrieves a Value for a specific key
from the key/value store. |
com.google.common.base.Optional<Value> |
getValue(java.lang.String key,
QueryOptions queryOptions)
Retrieves a Value for a specific key
from the key/value store. |
void |
getValue(java.lang.String key,
QueryOptions queryOptions,
ConsulResponseCallback<java.util.List<Value>> callback)
Asynchronously retrieves a Value for a specific key
from the key/value store. |
com.google.common.base.Optional<java.lang.String> |
getValueAsString(java.lang.String key)
Retrieves a string value for a specific key from the key/value store. |
java.util.List<Value> |
getValues(java.lang.String key)
Retrieves a list of Value objects for a specific key
from the key/value store. |
void |
getValues(java.lang.String key,
QueryOptions queryOptions,
ConsulResponseCallback<java.util.List<Value>> callback)
Asynchronously retrieves a list of Value objects for a specific key
from the key/value store. |
java.util.List<java.lang.String> |
getValuesAsString(java.lang.String key)
Retrieves a list of string values for a specific key from the key/value store. |
boolean |
putValue(java.lang.String key,
java.lang.String value)
Puts a value into the key/value store. |
boolean |
putValue(java.lang.String key,
java.lang.String value,
long flags)
Puts a value into the key/value store. |
boolean |
releaseLock(java.lang.String key,
java.lang.String sessionId)
Releases the lock for a given service and session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public com.google.common.base.Optional<Value> getValue(java.lang.String key)
Value for a specific key
from the key/value store.
GET /v1/kv/{key}
key - The key to retrieve.
Optional containing the value or Optional.absent()
public com.google.common.base.Optional<Value> getValue(java.lang.String key,
QueryOptions queryOptions)
Value for a specific key
from the key/value store.
GET /v1/kv/{key}
key - The key to retrieve.queryOptions - The query options.
Optional containing the value or Optional.absent()
public void getValue(java.lang.String key,
QueryOptions queryOptions,
ConsulResponseCallback<java.util.List<Value>> callback)
Value for a specific key
from the key/value store.
GET /v1/kv/{key}
key - The key to retrieve.queryOptions - The query options.callback - Callback implemented by callee to handle results.public java.util.List<Value> getValues(java.lang.String key)
Value objects for a specific key
from the key/value store.
GET /v1/kv/{key}?recurse
key - The key to retrieve.
Value objects.
public void getValues(java.lang.String key,
QueryOptions queryOptions,
ConsulResponseCallback<java.util.List<Value>> callback)
Value objects for a specific key
from the key/value store.
GET /v1/kv/{key}?recurse
key - The key to retrieve.queryOptions - The query options.callback - Callback implemented by callee to handle results.public com.google.common.base.Optional<java.lang.String> getValueAsString(java.lang.String key)
key - The key to retrieve.
Optional containing the value as a string or
Optional.absent()public java.util.List<java.lang.String> getValuesAsString(java.lang.String key)
key - The key to retrieve.
public boolean putValue(java.lang.String key,
java.lang.String value)
key - The key to use as index.value - The value to index.
true if the value was successfully indexed.
public boolean putValue(java.lang.String key,
java.lang.String value,
long flags)
key - The key to use as index.value - The value to index.flags - The flags for this key.
true if the value was successfully indexed.public java.util.List<java.lang.String> getKeys(java.lang.String key)
key - The key to retrieve.
public void deleteKey(java.lang.String key)
key - The key to delete.public void deleteKeys(java.lang.String key)
key - The key to delete.
public boolean acquireLock(java.lang.String key,
java.lang.String session)
key - The key to acquire the lock.session - The session to acquire lock.
public boolean acquireLock(java.lang.String key,
java.lang.String value,
java.lang.String session)
key - The key to acquire the lock.session - The session to acquire lock.value - key value (usually - application specific info about the lock requester)
public com.google.common.base.Optional<java.lang.String> getSession(java.lang.String key)
key - The key to retrieve.
Optional containing the value as a string or
Optional.absent()
public boolean releaseLock(java.lang.String key,
java.lang.String sessionId)
key - identifying the service.sessionId -
SessionInfo.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||