类 Instance
java.lang.Object
com.alibaba.nacos.api.naming.pojo.Instance
- 所有已实现的接口:
NacosForm,Serializable
Instance.
- 作者:
- nkorange
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private Stringcluster information of instance.private booleanIf instance is enabled to accept request.private booleanIf instance is ephemeral.private booleaninstance health status.private Stringunique id of this instance.private Stringinstance ip.private static final intuser extended attributes.private intinstance port.private static final longprivate StringService information of instance.private doubleinstance weight. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddMetadata(String key, String value) add meta data.booleancontainsMetadata(String key) Returnstrueif this metadata contains the specified key.booleanprivate voidlonglonggetIp()longprivate longgetMetaDataByKeyWithDefault(String key, long defaultValue) private StringgetMetaDataByKeyWithDefault(String key, String defaultValue) intgetPort()doubleinthashCode()booleanbooleanbooleanvoidsetClusterName(String clusterName) voidsetEnabled(boolean enabled) voidsetEphemeral(boolean ephemeral) voidsetHealthy(boolean healthy) voidsetInstanceId(String instanceId) voidvoidsetMetadata(Map<String, String> metadata) voidsetPort(int port) voidsetServiceName(String serviceName) voidsetWeight(double weight) private static booleantoString()voidvalidate()check form parameters while valid.
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
MAX_PORT
private static final int MAX_PORT- 另请参阅:
-
instanceId
unique id of this instance. -
ip
instance ip. -
port
private int portinstance port. -
weight
private double weightinstance weight. -
healthy
private boolean healthyinstance health status. -
enabled
private boolean enabledIf instance is enabled to accept request. -
ephemeral
private boolean ephemeralIf instance is ephemeral.- 从以下版本开始:
- 1.0.0
-
clusterName
cluster information of instance. -
serviceName
Service information of instance. -
metadata
user extended attributes.
-
-
构造器详细资料
-
Instance
public Instance()
-
-
方法详细资料
-
getInstanceId
-
setInstanceId
-
getIp
-
setIp
-
getPort
public int getPort() -
setPort
public void setPort(int port) -
getWeight
public double getWeight() -
setWeight
public void setWeight(double weight) -
isHealthy
public boolean isHealthy() -
setHealthy
public void setHealthy(boolean healthy) -
getClusterName
-
setClusterName
-
getServiceName
-
setServiceName
-
getMetadata
-
setMetadata
-
addMetadata
add meta data.- 参数:
key- meta data keyvalue- meta data value
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
isEphemeral
public boolean isEphemeral() -
setEphemeral
public void setEphemeral(boolean ephemeral) -
validate
从接口复制的说明:NacosFormcheck form parameters while valid.- 指定者:
validate在接口中NacosForm- 抛出:
NacosApiException- when form parameters is invalid.
-
fillDefaultValue
private void fillDefaultValue() -
toString
-
toInetAddr
-
equals
-
hashCode
public int hashCode() -
strEquals
-
getInstanceHeartBeatInterval
public long getInstanceHeartBeatInterval() -
getInstanceHeartBeatTimeOut
public long getInstanceHeartBeatTimeOut() -
getIpDeleteTimeout
public long getIpDeleteTimeout() -
getInstanceIdGenerator
-
containsMetadata
Returnstrueif this metadata contains the specified key.- 参数:
key- metadata key- 返回:
trueif this metadata contains the specified key
-
getMetaDataByKeyWithDefault
-
getMetaDataByKeyWithDefault
-