类 ServiceInstanceMetadataUtils
- java.lang.Object
-
- org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils
-
public class ServiceInstanceMetadataUtils extends Object
The Utilities class for themetadata of the service instance- 从以下版本开始:
- 2.7.5
- 另请参阅:
StandardMetadataServiceURLBuilder,ServiceInstance.getMetadata(),MetadataService,URL
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringENDPOINTSstatic StringEXPORTED_SERVICES_REVISION_PROPERTY_NAMEThe property name of The revision for all exported Dubbo services.static StringMETADATA_CLUSTER_PROPERTY_NAMEstatic StringMETADATA_SERVICE_PREFIXThe prefix ofMetadataService: "dubbo.metadata-service."static StringMETADATA_SERVICE_URL_PARAMS_PROPERTY_NAMEThe property name of metadata JSON ofMetadataService'sURLstatic StringMETADATA_SERVICE_URLS_PROPERTY_NAMETheURLsproperty name ofMetadataService: "dubbo.metadata-service.urls", which is used to be compatible with Dubbo Spring Cloud and discovery the metadata of instancestatic StringMETADATA_STORAGE_TYPE_PROPERTY_NAMEThe property name of metadata storage type.
-
构造器概要
构造器 构造器 说明 ServiceInstanceMetadataUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidcustomizeInstance(ServiceInstance instance, ApplicationModel applicationModel)static DefaultServiceInstance.EndpointgetEndpoint(ServiceInstance serviceInstance, String protocol)Get the property value of port by the specifiedthe metadata of service instanceand protocolstatic StringgetExportedServicesRevision(ServiceInstance serviceInstance)The revision for all exported Dubbo services from the specifiedServiceInstance.static StringgetMetadataServiceParameter(URL url)static StringgetMetadataStorageType(URL registryURL)Get metadata's storage typestatic StringgetMetadataStorageType(ServiceInstance serviceInstance)Get the metadata storage type specified by the peer instance.static StringgetRemoteCluster(ServiceInstance serviceInstance)static booleanhasEndpoints(ServiceInstance serviceInstance)static booleanisValidInstance(ServiceInstance instance)static voidrefreshMetadataAndInstance(ApplicationModel applicationModel)static voidregisterMetadataAndInstance(ApplicationModel applicationModel)static voidsetEndpoints(ServiceInstance serviceInstance, Map<String,Integer> protocolPorts)static voidsetMetadataStorageType(ServiceInstance serviceInstance, String metadataType)Set the metadata storage type in specifiedservice instancestatic voidunregisterMetadataAndInstance(ApplicationModel applicationModel)
-
-
-
字段详细资料
-
METADATA_SERVICE_PREFIX
public static final String METADATA_SERVICE_PREFIX
The prefix ofMetadataService: "dubbo.metadata-service."- 另请参阅:
- 常量字段值
-
METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME
public static final String METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME
The property name of metadata JSON ofMetadataService'sURL- 另请参阅:
- 常量字段值
-
METADATA_SERVICE_URLS_PROPERTY_NAME
public static final String METADATA_SERVICE_URLS_PROPERTY_NAME
TheURLsproperty name ofMetadataService: "dubbo.metadata-service.urls", which is used to be compatible with Dubbo Spring Cloud and discovery the metadata of instance- 另请参阅:
- 常量字段值
-
EXPORTED_SERVICES_REVISION_PROPERTY_NAME
public static final String EXPORTED_SERVICES_REVISION_PROPERTY_NAME
The property name of The revision for all exported Dubbo services.- 另请参阅:
- 常量字段值
-
METADATA_STORAGE_TYPE_PROPERTY_NAME
public static final String METADATA_STORAGE_TYPE_PROPERTY_NAME
The property name of metadata storage type.- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
getExportedServicesRevision
public static String getExportedServicesRevision(ServiceInstance serviceInstance)
The revision for all exported Dubbo services from the specifiedServiceInstance.- 参数:
serviceInstance- the specifiedServiceInstance- 返回:
nullif not exits
-
getMetadataStorageType
public static String getMetadataStorageType(URL registryURL)
Get metadata's storage type- 参数:
registryURL- theURLto connect the registry- 返回:
- if not found in
parametersofregistry URL, return
-
getMetadataStorageType
public static String getMetadataStorageType(ServiceInstance serviceInstance)
Get the metadata storage type specified by the peer instance.- 返回:
- storage type, remote or local
-
setMetadataStorageType
public static void setMetadataStorageType(ServiceInstance serviceInstance, String metadataType)
Set the metadata storage type in specifiedservice instance- 参数:
serviceInstance-service instancemetadataType- remote or local
-
getRemoteCluster
public static String getRemoteCluster(ServiceInstance serviceInstance)
-
hasEndpoints
public static boolean hasEndpoints(ServiceInstance serviceInstance)
-
setEndpoints
public static void setEndpoints(ServiceInstance serviceInstance, Map<String,Integer> protocolPorts)
-
getEndpoint
public static DefaultServiceInstance.Endpoint getEndpoint(ServiceInstance serviceInstance, String protocol)
Get the property value of port by the specifiedthe metadata of service instanceand protocol- 参数:
serviceInstance-service instanceprotocol- the name of protocol, e.g, dubbo, rest, and so on- 返回:
- if not found, return
null
-
registerMetadataAndInstance
public static void registerMetadataAndInstance(ApplicationModel applicationModel)
-
refreshMetadataAndInstance
public static void refreshMetadataAndInstance(ApplicationModel applicationModel)
-
unregisterMetadataAndInstance
public static void unregisterMetadataAndInstance(ApplicationModel applicationModel)
-
customizeInstance
public static void customizeInstance(ServiceInstance instance, ApplicationModel applicationModel)
-
isValidInstance
public static boolean isValidInstance(ServiceInstance instance)
-
-