Class Service

java.lang.Object
io.vertx.ext.consul.Service
All Implemented Interfaces:
TxnResult

public class Service extends Object implements TxnResult
Holds properties of service and node that its containing
Author:
Ruslan Sennov
  • Constructor Details

    • Service

      public Service()
      Default constructor
    • Service

      public Service(Service other)
      Copy constructor
      Parameters:
      other - the one to copy
    • Service

      public Service(JsonObject service)
      Constructor from JSON
      Parameters:
      service - the JSON
  • Method Details

    • toJson

      public JsonObject toJson()
      Convert to JSON
      Returns:
      the JSON
    • getNode

      public String getNode()
      Get none name
      Returns:
      node name
    • setNode

      public Service setNode(String node)
      Set node name
      Parameters:
      node - node name
      Returns:
      reference to this, for fluency
    • getNodeAddress

      public String getNodeAddress()
      Get node address
      Returns:
      node address
    • setNodeAddress

      public Service setNodeAddress(String nodeAddress)
      Set node address
      Parameters:
      nodeAddress - node address
      Returns:
      reference to this, for fluency
    • getId

      public String getId()
      Get ID of service
      Returns:
      ID of service
    • setId

      public Service setId(String id)
      Set ID of service
      Parameters:
      id - ID of service
      Returns:
      reference to this, for fluency
    • getName

      public String getName()
      Get service name
      Returns:
      service name
    • setName

      public Service setName(String name)
      Set service name
      Parameters:
      name - service name
      Returns:
      reference to this, for fluency
    • getTags

      public List<String> getTags()
      Set list of service tags
      Returns:
      list of service tags
    • setTags

      public Service setTags(List<String> tags)
      Set list of service tags
      Parameters:
      tags - list of service tags
      Returns:
      reference to this, for fluency
    • getAddress

      public String getAddress()
      Get service address
      Returns:
      service address
    • setAddress

      public Service setAddress(String address)
      Set service address
      Parameters:
      address - service address
      Returns:
      reference to this, for fluency
    • getMeta

      public Map<String,String> getMeta()
      Get arbitrary KV metadata linked to the service instance.
      Returns:
      arbitrary KV metadata
    • setMeta

      public Service setMeta(Map<String,String> meta)
      Specifies arbitrary KV metadata linked to the service instance.
      Parameters:
      meta - arbitrary KV metadata
      Returns:
      reference to this, for fluency
    • getPort

      public int getPort()
      Get service port
      Returns:
      service port
    • setPort

      public Service setPort(int port)
      Set service port
      Parameters:
      port - service port
      Returns:
      reference to this, for fluency
    • getCreateIndex

      public long getCreateIndex()
      Get the internal index value that represents when the entry was created.
      Returns:
      the internal index value that represents when the entry was created.
    • setCreateIndex

      public Service setCreateIndex(long createIndex)
      Set the internal index value that represents when the entry was created.
      Parameters:
      createIndex - the internal index value that represents when the entry was created.
      Returns:
      reference to this, for fluency
    • getModifyIndex

      public long getModifyIndex()
      Get the last index that modified this key.
      Returns:
      the last index that modified this key.
    • setModifyIndex

      public Service setModifyIndex(long modifyIndex)
      Set the last index that modified this key.
      Parameters:
      modifyIndex - the last index that modified this key.
      Returns:
      reference to this, for fluency
    • getOperationType

      public TxnOperationType getOperationType()
      Specified by:
      getOperationType in interface TxnResult
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object