接口 NamingService
public interface NamingService
Naming Service.
- 作者:
- nkorange
-
方法概要
修饰符和类型方法说明voidderegisterInstance(String serviceName, Instance instance)deregister instance with full instance information and default groupName.voidderegisterInstance(String serviceName, String ip, int port)deregister instance from a service.voidderegisterInstance(String serviceName, String ip, int port, String clusterName)deregister instance with specified cluster name from a service.voidderegisterInstance(String serviceName, String groupName, Instance instance)deregister instance with full instance information.voidderegisterInstance(String serviceName, String groupName, String ip, int port)deregister instance from a service.voidderegisterInstance(String serviceName, String groupName, String ip, int port, String clusterName)deregister instance with specified cluster name from a service.getAllInstances(String serviceName)get all instances of a service.getAllInstances(String serviceName, boolean subscribe)Get all instances of a service.getAllInstances(String serviceName, String groupName)get all instances of a service.getAllInstances(String serviceName, String groupName, boolean subscribe)Get all instances of a service.getAllInstances(String serviceName, String groupName, List<String> clusters)Get all instances within specified clusters of a service.getAllInstances(String serviceName, String groupName, List<String> clusters, boolean subscribe)Get all instances within specified clusters of a service.getAllInstances(String serviceName, List<String> clusters)Get all instances within specified clusters of a service.getAllInstances(String serviceName, List<String> clusters, boolean subscribe)Get all instances within specified clusters of a service.get server health status.getServicesOfServer(int pageNo, int pageSize)Get all service names from server.getServicesOfServer(int pageNo, int pageSize, AbstractSelector selector)Get all service names from server with selector.getServicesOfServer(int pageNo, int pageSize, String groupName)Get all service names from server.getServicesOfServer(int pageNo, int pageSize, String groupName, AbstractSelector selector)Get all service names from server with selector.Get all subscribed services of current client.voidregisterInstance(String serviceName, Instance instance)register a instance to service with specified instance properties.voidregisterInstance(String serviceName, String ip, int port)register a instance to service.voidregisterInstance(String serviceName, String ip, int port, String clusterName)register a instance to service with specified cluster name.voidregisterInstance(String serviceName, String groupName, Instance instance)register a instance to service with specified instance properties.voidregisterInstance(String serviceName, String groupName, String ip, int port)register a instance to service.voidregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName)register a instance to service with specified cluster name.selectInstances(String serviceName, boolean healthy)Get qualified instances of service.selectInstances(String serviceName, boolean healthy, boolean subscribe)Get qualified instances of service.selectInstances(String serviceName, String groupName, boolean healthy)Get qualified instances of service.selectInstances(String serviceName, String groupName, boolean healthy, boolean subscribe)Get qualified instances of service.selectInstances(String serviceName, String groupName, List<String> clusters, boolean healthy)Get qualified instances within specified clusters of service.selectInstances(String serviceName, String groupName, List<String> clusters, boolean healthy, boolean subscribe)Get qualified instances within specified clusters of service.selectInstances(String serviceName, List<String> clusters, boolean healthy)Get qualified instances within specified clusters of service.selectInstances(String serviceName, List<String> clusters, boolean healthy, boolean subscribe)Get qualified instances within specified clusters of service.selectOneHealthyInstance(String serviceName)Select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, boolean subscribe)select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, String groupName)Select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, String groupName, boolean subscribe)select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters)Select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters, boolean subscribe)Select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, List<String> clusters)Select one healthy instance of service using predefined load balance strategy.selectOneHealthyInstance(String serviceName, List<String> clusters, boolean subscribe)Select one healthy instance of service using predefined load balance strategy.voidshutDown()Shutdown the resource service.voidsubscribe(String serviceName, EventListener listener)Subscribe service to receive events of instances alteration.voidsubscribe(String serviceName, String groupName, EventListener listener)Subscribe service to receive events of instances alteration.voidSubscribe service to receive events of instances alteration.voidsubscribe(String serviceName, List<String> clusters, EventListener listener)Subscribe service to receive events of instances alteration.voidunsubscribe(String serviceName, EventListener listener)Unsubscribe event listener of service.voidunsubscribe(String serviceName, String groupName, EventListener listener)unsubscribe event listener of service.voidunsubscribe(String serviceName, String groupName, List<String> clusters, EventListener listener)Unsubscribe event listener of service.voidunsubscribe(String serviceName, List<String> clusters, EventListener listener)Unsubscribe event listener of service.
-
方法详细资料
-
registerInstance
register a instance to service.- 参数:
serviceName- name of serviceip- instance ipport- instance port- 抛出:
NacosException- nacos exception
-
registerInstance
void registerInstance(String serviceName, String groupName, String ip, int port) throws NacosExceptionregister a instance to service.- 参数:
serviceName- name of servicegroupName- group of serviceip- instance ipport- instance port- 抛出:
NacosException- nacos exception
-
registerInstance
void registerInstance(String serviceName, String ip, int port, String clusterName) throws NacosExceptionregister a instance to service with specified cluster name.- 参数:
serviceName- name of serviceip- instance ipport- instance portclusterName- instance cluster name- 抛出:
NacosException- nacos exception
-
registerInstance
void registerInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosExceptionregister a instance to service with specified cluster name.- 参数:
serviceName- name of servicegroupName- group of serviceip- instance ipport- instance portclusterName- instance cluster name- 抛出:
NacosException- nacos exception
-
registerInstance
register a instance to service with specified instance properties.- 参数:
serviceName- name of serviceinstance- instance to register- 抛出:
NacosException- nacos exception
-
registerInstance
void registerInstance(String serviceName, String groupName, Instance instance) throws NacosExceptionregister a instance to service with specified instance properties.- 参数:
serviceName- name of servicegroupName- group of serviceinstance- instance to register- 抛出:
NacosException- nacos exception
-
deregisterInstance
deregister instance from a service.- 参数:
serviceName- name of serviceip- instance ipport- instance port- 抛出:
NacosException- nacos exception
-
deregisterInstance
void deregisterInstance(String serviceName, String groupName, String ip, int port) throws NacosExceptionderegister instance from a service.- 参数:
serviceName- name of servicegroupName- group of serviceip- instance ipport- instance port- 抛出:
NacosException- nacos exception
-
deregisterInstance
void deregisterInstance(String serviceName, String ip, int port, String clusterName) throws NacosExceptionderegister instance with specified cluster name from a service.- 参数:
serviceName- name of serviceip- instance ipport- instance portclusterName- instance cluster name- 抛出:
NacosException- nacos exception
-
deregisterInstance
void deregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosExceptionderegister instance with specified cluster name from a service.- 参数:
serviceName- name of servicegroupName- group of serviceip- instance ipport- instance portclusterName- instance cluster name- 抛出:
NacosException- nacos exception
-
deregisterInstance
deregister instance with full instance information and default groupName.- 参数:
serviceName- name of serviceinstance- instance- 抛出:
NacosException- nacos exception
-
deregisterInstance
void deregisterInstance(String serviceName, String groupName, Instance instance) throws NacosExceptionderegister instance with full instance information.- 参数:
serviceName- name of servicegroupName- group of serviceinstance- instance information- 抛出:
NacosException- nacos exception
-
getAllInstances
get all instances of a service.- 参数:
serviceName- name of service- 返回:
- A list of instance
- 抛出:
NacosException- nacos exception
-
getAllInstances
get all instances of a service.- 参数:
serviceName- name of servicegroupName- group of service- 返回:
- A list of instance
- 抛出:
NacosException- nacos exception
-
getAllInstances
Get all instances of a service.- 参数:
serviceName- name of servicesubscribe- if subscribe the service- 返回:
- A list of instance
- 抛出:
NacosException- nacos exception
-
getAllInstances
List<Instance> getAllInstances(String serviceName, String groupName, boolean subscribe) throws NacosExceptionGet all instances of a service.- 参数:
serviceName- name of servicegroupName- group of servicesubscribe- if subscribe the service- 返回:
- A list of instance
- 抛出:
NacosException- nacos exception
-
getAllInstances
Get all instances within specified clusters of a service.- 参数:
serviceName- name of serviceclusters- list of cluster- 返回:
- A list of qualified instance
- 抛出:
NacosException- nacos exception
-
getAllInstances
List<Instance> getAllInstances(String serviceName, String groupName, List<String> clusters) throws NacosExceptionGet all instances within specified clusters of a service.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- list of cluster- 返回:
- A list of qualified instance
- 抛出:
NacosException- nacos exception
-
getAllInstances
List<Instance> getAllInstances(String serviceName, List<String> clusters, boolean subscribe) throws NacosExceptionGet all instances within specified clusters of a service.- 参数:
serviceName- name of serviceclusters- list of clustersubscribe- 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 NacosExceptionGet all instances within specified clusters of a service.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- list of clustersubscribe- if subscribe the service- 返回:
- A list of qualified instance
- 抛出:
NacosException- nacos exception
-
selectInstances
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 NacosExceptionGet qualified instances of service.- 参数:
serviceName- name of servicegroupName- group of servicehealthy- 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 NacosExceptionGet qualified instances of service.- 参数:
serviceName- name of servicehealthy- a flag to indicate returning healthy or unhealthy instancessubscribe- 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 NacosExceptionGet qualified instances of service.- 参数:
serviceName- name of servicegroupName- group of servicehealthy- a flag to indicate returning healthy or unhealthy instancessubscribe- if subscribe the service- 返回:
- A qualified list of instance
- 抛出:
NacosException- nacos exception
-
selectInstances
List<Instance> selectInstances(String serviceName, List<String> clusters, boolean healthy) throws NacosExceptionGet qualified instances within specified clusters of service.- 参数:
serviceName- name of serviceclusters- list of clusterhealthy- 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 NacosExceptionGet qualified instances within specified clusters of service.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- list of clusterhealthy- 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 NacosExceptionGet qualified instances within specified clusters of service.- 参数:
serviceName- name of serviceclusters- list of clusterhealthy- a flag to indicate returning healthy or unhealthy instancessubscribe- 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 NacosExceptionGet qualified instances within specified clusters of service.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- list of clusterhealthy- a flag to indicate returning healthy or unhealthy instancessubscribe- if subscribe the service- 返回:
- A qualified list of instance
- 抛出:
NacosException- nacos exception
-
selectOneHealthyInstance
Select one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of service- 返回:
- qualified instance
- 抛出:
NacosException- nacos exception
-
selectOneHealthyInstance
Select one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of servicegroupName- group of service- 返回:
- qualified instance
- 抛出:
NacosException- nacos exception
-
selectOneHealthyInstance
select one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of servicesubscribe- if subscribe the service- 返回:
- qualified instance
- 抛出:
NacosException- nacos exception
-
selectOneHealthyInstance
Instance selectOneHealthyInstance(String serviceName, String groupName, boolean subscribe) throws NacosExceptionselect one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of servicegroupName- group of servicesubscribe- if subscribe the service- 返回:
- qualified instance
- 抛出:
NacosException- nacos exception
-
selectOneHealthyInstance
Select one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of serviceclusters- 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 NacosExceptionSelect one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- 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 NacosExceptionSelect one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of serviceclusters- a list of clusters should the instance belongs tosubscribe- if subscribe the service- 返回:
- qualified instance
- 抛出:
NacosException- nacos exception
-
selectOneHealthyInstance
Instance selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters, boolean subscribe) throws NacosExceptionSelect one healthy instance of service using predefined load balance strategy.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- a list of clusters should the instance belongs tosubscribe- if subscribe the service- 返回:
- qualified instance
- 抛出:
NacosException- nacos exception
-
subscribe
Subscribe service to receive events of instances alteration.- 参数:
serviceName- name of servicelistener- event listener- 抛出:
NacosException- nacos exception
-
subscribe
Subscribe service to receive events of instances alteration.- 参数:
serviceName- name of servicegroupName- group of servicelistener- event listener- 抛出:
NacosException- nacos exception
-
subscribe
void subscribe(String serviceName, List<String> clusters, EventListener listener) throws NacosExceptionSubscribe service to receive events of instances alteration.- 参数:
serviceName- name of serviceclusters- list of clusterlistener- event listener- 抛出:
NacosException- nacos exception
-
subscribe
void subscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws NacosExceptionSubscribe service to receive events of instances alteration.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- list of clusterlistener- event listener- 抛出:
NacosException- nacos exception
-
unsubscribe
Unsubscribe event listener of service.- 参数:
serviceName- name of servicelistener- event listener- 抛出:
NacosException- nacos exception
-
unsubscribe
void unsubscribe(String serviceName, String groupName, EventListener listener) throws NacosExceptionunsubscribe event listener of service.- 参数:
serviceName- name of servicegroupName- group of servicelistener- event listener- 抛出:
NacosException- nacos exception
-
unsubscribe
void unsubscribe(String serviceName, List<String> clusters, EventListener listener) throws NacosExceptionUnsubscribe event listener of service.- 参数:
serviceName- name of serviceclusters- list of clusterlistener- event listener- 抛出:
NacosException- nacos exception
-
unsubscribe
void unsubscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws NacosExceptionUnsubscribe event listener of service.- 参数:
serviceName- name of servicegroupName- group of serviceclusters- list of clusterlistener- event listener- 抛出:
NacosException- nacos exception
-
getServicesOfServer
Get all service names from server.- 参数:
pageNo- page indexpageSize- page size- 返回:
- list of service names
- 抛出:
NacosException- nacos exception
-
getServicesOfServer
ListView<String> getServicesOfServer(int pageNo, int pageSize, String groupName) throws NacosExceptionGet all service names from server.- 参数:
pageNo- page indexpageSize- page sizegroupName- group name- 返回:
- list of service names
- 抛出:
NacosException- nacos exception
-
getServicesOfServer
ListView<String> getServicesOfServer(int pageNo, int pageSize, AbstractSelector selector) throws NacosExceptionGet all service names from server with selector.- 参数:
pageNo- page indexpageSize- page sizeselector- 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 NacosExceptionGet all service names from server with selector.- 参数:
pageNo- page indexpageSize- page sizegroupName- group nameselector- selector to filter the resource- 返回:
- list of service names
- 抛出:
NacosException- nacos exception
-
getSubscribeServices
Get all subscribed services of current client.- 返回:
- subscribed services
- 抛出:
NacosException- nacos exception
-
getServerStatus
String getServerStatus()get server health status.- 返回:
- is server healthy
-
shutDown
Shutdown the resource service.- 抛出:
NacosException- exception.
-