类 NacosServiceDiscovery

java.lang.Object
com.alibaba.cloud.nacos.discovery.NacosServiceDiscovery

public class NacosServiceDiscovery extends Object
作者:
echooymxq, changjin wei(魏昌进)
  • 构造器详细资料

  • 方法详细资料

    • 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

      public List<String> getServices() throws com.alibaba.nacos.api.exception.NacosException
      Return the names of all services.
      返回:
      list of service names
      抛出:
      com.alibaba.nacos.api.exception.NacosException - nacosException
    • hostToServiceInstanceList

      public static List<org.springframework.cloud.client.ServiceInstance> hostToServiceInstanceList(List<com.alibaba.nacos.api.naming.pojo.Instance> instances, String serviceId)
    • hostToServiceInstance

      public static org.springframework.cloud.client.ServiceInstance hostToServiceInstance(com.alibaba.nacos.api.naming.pojo.Instance instance, String serviceId)