public class ServiceInstanceMetadataUtils extends Object
metadata of the service instanceStandardMetadataServiceURLBuilder,
ServiceInstance.getMetadata(),
MetadataService,
URL| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceInstanceMetadataUtils.Endpoint |
| Modifier and Type | Field and Description |
|---|---|
static String |
ENDPOINTS |
static String |
EXPORTED_SERVICES_REVISION_PROPERTY_NAME
The property name of The revision for all exported Dubbo services.
|
static String |
METADATA_SERVICE_PREFIX
The prefix of
MetadataService : "dubbo.metadata-service." |
static String |
METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME
The property name of metadata JSON of
MetadataService's URL |
static String |
METADATA_SERVICE_URLS_PROPERTY_NAME
The
URLs property name of MetadataService :
"dubbo.metadata-service.urls", which is used to be compatible with Dubbo Spring Cloud and
discovery the metadata of instance |
static String |
METADATA_STORAGE_TYPE_PROPERTY_NAME
The property name of metadata storage type.
|
static String |
SUBSCRIBER_SERVICES_REVISION_PROPERTY_NAME
The property name of The revision for all subscribed Dubbo services.
|
| Constructor and Description |
|---|
ServiceInstanceMetadataUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getExportedServicesRevision(ServiceInstance serviceInstance)
The revision for all exported Dubbo services from the specified
ServiceInstance. |
static String |
getMetadataServiceParameter(List<URL> urls) |
static Map<String,String> |
getMetadataServiceURLParams(ServiceInstance serviceInstance,
String protocol)
Get the
url's parameters of MetadataService's Metadata |
static Map<String,Map<String,String>> |
getMetadataServiceURLsParams(ServiceInstance serviceInstance)
Get the multiple
urls' parameters of MetadataService's Metadata |
static String |
getMetadataStorageType(ServiceInstance serviceInstance)
Get the metadata's storage type is used to which
WritableMetadataService instance. |
static String |
getMetadataStorageType(URL registryURL)
Get metadata's storage type
|
static Integer |
getProtocolPort(ServiceInstance serviceInstance,
String protocol)
Get the property value of port by the specified
the metadata of
service instance and protocol |
static String |
getSubscribedServicesRevision(ServiceInstance serviceInstance)
The revision for all subscribed Dubbo services from the specified
ServiceInstance. |
static boolean |
isDubboServiceInstance(ServiceInstance serviceInstance)
Is Dubbo Service instance or not
|
static void |
setEndpoints(ServiceInstance serviceInstance,
Map<String,Integer> protocolPortss) |
static void |
setMetadataStorageType(ServiceInstance serviceInstance,
String metadataType)
Set the metadata storage type in specified
service instance |
public static final String METADATA_SERVICE_PREFIX
MetadataService : "dubbo.metadata-service."public static final String ENDPOINTS
public static String METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME
MetadataService's URLpublic static final String METADATA_SERVICE_URLS_PROPERTY_NAME
URLs property name of MetadataService :
"dubbo.metadata-service.urls", which is used to be compatible with Dubbo Spring Cloud and
discovery the metadata of instancepublic static String EXPORTED_SERVICES_REVISION_PROPERTY_NAME
public static String SUBSCRIBER_SERVICES_REVISION_PROPERTY_NAME
public static String METADATA_STORAGE_TYPE_PROPERTY_NAME
public static Map<String,Map<String,String>> getMetadataServiceURLsParams(ServiceInstance serviceInstance)
urls' parameters of MetadataService's MetadataserviceInstance - the instance of ServiceInstanceMap, the key is the protocol of URL, the value is
getMetadataServiceURLParams(ServiceInstance, String)public static Map<String,String> getMetadataServiceURLParams(ServiceInstance serviceInstance, String protocol)
url's parameters of MetadataService's MetadataserviceInstance - the instance of ServiceInstanceMappublic static String getExportedServicesRevision(ServiceInstance serviceInstance)
ServiceInstance.serviceInstance - the specified ServiceInstancenull if not exitspublic static String getSubscribedServicesRevision(ServiceInstance serviceInstance)
ServiceInstance.serviceInstance - the specified ServiceInstancenull if not exitspublic static String getMetadataStorageType(URL registryURL)
registryURL - the URL to connect the registryparameters of registry URL, returnpublic static String getMetadataStorageType(ServiceInstance serviceInstance)
WritableMetadataService instance.serviceInstance - the specified ServiceInstancemetadata of ServiceInstance, returnpublic static void setMetadataStorageType(ServiceInstance serviceInstance, String metadataType)
service instanceserviceInstance - service instancemetadataType - remote or localpublic static boolean isDubboServiceInstance(ServiceInstance serviceInstance)
serviceInstance - service instancetrue, or falsepublic static void setEndpoints(ServiceInstance serviceInstance, Map<String,Integer> protocolPortss)
public static Integer getProtocolPort(ServiceInstance serviceInstance, String protocol)
the metadata of
service instance and protocolserviceInstance - service instanceprotocol - the name of protocol, e.g, dubbo, rest, and so onnullCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.