public class ServiceInstanceMetadataUtils extends Object
metadata of the service instanceStandardMetadataServiceURLBuilder,
ServiceInstance.getMetadata(),
MetadataService,
URL| 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 com.google.gson.Gson |
gson |
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.
|
| Constructor and Description |
|---|
ServiceInstanceMetadataUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
customizeInstance(ServiceInstance instance,
ApplicationModel applicationModel) |
static DefaultServiceInstance.Endpoint |
getEndpoint(ServiceInstance serviceInstance,
String protocol)
Get the property value of port by the specified
the metadata of
service instance and protocol |
static String |
getExportedServicesRevision(ServiceInstance serviceInstance)
The revision for all exported Dubbo services from the specified
ServiceInstance. |
static String |
getMetadataServiceParameter(URL url) |
static String |
getMetadataStorageType(ServiceInstance serviceInstance)
Get the metadata storage type specified by the peer instance.
|
static String |
getMetadataStorageType(URL registryURL)
Get metadata's storage type
|
static String |
getRemoteCluster(ServiceInstance serviceInstance) |
static boolean |
hasEndpoints(ServiceInstance serviceInstance) |
static boolean |
isValidInstance(ServiceInstance instance) |
static void |
refreshMetadataAndInstance(ApplicationModel applicationModel) |
static void |
registerMetadataAndInstance(ApplicationModel applicationModel) |
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 |
static void |
unregisterMetadataAndInstance(ApplicationModel applicationModel) |
public static final String METADATA_SERVICE_PREFIX
MetadataService : "dubbo.metadata-service."public static final String ENDPOINTS
public static final 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 final String EXPORTED_SERVICES_REVISION_PROPERTY_NAME
public static final String METADATA_STORAGE_TYPE_PROPERTY_NAME
public static final String METADATA_CLUSTER_PROPERTY_NAME
public static final String INSTANCE_REVISION_UPDATED_KEY
public static final com.google.gson.Gson gson
public 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)
public static void setMetadataStorageType(ServiceInstance serviceInstance, String metadataType)
service instanceserviceInstance - service instancemetadataType - remote or localpublic static String getRemoteCluster(ServiceInstance serviceInstance)
public static boolean hasEndpoints(ServiceInstance serviceInstance)
public static void setEndpoints(ServiceInstance serviceInstance, Map<String,Integer> protocolPorts)
public static DefaultServiceInstance.Endpoint getEndpoint(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 registerMetadataAndInstance(ApplicationModel applicationModel)
public static void refreshMetadataAndInstance(ApplicationModel applicationModel)
public static void unregisterMetadataAndInstance(ApplicationModel applicationModel)
public static void customizeInstance(ServiceInstance instance, ApplicationModel applicationModel)
public static boolean isValidInstance(ServiceInstance instance)
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.