接口 NamingService


public interface NamingService
Naming Service.
作者:
nkorange
  • 方法详细资料

    • registerInstance

      void registerInstance(String serviceName, String ip, int port) throws NacosException
      register a instance to service.
      参数:
      serviceName - name of service
      ip - instance ip
      port - instance port
      抛出:
      NacosException - nacos exception
    • registerInstance

      void registerInstance(String serviceName, String groupName, String ip, int port) throws NacosException
      register a instance to service.
      参数:
      serviceName - name of service
      groupName - group of service
      ip - instance ip
      port - instance port
      抛出:
      NacosException - nacos exception
    • registerInstance

      void registerInstance(String serviceName, String ip, int port, String clusterName) throws NacosException
      register a instance to service with specified cluster name.
      参数:
      serviceName - name of service
      ip - instance ip
      port - instance port
      clusterName - instance cluster name
      抛出:
      NacosException - nacos exception
    • registerInstance

      void registerInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException
      register a instance to service with specified cluster name.
      参数:
      serviceName - name of service
      groupName - group of service
      ip - instance ip
      port - instance port
      clusterName - instance cluster name
      抛出:
      NacosException - nacos exception
    • registerInstance

      void registerInstance(String serviceName, Instance instance) throws NacosException
      register a instance to service with specified instance properties.
      参数:
      serviceName - name of service
      instance - instance to register
      抛出:
      NacosException - nacos exception
    • registerInstance

      void registerInstance(String serviceName, String groupName, Instance instance) throws NacosException
      register a instance to service with specified instance properties.
      参数:
      serviceName - name of service
      groupName - group of service
      instance - instance to register
      抛出:
      NacosException - nacos exception
    • deregisterInstance

      void deregisterInstance(String serviceName, String ip, int port) throws NacosException
      deregister instance from a service.
      参数:
      serviceName - name of service
      ip - instance ip
      port - instance port
      抛出:
      NacosException - nacos exception
    • deregisterInstance

      void deregisterInstance(String serviceName, String groupName, String ip, int port) throws NacosException
      deregister instance from a service.
      参数:
      serviceName - name of service
      groupName - group of service
      ip - instance ip
      port - instance port
      抛出:
      NacosException - nacos exception
    • deregisterInstance

      void deregisterInstance(String serviceName, String ip, int port, String clusterName) throws NacosException
      deregister instance with specified cluster name from a service.
      参数:
      serviceName - name of service
      ip - instance ip
      port - instance port
      clusterName - instance cluster name
      抛出:
      NacosException - nacos exception
    • deregisterInstance

      void deregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException
      deregister instance with specified cluster name from a service.
      参数:
      serviceName - name of service
      groupName - group of service
      ip - instance ip
      port - instance port
      clusterName - instance cluster name
      抛出:
      NacosException - nacos exception
    • deregisterInstance

      void deregisterInstance(String serviceName, Instance instance) throws NacosException
      deregister instance with full instance information and default groupName.
      参数:
      serviceName - name of service
      instance - instance
      抛出:
      NacosException - nacos exception
    • deregisterInstance

      void deregisterInstance(String serviceName, String groupName, Instance instance) throws NacosException
      deregister instance with full instance information.
      参数:
      serviceName - name of service
      groupName - group of service
      instance - instance information
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName) throws NacosException
      get all instances of a service.
      参数:
      serviceName - name of service
      返回:
      A list of instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, String groupName) throws NacosException
      get all instances of a service.
      参数:
      serviceName - name of service
      groupName - group of service
      返回:
      A list of instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, boolean subscribe) throws NacosException
      Get all instances of a service.
      参数:
      serviceName - name of service
      subscribe - if subscribe the service
      返回:
      A list of instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, String groupName, boolean subscribe) throws NacosException
      Get all instances of a service.
      参数:
      serviceName - name of service
      groupName - group of service
      subscribe - if subscribe the service
      返回:
      A list of instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, List<String> clusters) throws NacosException
      Get all instances within specified clusters of a service.
      参数:
      serviceName - name of service
      clusters - list of cluster
      返回:
      A list of qualified instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, String groupName, List<String> clusters) throws NacosException
      Get all instances within specified clusters of a service.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - list of cluster
      返回:
      A list of qualified instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, List<String> clusters, boolean subscribe) throws NacosException
      Get all instances within specified clusters of a service.
      参数:
      serviceName - name of service
      clusters - list of cluster
      subscribe - if subscribe the service
      返回:
      A list of qualified instance
      抛出:
      NacosException - nacos exception
    • getAllInstances

      List<Instance> getAllInstances(String serviceName, String groupName, List<String> clusters, boolean subscribe) throws NacosException
      Get all instances within specified clusters of a service.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - list of cluster
      subscribe - if subscribe the service
      返回:
      A list of qualified instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, boolean healthy) throws NacosException
      Get qualified instances of service.
      参数:
      serviceName - name of service.
      healthy - a flag to indicate returning healthy or unhealthy instances
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, String groupName, boolean healthy) throws NacosException
      Get qualified instances of service.
      参数:
      serviceName - name of service
      groupName - group of service
      healthy - a flag to indicate returning healthy or unhealthy instances
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, boolean healthy, boolean subscribe) throws NacosException
      Get qualified instances of service.
      参数:
      serviceName - name of service
      healthy - a flag to indicate returning healthy or unhealthy instances
      subscribe - if subscribe the service
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, String groupName, boolean healthy, boolean subscribe) throws NacosException
      Get qualified instances of service.
      参数:
      serviceName - name of service
      groupName - group of service
      healthy - a flag to indicate returning healthy or unhealthy instances
      subscribe - if subscribe the service
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, List<String> clusters, boolean healthy) throws NacosException
      Get qualified instances within specified clusters of service.
      参数:
      serviceName - name of service
      clusters - list of cluster
      healthy - a flag to indicate returning healthy or unhealthy instances
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, String groupName, List<String> clusters, boolean healthy) throws NacosException
      Get qualified instances within specified clusters of service.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - list of cluster
      healthy - a flag to indicate returning healthy or unhealthy instances
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, List<String> clusters, boolean healthy, boolean subscribe) throws NacosException
      Get qualified instances within specified clusters of service.
      参数:
      serviceName - name of service
      clusters - list of cluster
      healthy - a flag to indicate returning healthy or unhealthy instances
      subscribe - if subscribe the service
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectInstances

      List<Instance> selectInstances(String serviceName, String groupName, List<String> clusters, boolean healthy, boolean subscribe) throws NacosException
      Get qualified instances within specified clusters of service.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - list of cluster
      healthy - a flag to indicate returning healthy or unhealthy instances
      subscribe - if subscribe the service
      返回:
      A qualified list of instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName) throws NacosException
      Select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, String groupName) throws NacosException
      Select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      groupName - group of service
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, boolean subscribe) throws NacosException
      select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      subscribe - if subscribe the service
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, String groupName, boolean subscribe) throws NacosException
      select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      groupName - group of service
      subscribe - if subscribe the service
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, List<String> clusters) throws NacosException
      Select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      clusters - a list of clusters should the instance belongs to
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters) throws NacosException
      Select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - a list of clusters should the instance belongs to
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, List<String> clusters, boolean subscribe) throws NacosException
      Select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      clusters - a list of clusters should the instance belongs to
      subscribe - if subscribe the service
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • selectOneHealthyInstance

      Instance selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters, boolean subscribe) throws NacosException
      Select one healthy instance of service using predefined load balance strategy.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - a list of clusters should the instance belongs to
      subscribe - if subscribe the service
      返回:
      qualified instance
      抛出:
      NacosException - nacos exception
    • subscribe

      void subscribe(String serviceName, EventListener listener) throws NacosException
      Subscribe service to receive events of instances alteration.
      参数:
      serviceName - name of service
      listener - event listener
      抛出:
      NacosException - nacos exception
    • subscribe

      void subscribe(String serviceName, String groupName, EventListener listener) throws NacosException
      Subscribe service to receive events of instances alteration.
      参数:
      serviceName - name of service
      groupName - group of service
      listener - event listener
      抛出:
      NacosException - nacos exception
    • subscribe

      void subscribe(String serviceName, List<String> clusters, EventListener listener) throws NacosException
      Subscribe service to receive events of instances alteration.
      参数:
      serviceName - name of service
      clusters - list of cluster
      listener - event listener
      抛出:
      NacosException - nacos exception
    • subscribe

      void subscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws NacosException
      Subscribe service to receive events of instances alteration.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - list of cluster
      listener - event listener
      抛出:
      NacosException - nacos exception
    • unsubscribe

      void unsubscribe(String serviceName, EventListener listener) throws NacosException
      Unsubscribe event listener of service.
      参数:
      serviceName - name of service
      listener - event listener
      抛出:
      NacosException - nacos exception
    • unsubscribe

      void unsubscribe(String serviceName, String groupName, EventListener listener) throws NacosException
      unsubscribe event listener of service.
      参数:
      serviceName - name of service
      groupName - group of service
      listener - event listener
      抛出:
      NacosException - nacos exception
    • unsubscribe

      void unsubscribe(String serviceName, List<String> clusters, EventListener listener) throws NacosException
      Unsubscribe event listener of service.
      参数:
      serviceName - name of service
      clusters - list of cluster
      listener - event listener
      抛出:
      NacosException - nacos exception
    • unsubscribe

      void unsubscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws NacosException
      Unsubscribe event listener of service.
      参数:
      serviceName - name of service
      groupName - group of service
      clusters - list of cluster
      listener - event listener
      抛出:
      NacosException - nacos exception
    • getServicesOfServer

      ListView<String> getServicesOfServer(int pageNo, int pageSize) throws NacosException
      Get all service names from server.
      参数:
      pageNo - page index
      pageSize - page size
      返回:
      list of service names
      抛出:
      NacosException - nacos exception
    • getServicesOfServer

      ListView<String> getServicesOfServer(int pageNo, int pageSize, String groupName) throws NacosException
      Get all service names from server.
      参数:
      pageNo - page index
      pageSize - page size
      groupName - group name
      返回:
      list of service names
      抛出:
      NacosException - nacos exception
    • getServicesOfServer

      ListView<String> getServicesOfServer(int pageNo, int pageSize, AbstractSelector selector) throws NacosException
      Get all service names from server with selector.
      参数:
      pageNo - page index
      pageSize - page size
      selector - selector to filter the resource
      返回:
      list of service names
      抛出:
      NacosException - nacos exception
      从以下版本开始:
      0.7.0
    • getServicesOfServer

      ListView<String> getServicesOfServer(int pageNo, int pageSize, String groupName, AbstractSelector selector) throws NacosException
      Get all service names from server with selector.
      参数:
      pageNo - page index
      pageSize - page size
      groupName - group name
      selector - selector to filter the resource
      返回:
      list of service names
      抛出:
      NacosException - nacos exception
    • getSubscribeServices

      List<ServiceInfo> getSubscribeServices() throws NacosException
      Get all subscribed services of current client.
      返回:
      subscribed services
      抛出:
      NacosException - nacos exception
    • getServerStatus

      String getServerStatus()
      get server health status.
      返回:
      is server healthy
    • shutDown

      void shutDown() throws NacosException
      Shutdown the resource service.
      抛出:
      NacosException - exception.