@Repository public class DubboServiceMetadataRepository extends Object implements org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationEventPublisherAware
Repository.| Modifier and Type | Field and Description |
|---|---|
static String |
DUBBO_METADATA_SERVICE_PREFIX
Deprecated.
|
static String |
DUBBO_METADATA_SERVICE_URLS_PROPERTY_NAME
Deprecated.
|
static String |
DUBBO_PROTOCOLS_PORT_PROPERTY_NAME_PATTERN
The
pattern of dubbo protocols port. |
| Constructor and Description |
|---|
DubboServiceMetadataRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterSingletonsInstantiated() |
protected Set<String> |
doGetSubscribedServices() |
void |
exportURL(org.apache.dubbo.common.URL url) |
List<org.apache.dubbo.common.URL> |
findSubscribedDubboMetadataServiceURLs(org.apache.dubbo.common.URL subscribedURL) |
DubboRestServiceMetadata |
get(String serviceName,
RequestMetadata requestMetadata)
Get a
DubboRestServiceMetadata by the specified service name if
RequestMetadata matched. |
Map<String,List<org.apache.dubbo.common.URL>> |
getAllExportedUrls()
Get all exported
urls. |
Set<String> |
getAllServiceKeys()
Get all exported
service keys. |
Map<String,String> |
getDubboMetadataServiceMetadata()
Get the metadata
Map of DubboMetadataService. |
Integer |
getDubboProtocolPort(org.springframework.cloud.client.ServiceInstance serviceInstance,
String protocol) |
List<org.apache.dubbo.common.URL> |
getExportedURLs(String serviceInterface,
String group,
String version) |
Set<ServiceRestMetadata> |
getServiceRestMetadata()
Get the
Set of ServiceRestMetadata. |
Set<String> |
getSubscribedServices() |
protected void |
initDubboRestServiceMetadataRepository(String serviceName)
Initialize the specified service's
ServiceRestMetadata. |
void |
initializeMetadata(String serviceName)
Initialize the metadata of Dubbo Services.
|
Stream<String> |
initSubscribedServices()
Initialize
the subscribed services. |
boolean |
isSubscribedService(String serviceName)
The specified service is subscribe or not.
|
void |
publishServiceRestMetadata(Set<ServiceRestMetadata> serviceRestMetadataSet)
Publish the
Set of ServiceRestMetadata. |
void |
removeMetadataAndInitializedService(String serviceName,
org.apache.dubbo.common.URL url)
Remove the metadata and initialized service of Dubbo Services if no there is no
service instance.
|
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
unexportURL(org.apache.dubbo.common.URL url) |
@Deprecated public static final String DUBBO_METADATA_SERVICE_PREFIX
DubboMetadataService : "dubbo.metadata-service.".@Deprecated public static final String DUBBO_METADATA_SERVICE_URLS_PROPERTY_NAME
URLs property name of DubboMetadataService :
"dubbo.metadata-service.urls".public static final String DUBBO_PROTOCOLS_PORT_PROPERTY_NAME_PATTERN
pattern of dubbo protocols port.@PostConstruct public Stream<String> initSubscribedServices()
the subscribed services.public void afterSingletonsInstantiated()
afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingletonpublic void initializeMetadata(String serviceName)
serviceName - service of namepublic void removeMetadataAndInitializedService(String serviceName, org.apache.dubbo.common.URL url)
serviceName - the service nameurl - the meta service urlpublic Map<String,String> getDubboMetadataServiceMetadata()
Map of DubboMetadataService.Mappublic void publishServiceRestMetadata(Set<ServiceRestMetadata> serviceRestMetadataSet)
Set of ServiceRestMetadata.serviceRestMetadataSet - the Set of ServiceRestMetadatapublic Set<ServiceRestMetadata> getServiceRestMetadata()
Set of ServiceRestMetadata.Setpublic boolean isSubscribedService(String serviceName)
serviceName - the service namepublic void exportURL(org.apache.dubbo.common.URL url)
public void unexportURL(org.apache.dubbo.common.URL url)
public Map<String,List<org.apache.dubbo.common.URL>> getAllExportedUrls()
urls.public Set<String> getAllServiceKeys()
service keys.public Integer getDubboProtocolPort(org.springframework.cloud.client.ServiceInstance serviceInstance, String protocol)
public List<org.apache.dubbo.common.URL> getExportedURLs(String serviceInterface, String group, String version)
protected void initDubboRestServiceMetadataRepository(String serviceName)
ServiceRestMetadata.serviceName - the service namepublic DubboRestServiceMetadata get(String serviceName, RequestMetadata requestMetadata)
DubboRestServiceMetadata by the specified service name if
RequestMetadata matched.serviceName - service namerequestMetadata - RequestMetadata to be matchedDubboRestServiceMetadata if matched, or nullpublic void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic List<org.apache.dubbo.common.URL> findSubscribedDubboMetadataServiceURLs(org.apache.dubbo.common.URL subscribedURL)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.