接口 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.
    • 字段详细资料

      • ALL_SERVICE_INTERFACES

        static final String ALL_SERVICE_INTERFACES
        The value of All service instances
        另请参阅:
        常量字段值
    • 方法详细资料

      • serviceName

        String serviceName()
        Gets the current Dubbo Service name
        返回:
        non-null
      • getMetadataURL

        org.apache.dubbo.common.URL getMetadataURL()
      • getSubscribedURLs

        default SortedSet<String> getSubscribedURLs()
        the list of String that presents all Dubbo subscribed urls
        返回:
        the non-null read-only sorted set of strings presenting the URLs
        另请参阅:
        toSortedStrings(Stream), URL.toFullString()
      • getExportedURLs

        default SortedSet<String> getExportedURLs​(String serviceInterface)
        Get the sorted set of String that presents the specified Dubbo exported urls by the serviceInterface
        参数:
        serviceInterface - The class name of Dubbo service interface
        返回:
        the non-null read-only sorted set of strings presenting the URLs
        另请参阅:
        toSortedStrings(Stream), URL.toFullString()
      • getExportedURLs

        default SortedSet<String> getExportedURLs​(String serviceInterface,
                                                  String group)
        Get the sorted set of String that presents the specified Dubbo exported urls by the serviceInterface and group
        参数:
        serviceInterface - The class name of Dubbo service interface
        group - the Dubbo Service Group (optional)
        返回:
        the non-null read-only sorted set of strings presenting the URLs
        另请参阅:
        toSortedStrings(Stream), URL.toFullString()
      • getExportedURLs

        default SortedSet<String> getExportedURLs​(String serviceInterface,
                                                  String group,
                                                  String version)
        Get the sorted set of String that presents the specified Dubbo exported urls by the serviceInterface, group and version
        参数:
        serviceInterface - The class name of Dubbo service interface
        group - the Dubbo Service Group (optional)
        version - the Dubbo Service Version (optional)
        返回:
        the non-null read-only sorted set of strings presenting the URLs
        另请参阅:
        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 exported urls by the serviceInterface, group, version and protocol
        参数:
        serviceInterface - The class name of Dubbo service interface
        group - the Dubbo Service Group (optional)
        version - the Dubbo Service Version (optional)
        protocol - the Dubbo Service Protocol (optional)
        返回:
        the non-null read-only sorted set of strings presenting the URLs
        另请参阅:
        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.
        返回:
      • getServiceDefinition

        String getServiceDefinition​(String serviceKey)
      • toSortedStrings

        static SortedSet<String> toSortedStrings​(Iterable<org.apache.dubbo.common.URL> iterable)
        Convert the specified Iterable of URLs to be the strings presenting the URLs
        参数:
        iterable - Iterable of URL
        返回:
        the non-null read-only sorted set of strings presenting
        另请参阅:
        URL.toFullString()
      • toSortedStrings

        static SortedSet<String> toSortedStrings​(Stream<org.apache.dubbo.common.URL> stream)
        Convert the specified Stream of URLs to be the strings presenting the URLs
        参数:
        stream - Stream of URL
        返回:
        the non-null read-only sorted set of strings presenting
        另请参阅:
        URL.toFullString()
      • isMetadataService

        static boolean isMetadataService​(String interfaceName)
      • exportInstanceMetadata

        void exportInstanceMetadata​(String instanceMetadata)
        Export Metadata in Service Instance of Service Discovery

        Used for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata

        参数:
        instanceMetadata - Map of provider Service Instance Metadata
        从以下版本开始:
        3.0
      • getAndListenInstanceMetadata

        String getAndListenInstanceMetadata​(String consumerId,
                                            InstanceMetadataChangedListener listener)
        1. Fetch Metadata in Service Instance of Service Discovery 2. Add a metadata change listener

        Used for consumer to get Service Instance Metadata if Registry is unsupported with publishing metadata

        参数:
        consumerId - consumerId
        listener - InstanceMetadataChangedListener used to notify event
        返回:
        Map of provider Service Instance Metadata
        从以下版本开始:
        3.0