Class ServiceInstanceMetadataUtils
java.lang.Object
org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils
The Utilities class for the
metadata of the service instance- Since:
- 2.7.5
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe property name of The revision for all exported Dubbo services.static final Stringstatic final StringThe prefix ofMetadataService: "dubbo.metadata-service."static final StringThe property name of metadata JSON ofMetadataService'sURLstatic final StringTheURLsproperty name ofMetadataService: "dubbo.metadata-service.urls", which is used to be compatible with Dubbo Spring Cloud and discovery the metadata of instancestatic final Stringstatic final StringThe property name of metadata storage type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcustomizeInstance(ServiceInstance instance, ApplicationModel applicationModel) getEndpoint(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 Stringstatic 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)
-
Field Details
-
METADATA_SERVICE_PREFIX
The prefix ofMetadataService: "dubbo.metadata-service."- See Also:
-
ENDPOINTS
- See Also:
-
METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME
The property name of metadata JSON ofMetadataService'sURL- See Also:
-
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- See Also:
-
EXPORTED_SERVICES_REVISION_PROPERTY_NAME
The property name of The revision for all exported Dubbo services.- See Also:
-
METADATA_STORAGE_TYPE_PROPERTY_NAME
The property name of metadata storage type.- See Also:
-
METADATA_SERVICE_VERSION_NAME
- See Also:
-
METADATA_CLUSTER_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
ServiceInstanceMetadataUtils
public ServiceInstanceMetadataUtils()
-
-
Method Details
-
getMetadataServiceParameter
-
getExportedServicesRevision
The revision for all exported Dubbo services from the specifiedServiceInstance.- Parameters:
serviceInstance- the specifiedServiceInstance- Returns:
nullif not exits
-
getMetadataStorageType
Get metadata's storage type- Parameters:
registryURL- theURLto connect the registry- Returns:
- if not found in
parametersofregistry URL, return
-
getMetadataStorageType
Get the metadata storage type specified by the peer instance.- Returns:
- storage type, remote or local
-
setMetadataStorageType
Set the metadata storage type in specifiedservice instance- Parameters:
serviceInstance-service instancemetadataType- remote or local
-
getRemoteCluster
-
hasEndpoints
-
setEndpoints
-
getEndpoint
public static DefaultServiceInstance.Endpoint getEndpoint(ServiceInstance serviceInstance, String protocol) Get the property value of port by the specifiedthe metadata of service instanceand protocol- Parameters:
serviceInstance-service instanceprotocol- the name of protocol, e.g, dubbo, rest, and so on- Returns:
- if not found, return
null
-
registerMetadataAndInstance
-
refreshMetadataAndInstance
-
unregisterMetadataAndInstance
-
customizeInstance
-
isValidInstance
-