接口 ServiceInstance
-
- 所有超级接口:
Serializable
- 所有已知实现类:
DefaultServiceInstance
public interface ServiceInstance extends Serializable
The model class of an instance of a service, which is used for service registration and discovery.- 从以下版本开始:
- 2.7.5
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 booleanequals(Object another)StringgetAddress()Map<String,String>getAllParams()Map<String,String>getExtendParams()StringgetHost()The hostname of the registered service instance.StringgetId()The id of the registered service instance.Map<String,String>getMetadata()The key / value pair metadata associated with the service instance.default StringgetMetadata(String name)Get the value of metadata by the specified namedefault StringgetMetadata(String name, String defaultValue)Get the value of metadata by the specified nameIntegergetPort()The port of the registered service instance.StringgetServiceName()The name of service that current instance belongs to.inthashCode()default booleanisEnabled()The enable status of the registered service instance.default booleanisHealthy()The registered service instance is health or not.InstanceAddressURLtoURL()
-
-
-
方法详细资料
-
getId
String getId()
The id of the registered service instance.- 返回:
- nullable
-
getServiceName
String getServiceName()
The name of service that current instance belongs to.- 返回:
- non-null
-
getHost
String getHost()
The hostname of the registered service instance.- 返回:
- non-null
-
getPort
Integer getPort()
The port of the registered service instance.- 返回:
- the positive integer if present
-
getAddress
String getAddress()
-
isEnabled
default boolean isEnabled()
The enable status of the registered service instance.- 返回:
- if
true, indicates current instance is enabled, or disable, the client should remove this one. The default value istrue
-
isHealthy
default boolean isHealthy()
The registered service instance is health or not.- 返回:
- if
true, indicates current instance is enabled, or disable, the client may ignore this one. The default value istrue
-
getMetadata
Map<String,String> getMetadata()
The key / value pair metadata associated with the service instance.- 返回:
- non-null, mutable and unsorted
Map
-
getMetadata
default String getMetadata(String name)
Get the value of metadata by the specified name- 参数:
name- the specified name- 返回:
- the value of metadata if found, or
null - 从以下版本开始:
- 2.7.8
-
getMetadata
default String getMetadata(String name, String defaultValue)
Get the value of metadata by the specified name- 参数:
name- the specified name- 返回:
- the value of metadata if found, or
defaultValue - 从以下版本开始:
- 2.7.8
-
equals
boolean equals(Object another)
- 覆盖:
equals在类中Object- 参数:
another- anotherServiceInstance- 返回:
- if equals , return
true, orfalse
-
toURL
InstanceAddressURL toURL()
-
-