Package org.apache.dubbo.registry.client
Interface ServiceInstance
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultServiceInstance
The model class of an instance of a service, which is used for service registration and discovery.
- Since:
- 2.7.5
-
Method Summary
Modifier and TypeMethodDescriptiongetExtendParam(String key) getHost()The hostname of the registered service instance.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 namedefault ApplicationModelintgetPort()The port of the registered service instance.The name of service that current instance belongs to.default booleanThe enabled status of the registered service instance.default booleanThe registered service instance is health or not.putExtendParam(String key, String value) putExtendParamIfAbsent(String key, String value) removeExtendParam(String key) voidsetApplicationModel(ApplicationModel applicationModel) voidsetRegistryCluster(String registryCluster) voidsetServiceMetadata(MetadataInfo serviceMetadata)
-
Method Details
-
getServiceName
String getServiceName()The name of service that current instance belongs to.- Returns:
- non-null
-
getHost
String getHost()The hostname of the registered service instance.- Returns:
- non-null
-
getPort
int getPort()The port of the registered service instance.- Returns:
- the positive integer if present
-
getAddress
String getAddress() -
isEnabled
default boolean isEnabled()The enabled status of the registered service instance.- Returns:
- 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.- Returns:
- if
true, indicates current instance is healthy, or unhealthy, the client may ignore this one. The default value istrue
-
getMetadata
The key / value pair metadata associated with the service instance.- Returns:
- non-null, mutable and unsorted
Map
-
getSortedMetadata
-
getRegistryCluster
String getRegistryCluster() -
setRegistryCluster
-
getExtendParams
-
getExtendParam
-
putExtendParam
-
putExtendParamIfAbsent
-
removeExtendParam
-
getAllParams
-
setApplicationModel
-
getApplicationModel
ApplicationModel getApplicationModel() -
getOrDefaultApplicationModel
-
getMetadata
Get the value of metadata by the specified name- Parameters:
name- the specified name- Returns:
- the value of metadata if found, or
null - Since:
- 2.7.8
-
getMetadata
Get the value of metadata by the specified name- Parameters:
name- the specified name- Returns:
- the value of metadata if found, or
defaultValue - Since:
- 2.7.8
-
getServiceMetadata
MetadataInfo getServiceMetadata() -
setServiceMetadata
-
toURL
-