Package org.apache.curator.x.discovery
Class ServiceInstanceBuilder<T>
java.lang.Object
org.apache.curator.x.discovery.ServiceInstanceBuilder<T>
Builder for service instances
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Return a new instance with the currently set valuesenabled
(boolean enabled) static Collection
<InetAddress> based on http://pastebin.com/5X073pUcstatic LocalIpFilter
Return the current local ip filter used bygetAllLocalIPs()
port
(int port) registrationTimeUTC
(long registrationTimeUTC) serviceType
(ServiceType serviceType) static void
setLocalIpFilter
(LocalIpFilter newLocalIpFilter) Replace the default local ip filter used bygetAllLocalIPs()
sslPort
(int port)
-
Method Details
-
setLocalIpFilter
Replace the default local ip filter used bygetAllLocalIPs()
- Parameters:
newLocalIpFilter
- the new local ip filter
-
getLocalIpFilter
Return the current local ip filter used bygetAllLocalIPs()
- Returns:
- ip filter
-
build
Return a new instance with the currently set values- Returns:
- instance
-
name
-
address
-
id
-
port
-
sslPort
-
payload
-
serviceType
-
registrationTimeUTC
-
uriSpec
-
enabled
-
getAllLocalIPs
based on http://pastebin.com/5X073pUcReturns all available IP addresses.
In error case or if no network connection is established, we return an empty list here.
Loopback addresses are excluded - so 127.0.0.1 will not be never returned.
The "primary" IP might not be the first one in the returned list.
- Returns:
- Returns all IP addresses (can be an empty list in error case or if network connection is missing).
- Throws:
SocketException
- errors- Since:
- 0.1.0
-