类 NacosServiceDiscovery
java.lang.Object
com.alibaba.cloud.nacos.discovery.NacosServiceDiscovery
- 作者:
- echooymxq, changjin wei(魏昌进)
-
构造器概要
构造器构造器说明NacosServiceDiscovery(NacosDiscoveryProperties discoveryProperties, NacosServiceManager nacosServiceManager) -
方法概要
修饰符和类型方法说明List<org.springframework.cloud.client.ServiceInstance>getInstances(String serviceId) Return all instances for the given service.Return the names of all services.static org.springframework.cloud.client.ServiceInstancehostToServiceInstance(com.alibaba.nacos.api.naming.pojo.Instance instance, String serviceId) static List<org.springframework.cloud.client.ServiceInstance>hostToServiceInstanceList(List<com.alibaba.nacos.api.naming.pojo.Instance> instances, String serviceId)
-
构造器详细资料
-
NacosServiceDiscovery
public NacosServiceDiscovery(NacosDiscoveryProperties discoveryProperties, NacosServiceManager nacosServiceManager)
-
-
方法详细资料
-
getInstances
public List<org.springframework.cloud.client.ServiceInstance> getInstances(String serviceId) throws com.alibaba.nacos.api.exception.NacosException Return all instances for the given service.- 参数:
serviceId- id of service- 返回:
- list of instances
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacosException
-
getServices
Return the names of all services.- 返回:
- list of service names
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacosException
-
hostToServiceInstanceList
-
hostToServiceInstance
public static org.springframework.cloud.client.ServiceInstance hostToServiceInstance(com.alibaba.nacos.api.naming.pojo.Instance instance, String serviceId)
-