public class ServiceInstanceBuilder<T>
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
ServiceInstanceBuilder<T> |
address(java.lang.String address) |
|
ServiceInstance<T> |
build() |
Return a new instance with the currently set values
|
ServiceInstanceBuilder<T> |
enabled(boolean enabled) |
|
static java.util.Collection<java.net.InetAddress> |
getAllLocalIPs() |
based on http://pastebin.com/5X073pUc
|
static LocalIpFilter |
getLocalIpFilter() |
Return the current local ip filter used by
getAllLocalIPs() |
ServiceInstanceBuilder<T> |
id(java.lang.String id) |
|
ServiceInstanceBuilder<T> |
name(java.lang.String name) |
|
ServiceInstanceBuilder<T> |
payload(T payload) |
|
ServiceInstanceBuilder<T> |
port(int port) |
|
ServiceInstanceBuilder<T> |
registrationTimeUTC(long registrationTimeUTC) |
|
ServiceInstanceBuilder<T> |
serviceType(ServiceType serviceType) |
|
static void |
setLocalIpFilter(LocalIpFilter newLocalIpFilter) |
Replace the default local ip filter used by
getAllLocalIPs() |
ServiceInstanceBuilder<T> |
sslPort(int port) |
|
ServiceInstanceBuilder<T> |
uriSpec(UriSpec uriSpec) |
public static void setLocalIpFilter(LocalIpFilter newLocalIpFilter)
getAllLocalIPs()newLocalIpFilter - the new local ip filterpublic static LocalIpFilter getLocalIpFilter()
getAllLocalIPs()public ServiceInstance<T> build()
public ServiceInstanceBuilder<T> name(java.lang.String name)
public ServiceInstanceBuilder<T> address(java.lang.String address)
public ServiceInstanceBuilder<T> id(java.lang.String id)
public ServiceInstanceBuilder<T> port(int port)
public ServiceInstanceBuilder<T> sslPort(int port)
public ServiceInstanceBuilder<T> payload(T payload)
public ServiceInstanceBuilder<T> serviceType(ServiceType serviceType)
public ServiceInstanceBuilder<T> registrationTimeUTC(long registrationTimeUTC)
public ServiceInstanceBuilder<T> uriSpec(UriSpec uriSpec)
public ServiceInstanceBuilder<T> enabled(boolean enabled)
public static java.util.Collection<java.net.InetAddress> getAllLocalIPs()
throws java.net.SocketException
Returns 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.
java.net.SocketException - errorsCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.