接口 MetadataService
-
- 所有已知子接口:
WritableMetadataService
public interface MetadataServiceA framework interface of Dubbo Metadata Service defines the contract of Dubbo Services registration and subscription between Dubbo service providers and its consumers. The implementation will be exported as a normal Dubbo service that the clients would subscribe, whose version comes from theversion()method and group gets fromserviceName(), that means, The different Dubbo service(application) will export the differentMetadataServicethat persists all the exported and subscribed metadata, they are present bygetExportedURLs()andgetSubscribedURLs()respectively. What's more,MetadataServicealso providers the fine-grain methods for the precise queries.- 从以下版本开始:
- 2.7.5
- 另请参阅:
WritableMetadataService
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringALL_SERVICE_INTERFACESThe value of All service instancesstatic StringALL_SERVICE_NAMESThe value of all service namesstatic StringDEFAULT_EXTENSIONstatic StringSERVICE_INTERFACE_NAMEThe service interface name ofMetadataServicestatic StringVERSIONThe contract version ofMetadataService, the future update must make sure compatible.
-
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default voidexportServiceDiscoveryMetadata(String metadata)Export Metadata in Service Instance of Service Discoverydefault StringgetAndListenServiceDiscoveryMetadata(String consumerId, MetadataChangeListener listener)1.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,versionandprotocoldefault Map<String,MetadataChangeListener>getMetadataChangeListenerMap()Get all Metadata listener from localMetadataInfogetMetadataInfo(String revision)Map<String,MetadataInfo>getMetadataInfos()StringgetServiceDefinition(String serviceKey)Interface definition.default StringgetServiceDefinition(String interfaceName, String version, String group)Interface definition.default SortedSet<String>getSubscribedURLs()the list of String that presents all Dubbo subscribedurlsstatic booleanisMetadataServiceURL(org.apache.dubbo.common.URL url)Is theURLfor theMetadataServiceor not?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)static List<org.apache.dubbo.common.URL>toURLs(Iterable<String> urls)default Stringversion()Gets the version ofMetadataServicethat always equalsVERSION
-
-
-
字段详细资料
-
ALL_SERVICE_INTERFACES
static final String ALL_SERVICE_INTERFACES
The value of All service instances- 另请参阅:
- 常量字段值
-
SERVICE_INTERFACE_NAME
static final String SERVICE_INTERFACE_NAME
The service interface name ofMetadataService
-
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
-
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()
-
getServiceDefinition
default String getServiceDefinition(String interfaceName, String version, String group)
Interface definition.- 返回:
-
getMetadataInfo
MetadataInfo getMetadataInfo(String revision)
-
getMetadataInfos
Map<String,MetadataInfo> getMetadataInfos()
-
isMetadataServiceURL
static boolean isMetadataServiceURL(org.apache.dubbo.common.URL url)
Is theURLfor theMetadataServiceor not?- 参数:
url-url- 返回:
-
toURLs
static List<org.apache.dubbo.common.URL> toURLs(Iterable<String> urls)
- 参数:
urls- the strings presents theDubbo URLs- 返回:
- non-null
-
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()
-
exportServiceDiscoveryMetadata
default void exportServiceDiscoveryMetadata(String metadata)
Export Metadata in Service Instance of Service DiscoveryUsed for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata
- 参数:
metadata-Mapof provider Service Instance Metadata- 从以下版本开始:
- 3.0
-
getMetadataChangeListenerMap
default Map<String,MetadataChangeListener> getMetadataChangeListenerMap()
Get all Metadata listener from localUsed for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata
- 返回:
MapofMetadataChangeListener- 从以下版本开始:
- 3.0
-
getAndListenServiceDiscoveryMetadata
default String getAndListenServiceDiscoveryMetadata(String consumerId, MetadataChangeListener 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-MetadataChangeListenerused to notify event- 返回:
Mapof provider Service Instance Metadata- 从以下版本开始:
- 3.0
-
-