接口 MetadataService

  • 所有已知子接口:
    WritableMetadataService
    所有已知实现类:
    AbstractAbstractWritableMetadataService

    public interface MetadataService
    A 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 the version() method and group gets from serviceName(), that means, The different Dubbo service(application) will export the different MetadataService that persists all the exported and subscribed metadata, they are present by getExportedURLs() and getSubscribedURLs() respectively. What's more, MetadataService also providers the fine-grain methods for the precise queries.
    从以下版本开始:
    2.7.5
    另请参阅:
    WritableMetadataService
    • 方法详细资料

      • serviceName

        String serviceName()
        Gets the current Dubbo Service name
        返回:
        non-null
      • 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()
      • getServiceDefinition

        default String getServiceDefinition​(String interfaceName,
                                            String version,
                                            String group)
        Interface definition.
        返回:
      • getServiceDefinition

        String getServiceDefinition​(String serviceKey)
        Interface definition.
        返回:
      • isMetadataServiceURL

        static boolean isMetadataServiceURL​(org.apache.dubbo.common.URL url)
        Is the URL for the MetadataService or not?
        参数:
        url - url
        返回:
      • toURLs

        static List<org.apache.dubbo.common.URL> toURLs​(Iterable<String> urls)
        Convert the multiple urls to a list of urls
        参数:
        urls - the strings presents the Dubbo URLs
        返回:
        non-null
      • 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()
      • exportServiceDiscoveryMetadata

        default void exportServiceDiscoveryMetadata​(String metadata)
        Export Metadata in Service Instance of Service Discovery

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

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

        default Map<String,​MetadataChangeListener> getMetadataChangeListenerMap()
        Get all Metadata listener from local

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

        返回:
        Map of MetadataChangeListener
        从以下版本开始:
        3.0
      • getAndListenServiceDiscoveryMetadata

        default String getAndListenServiceDiscoveryMetadata​(String consumerId,
                                                            MetadataChangeListener 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 - MetadataChangeListener used to notify event
        返回:
        Map of provider Service Instance Metadata
        从以下版本开始:
        3.0