public interface NamingService
| 限定符和类型 | 方法和说明 |
|---|---|
void |
deregisterInstance(String serviceName,
Instance instance)
deregister instance with full instance information and default groupName.
|
void |
deregisterInstance(String serviceName,
String groupName,
Instance instance)
deregister instance with full instance information.
|
void |
deregisterInstance(String serviceName,
String ip,
int port)
deregister instance from a service.
|
void |
deregisterInstance(String serviceName,
String ip,
int port,
String clusterName)
deregister instance with specified cluster name from a service.
|
void |
deregisterInstance(String serviceName,
String groupName,
String ip,
int port)
deregister instance from a service.
|
void |
deregisterInstance(String serviceName,
String groupName,
String ip,
int port,
String clusterName)
deregister instance with specified cluster name from a service.
|
List<Instance> |
getAllInstances(String serviceName)
get all instances of a service.
|
List<Instance> |
getAllInstances(String serviceName,
boolean subscribe)
Get all instances of a service.
|
List<Instance> |
getAllInstances(String serviceName,
List<String> clusters)
Get all instances within specified clusters of a service.
|
List<Instance> |
getAllInstances(String serviceName,
List<String> clusters,
boolean subscribe)
Get all instances within specified clusters of a service.
|
List<Instance> |
getAllInstances(String serviceName,
String groupName)
get all instances of a service.
|
List<Instance> |
getAllInstances(String serviceName,
String groupName,
boolean subscribe)
Get all instances of a service.
|
List<Instance> |
getAllInstances(String serviceName,
String groupName,
List<String> clusters)
Get all instances within specified clusters of a service.
|
List<Instance> |
getAllInstances(String serviceName,
String groupName,
List<String> clusters,
boolean subscribe)
Get all instances within specified clusters of a service.
|
String |
getServerStatus()
get server health status.
|
ListView<String> |
getServicesOfServer(int pageNo,
int pageSize)
Get all service names from server.
|
ListView<String> |
getServicesOfServer(int pageNo,
int pageSize,
AbstractSelector selector)
Get all service names from server with selector.
|
ListView<String> |
getServicesOfServer(int pageNo,
int pageSize,
String groupName)
Get all service names from server.
|
ListView<String> |
getServicesOfServer(int pageNo,
int pageSize,
String groupName,
AbstractSelector selector)
Get all service names from server with selector.
|
List<ServiceInfo> |
getSubscribeServices()
Get all subscribed services of current client.
|
void |
registerInstance(String serviceName,
Instance instance)
register a instance to service with specified instance properties.
|
void |
registerInstance(String serviceName,
String groupName,
Instance instance)
register a instance to service with specified instance properties.
|
void |
registerInstance(String serviceName,
String ip,
int port)
register a instance to service.
|
void |
registerInstance(String serviceName,
String ip,
int port,
String clusterName)
register a instance to service with specified cluster name.
|
void |
registerInstance(String serviceName,
String groupName,
String ip,
int port)
register a instance to service.
|
void |
registerInstance(String serviceName,
String groupName,
String ip,
int port,
String clusterName)
register a instance to service with specified cluster name.
|
List<Instance> |
selectInstances(String serviceName,
boolean healthy)
Get qualified instances of service.
|
List<Instance> |
selectInstances(String serviceName,
boolean healthy,
boolean subscribe)
Get qualified instances of service.
|
List<Instance> |
selectInstances(String serviceName,
List<String> clusters,
boolean healthy)
Get qualified instances within specified clusters of service.
|
List<Instance> |
selectInstances(String serviceName,
List<String> clusters,
boolean healthy,
boolean subscribe)
Get qualified instances within specified clusters of service.
|
List<Instance> |
selectInstances(String serviceName,
String groupName,
boolean healthy)
Get qualified instances of service.
|
List<Instance> |
selectInstances(String serviceName,
String groupName,
boolean healthy,
boolean subscribe)
Get qualified instances of service.
|
List<Instance> |
selectInstances(String serviceName,
String groupName,
List<String> clusters,
boolean healthy)
Get qualified instances within specified clusters of service.
|
List<Instance> |
selectInstances(String serviceName,
String groupName,
List<String> clusters,
boolean healthy,
boolean subscribe)
Get qualified instances within specified clusters of service.
|
Instance |
selectOneHealthyInstance(String serviceName)
Select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
boolean subscribe)
select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
List<String> clusters)
Select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
List<String> clusters,
boolean subscribe)
Select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
String groupName)
Select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
String groupName,
boolean subscribe)
select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
String groupName,
List<String> clusters)
Select one healthy instance of service using predefined load balance strategy.
|
Instance |
selectOneHealthyInstance(String serviceName,
String groupName,
List<String> clusters,
boolean subscribe)
Select one healthy instance of service using predefined load balance strategy.
|
void |
shutDown()
Shutdown the resource service.
|
void |
subscribe(String serviceName,
EventListener listener)
Subscribe service to receive events of instances alteration.
|
void |
subscribe(String serviceName,
List<String> clusters,
EventListener listener)
Subscribe service to receive events of instances alteration.
|
void |
subscribe(String serviceName,
String groupName,
EventListener listener)
Subscribe service to receive events of instances alteration.
|
void |
subscribe(String serviceName,
String groupName,
List<String> clusters,
EventListener listener)
Subscribe service to receive events of instances alteration.
|
void |
unsubscribe(String serviceName,
EventListener listener)
Unsubscribe event listener of service.
|
void |
unsubscribe(String serviceName,
List<String> clusters,
EventListener listener)
Unsubscribe event listener of service.
|
void |
unsubscribe(String serviceName,
String groupName,
EventListener listener)
unsubscribe event listener of service.
|
void |
unsubscribe(String serviceName,
String groupName,
List<String> clusters,
EventListener listener)
Unsubscribe event listener of service.
|
void registerInstance(String serviceName, String ip, int port) throws NacosException
serviceName - name of serviceip - instance ipport - instance portNacosException - nacos exceptionvoid registerInstance(String serviceName, String groupName, String ip, int port) throws NacosException
serviceName - name of servicegroupName - group of serviceip - instance ipport - instance portNacosException - nacos exceptionvoid registerInstance(String serviceName, String ip, int port, String clusterName) throws NacosException
serviceName - name of serviceip - instance ipport - instance portclusterName - instance cluster nameNacosException - nacos exceptionvoid registerInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException
serviceName - name of servicegroupName - group of serviceip - instance ipport - instance portclusterName - instance cluster nameNacosException - nacos exceptionvoid registerInstance(String serviceName, Instance instance) throws NacosException
serviceName - name of serviceinstance - instance to registerNacosException - nacos exceptionvoid registerInstance(String serviceName, String groupName, Instance instance) throws NacosException
serviceName - name of servicegroupName - group of serviceinstance - instance to registerNacosException - nacos exceptionvoid deregisterInstance(String serviceName, String ip, int port) throws NacosException
serviceName - name of serviceip - instance ipport - instance portNacosException - nacos exceptionvoid deregisterInstance(String serviceName, String groupName, String ip, int port) throws NacosException
serviceName - name of servicegroupName - group of serviceip - instance ipport - instance portNacosException - nacos exceptionvoid deregisterInstance(String serviceName, String ip, int port, String clusterName) throws NacosException
serviceName - name of serviceip - instance ipport - instance portclusterName - instance cluster nameNacosException - nacos exceptionvoid deregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException
serviceName - name of servicegroupName - group of serviceip - instance ipport - instance portclusterName - instance cluster nameNacosException - nacos exceptionvoid deregisterInstance(String serviceName, Instance instance) throws NacosException
serviceName - name of serviceinstance - instanceNacosException - nacos exceptionvoid deregisterInstance(String serviceName, String groupName, Instance instance) throws NacosException
serviceName - name of servicegroupName - group of serviceinstance - instance informationNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName) throws NacosException
serviceName - name of serviceNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, String groupName) throws NacosException
serviceName - name of servicegroupName - group of serviceNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, boolean subscribe) throws NacosException
serviceName - name of servicesubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, String groupName, boolean subscribe) throws NacosException
serviceName - name of servicegroupName - group of servicesubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, List<String> clusters) throws NacosException
serviceName - name of serviceclusters - list of clusterNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, String groupName, List<String> clusters) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - list of clusterNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, List<String> clusters, boolean subscribe) throws NacosException
serviceName - name of serviceclusters - list of clustersubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> getAllInstances(String serviceName, String groupName, List<String> clusters, boolean subscribe) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - list of clustersubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, boolean healthy) throws NacosException
serviceName - name of service.healthy - a flag to indicate returning healthy or unhealthy instancesNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, String groupName, boolean healthy) throws NacosException
serviceName - name of servicegroupName - group of servicehealthy - a flag to indicate returning healthy or unhealthy instancesNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, boolean healthy, boolean subscribe) throws NacosException
serviceName - name of servicehealthy - a flag to indicate returning healthy or unhealthy instancessubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, String groupName, boolean healthy, boolean subscribe) throws NacosException
serviceName - name of servicegroupName - group of servicehealthy - a flag to indicate returning healthy or unhealthy instancessubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, List<String> clusters, boolean healthy) throws NacosException
serviceName - name of serviceclusters - list of clusterhealthy - a flag to indicate returning healthy or unhealthy instancesNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, String groupName, List<String> clusters, boolean healthy) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - list of clusterhealthy - a flag to indicate returning healthy or unhealthy instancesNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, List<String> clusters, boolean healthy, boolean subscribe) throws NacosException
serviceName - name of serviceclusters - list of clusterhealthy - a flag to indicate returning healthy or unhealthy instancessubscribe - if subscribe the serviceNacosException - nacos exceptionList<Instance> selectInstances(String serviceName, String groupName, List<String> clusters, boolean healthy, boolean subscribe) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - list of clusterhealthy - a flag to indicate returning healthy or unhealthy instancessubscribe - if subscribe the serviceNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName) throws NacosException
serviceName - name of serviceNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, String groupName) throws NacosException
serviceName - name of servicegroupName - group of serviceNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, boolean subscribe) throws NacosException
serviceName - name of servicesubscribe - if subscribe the serviceNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, String groupName, boolean subscribe) throws NacosException
serviceName - name of servicegroupName - group of servicesubscribe - if subscribe the serviceNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, List<String> clusters) throws NacosException
serviceName - name of serviceclusters - a list of clusters should the instance belongs toNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - a list of clusters should the instance belongs toNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, List<String> clusters, boolean subscribe) throws NacosException
serviceName - name of serviceclusters - a list of clusters should the instance belongs tosubscribe - if subscribe the serviceNacosException - nacos exceptionInstance selectOneHealthyInstance(String serviceName, String groupName, List<String> clusters, boolean subscribe) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - a list of clusters should the instance belongs tosubscribe - if subscribe the serviceNacosException - nacos exceptionvoid subscribe(String serviceName, EventListener listener) throws NacosException
serviceName - name of servicelistener - event listenerNacosException - nacos exceptionvoid subscribe(String serviceName, String groupName, EventListener listener) throws NacosException
serviceName - name of servicegroupName - group of servicelistener - event listenerNacosException - nacos exceptionvoid subscribe(String serviceName, List<String> clusters, EventListener listener) throws NacosException
serviceName - name of serviceclusters - list of clusterlistener - event listenerNacosException - nacos exceptionvoid subscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - list of clusterlistener - event listenerNacosException - nacos exceptionvoid unsubscribe(String serviceName, EventListener listener) throws NacosException
serviceName - name of servicelistener - event listenerNacosException - nacos exceptionvoid unsubscribe(String serviceName, String groupName, EventListener listener) throws NacosException
serviceName - name of servicegroupName - group of servicelistener - event listenerNacosException - nacos exceptionvoid unsubscribe(String serviceName, List<String> clusters, EventListener listener) throws NacosException
serviceName - name of serviceclusters - list of clusterlistener - event listenerNacosException - nacos exceptionvoid unsubscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws NacosException
serviceName - name of servicegroupName - group of serviceclusters - list of clusterlistener - event listenerNacosException - nacos exceptionListView<String> getServicesOfServer(int pageNo, int pageSize) throws NacosException
pageNo - page indexpageSize - page sizeNacosException - nacos exceptionListView<String> getServicesOfServer(int pageNo, int pageSize, String groupName) throws NacosException
pageNo - page indexpageSize - page sizegroupName - group nameNacosException - nacos exceptionListView<String> getServicesOfServer(int pageNo, int pageSize, AbstractSelector selector) throws NacosException
pageNo - page indexpageSize - page sizeselector - selector to filter the resourceNacosException - nacos exceptionListView<String> getServicesOfServer(int pageNo, int pageSize, String groupName, AbstractSelector selector) throws NacosException
pageNo - page indexpageSize - page sizegroupName - group nameselector - selector to filter the resourceNacosException - nacos exceptionList<ServiceInfo> getSubscribeServices() throws NacosException
NacosException - nacos exceptionString getServerStatus()
void shutDown()
throws NacosException
NacosException - exception.Copyright © 2018–2020 Alibaba Group. All rights reserved.