public class ServiceInstanceMetadataUtils extends Object
metadata of the service instanceStandardMetadataServiceURLBuilder,
ServiceInstance.getMetadata(),
MetadataService,
URL| 限定符和类型 | 类和说明 |
|---|---|
static class |
ServiceInstanceMetadataUtils.Endpoint |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ENDPOINTS |
static String |
EXPORTED_SERVICES_REVISION_PROPERTY_NAME
The property name of The revision for all exported Dubbo services.
|
static String |
INSTANCE_REVISION_UPDATED_KEY |
static String |
METADATA_CLUSTER_PROPERTY_NAME |
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.
|
| 构造器和说明 |
|---|
ServiceInstanceMetadataUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
calInstanceRevision(ServiceDiscovery serviceDiscovery,
ServiceInstance instance) |
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 |
getRemoteCluster(ServiceInstance serviceInstance) |
static boolean |
isDubboServiceInstance(ServiceInstance serviceInstance)
Is Dubbo Service instance or not
|
static boolean |
isInstanceUpdated(ServiceInstance instance) |
static void |
refreshMetadataAndInstance() |
static void |
resetInstanceUpdateKey(ServiceInstance instance) |
static void |
setEndpoints(ServiceInstance serviceInstance,
Map<String,Integer> protocolPorts) |
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 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 METADATA_STORAGE_TYPE_PROPERTY_NAME
public static String METADATA_CLUSTER_PROPERTY_NAME
public static String INSTANCE_REVISION_UPDATED_KEY
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 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 String getRemoteCluster(ServiceInstance serviceInstance)
public static boolean isDubboServiceInstance(ServiceInstance serviceInstance)
serviceInstance - service instancetrue, or falsepublic static void setEndpoints(ServiceInstance serviceInstance, Map<String,Integer> protocolPorts)
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 onnullpublic static void calInstanceRevision(ServiceDiscovery serviceDiscovery, ServiceInstance instance)
public static boolean isInstanceUpdated(ServiceInstance instance)
public static void resetInstanceUpdateKey(ServiceInstance instance)
public static void refreshMetadataAndInstance()
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.