Package io.vertx.ext.consul
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 Summary
Constructors Constructor Description Service()
Default constructorService(JsonObject service)
Constructor from JSONService(Service other)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getAddress()
Get service addresslong
getCreateIndex()
Get the internal index value that represents when the entry was created.String
getId()
Get ID of serviceMap<String,String>
getMeta()
Get arbitrary KV metadata linked to the service instance.long
getModifyIndex()
Get the last index that modified this key.String
getName()
Get service nameString
getNode()
Get none nameString
getNodeAddress()
Get node addressTxnOperationType
getOperationType()
int
getPort()
Get service portList<String>
getTags()
Set list of service tagsint
hashCode()
Service
setAddress(String address)
Set service addressService
setCreateIndex(long createIndex)
Set the internal index value that represents when the entry was created.Service
setId(String id)
Set ID of serviceService
setMeta(Map<String,String> meta)
Specifies arbitrary KV metadata linked to the service instance.Service
setModifyIndex(long modifyIndex)
Set the last index that modified this key.Service
setName(String name)
Set service nameService
setNode(String node)
Set node nameService
setNodeAddress(String nodeAddress)
Set node addressService
setPort(int port)
Set service portService
setTags(List<String> tags)
Set list of service tagsJsonObject
toJson()
Convert to JSON
-
-
-
Constructor Detail
-
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 Detail
-
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
-
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 interfaceTxnResult
-
-