Package io.vertx.ext.consul
Class Session
- java.lang.Object
-
- io.vertx.ext.consul.Session
-
public class Session extends Object
Holds properties of Consul sessions- Author:
- Ruslan Sennov
-
-
Constructor Summary
Constructors Constructor Description Session()
Default constructorSession(JsonObject session)
Constructor from JSONSession(Session other)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
List<String>
getChecks()
Get the list of associated health checkslong
getCreateIndex()
Get the create index of sessionString
getId()
Get the ID of sessionlong
getIndex()
Get Consul indexlong
getLockDelay()
Lock delay is a time duration, between0
and60
seconds.String
getNode()
Get the ID of nodeint
hashCode()
Session
setChecks(List<String> checks)
Set the list of associated health checksSession
setCreateIndex(long createIndex)
Set the create index of sessionSession
setId(String id)
Set the ID of nodeSession
setIndex(long index)
Set Consul indexSession
setLockDelay(long lockDelay)
Set the Lock delay of sessionSession
setNode(String node)
Set the ID of nodeJsonObject
toJson()
Convert to JSON
-
-
-
Constructor Detail
-
Session
public Session()
Default constructor
-
Session
public Session(Session other)
Copy constructor- Parameters:
other
- the one to copy
-
Session
public Session(JsonObject session)
Constructor from JSON- Parameters:
session
- the JSON
-
-
Method Detail
-
toJson
public JsonObject toJson()
Convert to JSON- Returns:
- the JSON
-
getLockDelay
public long getLockDelay()
Lock delay is a time duration, between0
and60
seconds. When a session invalidation takes place, Consul prevents any of the previously held locks from being re-acquired for thelock-delay
interval. The default is15s
.- Returns:
- the lock delay in seconds
-
getNode
public String getNode()
Get the ID of node- Returns:
- the ID of node
-
getChecks
public List<String> getChecks()
Get the list of associated health checks- Returns:
- the list of associated health checks
-
getId
public String getId()
Get the ID of session- Returns:
- the ID of session
-
getCreateIndex
public long getCreateIndex()
Get the create index of session- Returns:
- the create index of session
-
getIndex
public long getIndex()
Get Consul index- Returns:
- the consul index
-
setLockDelay
public Session setLockDelay(long lockDelay)
Set the Lock delay of session- Parameters:
lockDelay
- the Lock delay of session- Returns:
- reference to this, for fluency
-
setNode
public Session setNode(String node)
Set the ID of node- Parameters:
node
- the ID of node- Returns:
- reference to this, for fluency
-
setChecks
public Session setChecks(List<String> checks)
Set the list of associated health checks- Parameters:
checks
- the list of associated health checks- Returns:
- reference to this, for fluency
-
setCreateIndex
public Session setCreateIndex(long createIndex)
Set the create index of session- Parameters:
createIndex
- the create index of session- Returns:
- reference to this, for fluency
-
setId
public Session setId(String id)
Set the ID of node- Parameters:
id
- the ID of node- Returns:
- reference to this, for fluency
-
setIndex
public Session setIndex(long index)
Set Consul index- Parameters:
index
- the consul index- Returns:
- reference to this, for fluency
-
-