Package io.vertx.ext.consul
Class KeyValueOptions
- java.lang.Object
-
- io.vertx.ext.consul.KeyValueOptions
-
public class KeyValueOptions extends Object
Options used to put key/value pair to Consul.- Author:
- Ruslan Sennov
-
-
Constructor Summary
Constructors Constructor Description KeyValueOptions()Default constructorKeyValueOptions(JsonObject options)Constructor from JSONKeyValueOptions(KeyValueOptions options)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAcquireSession()Get session ID for lock acquisition operation.longgetCasIndex()Get the Check-And-Set index.longgetFlags()Get the flags.StringgetReleaseSession()Get session ID for lock release operation.KeyValueOptionssetAcquireSession(String acquireSession)Set session ID for lock acquisition operation.KeyValueOptionssetCasIndex(long index)Set the Check-And-Set index.KeyValueOptionssetFlags(long flags)Set the flags.KeyValueOptionssetReleaseSession(String releaseSession)Set session ID for lock release operation.JsonObjecttoJson()Convert to JSON
-
-
-
Constructor Detail
-
KeyValueOptions
public KeyValueOptions()
Default constructor
-
KeyValueOptions
public KeyValueOptions(KeyValueOptions options)
Copy constructor- Parameters:
options- the one to copy
-
KeyValueOptions
public KeyValueOptions(JsonObject options)
Constructor from JSON- Parameters:
options- the JSON
-
-
Method Detail
-
toJson
public JsonObject toJson()
Convert to JSON- Returns:
- the JSON
-
getAcquireSession
public String getAcquireSession()
Get session ID for lock acquisition operation.- Returns:
- the ID of session
-
setAcquireSession
public KeyValueOptions setAcquireSession(String acquireSession)
Set session ID for lock acquisition operation.- Parameters:
acquireSession- the ID of session- Returns:
- reference to this, for fluency
-
getReleaseSession
public String getReleaseSession()
Get session ID for lock release operation.- Returns:
- the ID of session
-
setReleaseSession
public KeyValueOptions setReleaseSession(String releaseSession)
Set session ID for lock release operation.- Parameters:
releaseSession- the ID of session- Returns:
- reference to this, for fluency
-
getFlags
public long getFlags()
Get the flags. Flags is an value between0and 264-1 that can be attached to each entry. Clients can choose to use this however makes sense for their application.- Returns:
- the flags
-
setFlags
public KeyValueOptions setFlags(long flags)
Set the flags. Flags is an value between0and 264-1 that can be attached to each entry. Clients can choose to use this however makes sense for their application.- Parameters:
flags- the flags- Returns:
- reference to this, for fluency
-
getCasIndex
public long getCasIndex()
Get the Check-And-Set index. If the index is0, Consul will only put the key if it does not already exist. If the index is non-zero, the key is only set if the index matches the ModifyIndex of that key.- Returns:
- the Check-And-Set index
- See Also:
KeyValue.getModifyIndex()
-
setCasIndex
public KeyValueOptions setCasIndex(long index)
Set the Check-And-Set index. If the index is0, Consul will only put the key if it does not already exist. If the index is non-zero, the key is only set if the index matches the ModifyIndex of that key.- Parameters:
index- the Check-And-Set index- Returns:
- reference to this, for fluency
- See Also:
KeyValue.getModifyIndex()
-
-