Package org.apache.dubbo.metadata
Interface MetadataService
public interface MetadataService
This 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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe value of All service instancesstatic final StringThe contract version ofMetadataService, the future update must make sure compatible. -
Method Summary
Modifier and TypeMethodDescriptionvoidexportInstanceMetadata(String instanceMetadata) Export Metadata in Service Instance of Service DiscoverygetAndListenInstanceMetadata(String consumerId, InstanceMetadataChangedListener listener) 1.default Set<org.apache.dubbo.common.URL> Get thesorted setof String that presents all Dubbo exportedurlsgetExportedURLs(String serviceInterface) Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterfacegetExportedURLs(String serviceInterface, String group) Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterfaceandgroupgetExportedURLs(String serviceInterface, String group, String version) Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterface,groupandversiongetExportedURLs(String serviceInterface, String group, String version, String protocol) Get the sorted set of String that presents the specified Dubbo exportedurlsby theserviceInterface,group,versionandprotocolGet all Metadata listener from localgetMetadataInfo(String revision) org.apache.dubbo.common.URLgetServiceDefinition(String serviceKey) default StringgetServiceDefinition(String interfaceName, String version, String group) Interface definition.the list of String that presents all Dubbo subscribedurlsstatic booleanisMetadataService(String interfaceName) Gets the current Dubbo Service nametoSortedStrings(Iterable<org.apache.dubbo.common.URL> iterable) toSortedStrings(Stream<org.apache.dubbo.common.URL> stream) default Stringversion()Gets the version ofMetadataServicethat always equalsVERSION
-
Field Details
-
ALL_SERVICE_INTERFACES
The value of All service instances- See Also:
-
VERSION
The contract version ofMetadataService, the future update must make sure compatible.- See Also:
-
-
Method Details
-
serviceName
String serviceName()Gets the current Dubbo Service name- Returns:
- non-null
-
version
Gets the version ofMetadataServicethat always equalsVERSION- Returns:
- non-null
- See Also:
-
getMetadataURL
org.apache.dubbo.common.URL getMetadataURL() -
getSubscribedURLs
the list of String that presents all Dubbo subscribedurls- Returns:
- the non-null read-only
sorted setofstringspresenting theURLs - See Also:
-
getExportedURLs
Get thesorted setof String that presents all Dubbo exportedurls- Returns:
- the non-null read-only
sorted setofstringspresenting theURLs - See Also:
-
getExportedURLs
Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterface- Parameters:
serviceInterface- The class name of Dubbo service interface- Returns:
- the non-null read-only
sorted setofstringspresenting theURLs - See Also:
-
getExportedURLs
Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterfaceandgroup- Parameters:
serviceInterface- The class name of Dubbo service interfacegroup- the Dubbo Service Group (optional)- Returns:
- the non-null read-only
sorted setofstringspresenting theURLs - See Also:
-
getExportedURLs
Get thesorted setof String that presents the specified Dubbo exportedurlsby theserviceInterface,groupandversion- Parameters:
serviceInterface- The class name of Dubbo service interfacegroup- the Dubbo Service Group (optional)version- the Dubbo Service Version (optional)- Returns:
- the non-null read-only
sorted setofstringspresenting theURLs - See Also:
-
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- Parameters:
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)- Returns:
- the non-null read-only
sorted setofstringspresenting theURLs - See Also:
-
getExportedServiceURLs
-
getServiceDefinition
Interface definition.- Returns:
-
getServiceDefinition
-
getMetadataInfo
-
getMetadataInfos
List<MetadataInfo> getMetadataInfos() -
toSortedStrings
- Parameters:
iterable-IterableofURL- Returns:
- the non-null read-only
sorted setofstringspresenting - See Also:
-
toSortedStrings
- Parameters:
stream-StreamofURL- Returns:
- the non-null read-only
sorted setofstringspresenting - See Also:
-
isMetadataService
-
exportInstanceMetadata
Export Metadata in Service Instance of Service DiscoveryUsed for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata
- Parameters:
instanceMetadata-Mapof provider Service Instance Metadata- Since:
- 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
- Returns:
MapofInstanceMetadataChangedListener- Since:
- 3.0
-
getAndListenInstanceMetadata
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
- Parameters:
consumerId- consumerIdlistener-InstanceMetadataChangedListenerused to notify event- Returns:
Mapof provider Service Instance Metadata- Since:
- 3.0
-