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 and Description
    `Session()` Default constructor
    `Session(JsonObject session)` Constructor from JSON
    `Session(Session other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### 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, between `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`.
      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

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2017. All rights reserved.