Class SessionOptions
java.lang.Object
io.vertx.ext.consul.SessionOptions
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorSessionOptions(JsonObject options) Constructor from JSONSessionOptions(SessionOptions options) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionGet the behavior when a session is invalidated.Get a list of associated health checks.longGet the lock-delay period.getName()Get the human-readable name for the SessiongetNode()Get the node to which the session will be assignedlonggetTtl()Get the TTL interval.setBehavior(SessionBehavior behavior) Set the behavior when a session is invalidated.Set a list of associated health checks.setLockDelay(long lockDelay) Set the lock-delay period.Set the human-readable name for the SessionSet the node to which the session will be assignedsetTtl(long ttl) Set the TTL interval.toJson()Convert to JSON
-
Constructor Details
-
SessionOptions
public SessionOptions()Default constructor -
SessionOptions
Copy constructor- Parameters:
options- the one to copy
-
SessionOptions
-
-
Method Details
-
toJson
-
getLockDelay
public long getLockDelay()Get the lock-delay period.- Returns:
- the lock-delay period
- See Also:
-
setLockDelay
Set the lock-delay period.- Parameters:
lockDelay- the lock-delay period in seconds- Returns:
- reference to this, for fluency
- See Also:
-
getName
-
setName
Set the human-readable name for the Session- Parameters:
name- the name of session- Returns:
- reference to this, for fluency
-
getNode
-
setNode
Set the node to which the session will be assigned- Parameters:
node- the ID of node- Returns:
- reference to this, for fluency
-
getChecks
-
setChecks
Set a list of associated health checks. It is highly recommended that, if you override this list, you include the default "serfHealth"- Parameters:
checks- list of associated health checks- Returns:
- reference to this, for fluency
-
getBehavior
Get the behavior when a session is invalidated.- Returns:
- the session behavior
- See Also:
-
setBehavior
Set the behavior when a session is invalidated. The release behavior is the default if none is specified.- Parameters:
behavior- the session behavior- Returns:
- reference to this, for fluency
-
getTtl
public long getTtl()Get the TTL interval.- Returns:
- the TTL interval in seconds
- See Also:
-
setTtl
Set the TTL interval. When TTL interval expires without being renewed, the session has expired and an invalidation is triggered. If specified, it must be between10sand86400scurrently. The contract of a TTL is that it represents a lower bound for invalidation; that is, Consul will not expire the session before the TTL is reached, but it is allowed to delay the expiration past the TTL. The lowest practical TTL should be used to keep the number of managed sessions low. When locks are forcibly expired, such as during a leader election, sessions may not be reaped for up to double this TTL, so long TTL values (> 1 hour) should be avoided.- Parameters:
ttl- the TTL interval in seconds- Returns:
- reference to this, for fluency
-