public class DefaultServiceInstance extends Object implements ServiceInstance
ServiceInstance.| Constructor and Description |
|---|
DefaultServiceInstance() |
DefaultServiceInstance(String serviceName,
String host,
Integer port) |
DefaultServiceInstance(String id,
String serviceName,
String host,
Integer port) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getHost()
The hostname of the registered service instance.
|
String |
getId()
The id of the registered service instance.
|
Map<String,String> |
getMetadata()
The key / value pair metadata associated with the service instance.
|
Integer |
getPort()
The port of the registered service instance.
|
String |
getServiceName()
The name of service that current instance belongs to.
|
int |
hashCode() |
boolean |
isEnabled()
The enable status of the registered service instance.
|
boolean |
isHealthy()
The registered service instance is health or not.
|
void |
setEnabled(boolean enabled) |
void |
setHealthy(boolean healthy) |
void |
setHost(String host) |
void |
setId(String id) |
void |
setMetadata(Map<String,String> metadata) |
void |
setPort(Integer port) |
void |
setServiceName(String serviceName) |
String |
toString() |
public DefaultServiceInstance()
public DefaultServiceInstance(String id, String serviceName, String host, Integer port)
public void setId(String id)
public void setServiceName(String serviceName)
public void setHost(String host)
public String getId()
ServiceInstancegetId in interface ServiceInstancepublic String getServiceName()
ServiceInstancegetServiceName in interface ServiceInstancepublic String getHost()
ServiceInstancegetHost in interface ServiceInstancepublic void setPort(Integer port)
public Integer getPort()
ServiceInstancegetPort in interface ServiceInstancepublic boolean isEnabled()
ServiceInstanceisEnabled in interface ServiceInstancetrue, indicates current instance is enabled, or disable, the client should remove this one.
The default value is truepublic void setEnabled(boolean enabled)
public boolean isHealthy()
ServiceInstanceisHealthy in interface ServiceInstancetrue, indicates current instance is enabled, or disable, the client may ignore this one.
The default value is truepublic void setHealthy(boolean healthy)
public Map<String,String> getMetadata()
ServiceInstancegetMetadata in interface ServiceInstanceMappublic boolean equals(Object o)
equals in interface ServiceInstanceequals in class Objecto - another ServiceInstancetrue, or falsepublic int hashCode()
hashCode in interface ServiceInstancehashCode in class ObjectCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.