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 booleanequals(Object o)StringgetAddress()Get service addresslonggetCreateIndex()Get the internal index value that represents when the entry was created.StringgetId()Get ID of serviceMap<String,String>getMeta()Get arbitrary KV metadata linked to the service instance.longgetModifyIndex()Get the last index that modified this key.StringgetName()Get service nameStringgetNode()Get none nameStringgetNodeAddress()Get node addressTxnOperationTypegetOperationType()intgetPort()Get service portList<String>getTags()Set list of service tagsinthashCode()ServicesetAddress(String address)Set service addressServicesetCreateIndex(long createIndex)Set the internal index value that represents when the entry was created.ServicesetId(String id)Set ID of serviceServicesetMeta(Map<String,String> meta)Specifies arbitrary KV metadata linked to the service instance.ServicesetModifyIndex(long modifyIndex)Set the last index that modified this key.ServicesetName(String name)Set service nameServicesetNode(String node)Set node nameServicesetNodeAddress(String nodeAddress)Set node addressServicesetPort(int port)Set service portServicesetTags(List<String> tags)Set list of service tagsJsonObjecttoJson()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:
getOperationTypein interfaceTxnResult
-
-