public class Session extends Object
Constructor and Description |
---|
Session()
Default constructor
|
Session(JsonObject session)
Constructor from JSON
|
Session(Session other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
List<String> |
getChecks()
Get the list of associated health checks
|
long |
getCreateIndex()
Get the create index of session
|
String |
getId()
Get the ID of session
|
long |
getIndex()
Get Consul index
|
long |
getLockDelay()
Lock delay is a time duration, between
0 and 60 seconds. |
String |
getNode()
Get the ID of node
|
int |
hashCode() |
Session |
setChecks(List<String> checks)
Set the list of associated health checks
|
Session |
setCreateIndex(long createIndex)
Set the create index of session
|
Session |
setId(String id)
Set the ID of node
|
Session |
setIndex(long index)
Set Consul index
|
Session |
setLockDelay(long lockDelay)
Set the Lock delay of session
|
Session |
setNode(String node)
Set the ID of node
|
JsonObject |
toJson()
Convert to JSON
|
public Session()
public Session(Session other)
other
- the one to copypublic Session(JsonObject session)
session
- the JSONpublic JsonObject toJson()
public long getLockDelay()
0
and 60
seconds. When a session invalidation
takes place, Consul prevents any of the previously held locks from being re-acquired
for the lock-delay
interval. The default is 15s
.public String getNode()
public List<String> getChecks()
public String getId()
public long getCreateIndex()
public long getIndex()
public Session setLockDelay(long lockDelay)
lockDelay
- the Lock delay of sessionpublic Session setNode(String node)
node
- the ID of nodepublic Session setChecks(List<String> checks)
checks
- the list of associated health checkspublic Session setCreateIndex(long createIndex)
createIndex
- the create index of sessionpublic Session setId(String id)
id
- the ID of nodepublic Session setIndex(long index)
index
- the consul indexCopyright © 2021 Eclipse. All rights reserved.