Class AbstractServiceEntry
java.lang.Object
io.micronaut.discovery.consul.client.v1.AbstractServiceEntry
- Direct Known Subclasses:
NewServiceEntry
Base class for a service entry in consul.
- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the address as given.address(InetAddress address) booleanDeprecated, for removal: This API element is subject to removal in a future version.See https://www.consul.io/api/agent/service.html#address.getID()See https://www.consul.io/api/agent/service.html#id.getMeta()See https://www.consul.io/api/agent/service.html#meta.getName()See https://www.consul.io/api/agent/service.html#name.getPort()See https://www.consul.io/api/agent/service.html#address.getTags()See https://www.consul.io/api/agent/service.html#tags.inthashCode()voidsetAddress(InetAddress address) See https://www.consul.io/api/agent/service.html#address.voidsetHostString(String hostString) See https://www.consul.io/api/agent/service.html#address.voidSee https://www.consul.io/api/agent/service.html#id.voidSee https://www.consul.io/api/agent/service.html#meta.voidSee https://www.consul.io/api/agent/service.html#address.voidSee https://www.consul.io/api/agent/service.html#tags.
-
Field Details
-
name
-
-
Constructor Details
-
AbstractServiceEntry
- Parameters:
name- The service name
-
-
Method Details
-
getID
-
setID
See https://www.consul.io/api/agent/service.html#id.- Parameters:
id- The ID of the service
-
getHostString
-
setHostString
See https://www.consul.io/api/agent/service.html#address.- Parameters:
hostString- The address of the service, a host name or an IP literal- Since:
- 5.2.0
-
getAddress
Deprecated, for removal: This API element is subject to removal in a future version.UsegetHostString()and resolve the address where it is needed.See https://www.consul.io/api/agent/service.html#address.The address is resolved on each call, which needs a DNS lookup when it is a host name.
- Returns:
- The resolved address of the service
- Throws:
UncheckedIOException- if the host name cannot be resolved
-
setAddress
See https://www.consul.io/api/agent/service.html#address.The address is stored as its host name, or as its IP literal when it has no host name.
- Parameters:
address- The address of the service
-
getPort
See https://www.consul.io/api/agent/service.html#address.- Returns:
- The port of the service
-
setPort
See https://www.consul.io/api/agent/service.html#address.- Parameters:
port- The port of the service
-
getTags
-
setTags
-
getMeta
-
setMeta
-
getName
See https://www.consul.io/api/agent/service.html#name.- Returns:
- The name of the service
-
id
- Parameters:
id- The id of the service- Returns:
- The
AbstractServiceEntryinstance
-
address
- Parameters:
address- TheInetAddressof the service, stored as its host name, or as its IP literal when it has no host name- Returns:
- The
AbstractServiceEntryinstance
-
address
Sets the address as given. Since 5.2.0 it is no longer resolved, so a host name is sent to Consul unchanged.- Parameters:
address- The address of the service, a host name or an IP literal- Returns:
- The
AbstractServiceEntryinstance
-
port
- Parameters:
port- The port of the service- Returns:
- The
AbstractServiceEntryinstance
-
tags
- Parameters:
tags- The service tags- Returns:
- The
AbstractServiceEntryinstance
-
meta
- Parameters:
meta- The service metadata- Returns:
- The
AbstractServiceEntryinstance
-
equals
-
hashCode
-
getHostString()and resolve the address where it is needed.