接口 MetadataService
-
public interface MetadataServiceThis service is used to expose the metadata information inside a Dubbo process. Typical uses include: 1. The Consumer queries the metadata information of the Provider to list the interfaces and each interface's configuration 2. The Console (dubbo-admin) queries for the metadata of a specific process, or aggregate data of all processes.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringALL_SERVICE_INTERFACESThe value of All service instancesstatic StringVERSIONThe contract version ofMetadataService, the future update must make sure compatible.
-
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 voidexportInstanceMetadata(String instanceMetadata)Export Metadata in Service Instance of Service DiscoveryStringgetAndListenInstanceMetadata(String consumerId, InstanceMetadataChangedListener listener)1.default Set<org.apache.dubbo.common.URL>getExportedServiceURLs()default SortedSet<String>getExportedURLs()Get thesorted setof String that presents all Dubbo exportedurlsdefault SortedSet<String>getExportedURLs(String serviceInterface)Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterfacedefault SortedSet<String>getExportedURLs(String serviceInterface, String group)Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterfaceandgroupdefault SortedSet<String>getExportedURLs(String serviceInterface, String group, String version)Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterface,groupandversionSortedSet<String>getExportedURLs(String serviceInterface, String group, String version, String protocol)Get the sorted set of String that presents the specified Dubbo exportedurlsby theserviceInterface,group,versionandprotocolMap<String,InstanceMetadataChangedListener>getInstanceMetadataChangedListenerMap()Get all Metadata listener from localMetadataInfogetMetadataInfo(String revision)List<MetadataInfo>getMetadataInfos()org.apache.dubbo.common.URLgetMetadataURL()StringgetServiceDefinition(String serviceKey)default StringgetServiceDefinition(String interfaceName, String version, String group)Interface definition.default SortedSet<String>getSubscribedURLs()the list of String that presents all Dubbo subscribedurlsstatic booleanisMetadataService(String interfaceName)StringserviceName()Gets the current Dubbo Service namestatic SortedSet<String>toSortedStrings(Iterable<org.apache.dubbo.common.URL> iterable)static SortedSet<String>toSortedStrings(Stream<org.apache.dubbo.common.URL> stream)default Stringversion()Gets the version ofMetadataServicethat always equalsVERSION
-
-
-
字段详细资料
-
ALL_SERVICE_INTERFACES
static final String ALL_SERVICE_INTERFACES
The value of All service instances- 另请参阅:
- 常量字段值
-
VERSION
static final String VERSION
The contract version ofMetadataService, the future update must make sure compatible.- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
serviceName
String serviceName()
Gets the current Dubbo Service name- 返回:
- non-null
-
version
default String version()
Gets the version ofMetadataServicethat always equalsVERSION- 返回:
- non-null
- 另请参阅:
VERSION
-
getMetadataURL
org.apache.dubbo.common.URL getMetadataURL()
-
getSubscribedURLs
default SortedSet<String> getSubscribedURLs()
the list of String that presents all Dubbo subscribedurls- 返回:
- the non-null read-only
sorted setofstringspresenting theURLs - 另请参阅:
toSortedStrings(Stream),URL.toFullString()
-
getExportedURLs
default SortedSet<String> getExportedURLs()
Get thesorted setof String that presents all Dubbo exportedurls- 返回:
- the non-null read-only
sorted setofstringspresenting theURLs - 另请参阅:
toSortedStrings(Stream),URL.toFullString()
-
getExportedURLs
default SortedSet<String> getExportedURLs(String serviceInterface)
Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterface- 参数:
serviceInterface- The class name of Dubbo service interface- 返回:
- the non-null read-only
sorted setofstringspresenting theURLs - 另请参阅:
toSortedStrings(Stream),URL.toFullString()
-
getExportedURLs
default SortedSet<String> getExportedURLs(String serviceInterface, String group)
Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterfaceandgroup- 参数:
serviceInterface- The class name of Dubbo service interfacegroup- the Dubbo Service Group (optional)- 返回:
- the non-null read-only
sorted setofstringspresenting theURLs - 另请参阅:
toSortedStrings(Stream),URL.toFullString()
-
getExportedURLs
default SortedSet<String> getExportedURLs(String serviceInterface, String group, String version)
Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterface,groupandversion- 参数:
serviceInterface- The class name of Dubbo service interfacegroup- the Dubbo Service Group (optional)version- the Dubbo Service Version (optional)- 返回:
- the non-null read-only
sorted setofstringspresenting theURLs - 另请参阅:
toSortedStrings(Stream),URL.toFullString()
-
getExportedURLs
SortedSet<String> getExportedURLs(String serviceInterface, String group, String version, String protocol)
Get the sorted set of String that presents the specified Dubbo exportedurlsby theserviceInterface,group,versionandprotocol- 参数:
serviceInterface- The class name of Dubbo service interfacegroup- the Dubbo Service Group (optional)version- the Dubbo Service Version (optional)protocol- the Dubbo Service Protocol (optional)- 返回:
- the non-null read-only
sorted setofstringspresenting theURLs - 另请参阅:
toSortedStrings(Stream),URL.toFullString()
-
getExportedServiceURLs
default Set<org.apache.dubbo.common.URL> getExportedServiceURLs()
-
getServiceDefinition
default String getServiceDefinition(String interfaceName, String version, String group)
Interface definition.- 返回:
-
getMetadataInfo
MetadataInfo getMetadataInfo(String revision)
-
getMetadataInfos
List<MetadataInfo> getMetadataInfos()
-
toSortedStrings
static SortedSet<String> toSortedStrings(Iterable<org.apache.dubbo.common.URL> iterable)
- 参数:
iterable-IterableofURL- 返回:
- the non-null read-only
sorted setofstringspresenting - 另请参阅:
URL.toFullString()
-
toSortedStrings
static SortedSet<String> toSortedStrings(Stream<org.apache.dubbo.common.URL> stream)
- 参数:
stream-StreamofURL- 返回:
- the non-null read-only
sorted setofstringspresenting - 另请参阅:
URL.toFullString()
-
isMetadataService
static boolean isMetadataService(String interfaceName)
-
exportInstanceMetadata
void exportInstanceMetadata(String instanceMetadata)
Export Metadata in Service Instance of Service DiscoveryUsed for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata
- 参数:
instanceMetadata-Mapof provider Service Instance Metadata- 从以下版本开始:
- 3.0
-
getInstanceMetadataChangedListenerMap
Map<String,InstanceMetadataChangedListener> getInstanceMetadataChangedListenerMap()
Get all Metadata listener from localUsed for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata
- 返回:
MapofInstanceMetadataChangedListener- 从以下版本开始:
- 3.0
-
getAndListenInstanceMetadata
String getAndListenInstanceMetadata(String consumerId, InstanceMetadataChangedListener listener)
1. Fetch Metadata in Service Instance of Service Discovery 2. Add a metadata change listenerUsed for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata
- 参数:
consumerId- consumerIdlistener-InstanceMetadataChangedListenerused to notify event- 返回:
Mapof provider Service Instance Metadata- 从以下版本开始:
- 3.0
-
-