| 构造器和说明 |
|---|
NamingProxy(String namespaceId,
String endpoint,
String serverList,
Properties properties) |
| 限定符和类型 | 方法和说明 |
|---|---|
Header |
builderHeader()
Build header.
|
String |
callServer(String api,
Map<String,String> params,
Map<String,String> body,
String curServer) |
String |
callServer(String api,
Map<String,String> params,
Map<String,String> body,
String curServer,
String method)
Call server.
|
void |
createService(Service service,
AbstractSelector selector)
Create service.
|
boolean |
deleteService(String serviceName,
String groupName)
Delete service.
|
void |
deregisterService(String serviceName,
Instance instance)
deregister instance from a service.
|
String |
getAccessKey() |
String |
getNamespaceId() |
String |
getSecretKey() |
List<String> |
getServerListFromEndpoint() |
ListView<String> |
getServiceList(int pageNo,
int pageSize,
String groupName) |
ListView<String> |
getServiceList(int pageNo,
int pageSize,
String groupName,
AbstractSelector selector) |
String |
queryList(String serviceName,
String clusters,
int udpPort,
boolean healthyOnly)
Query instance list.
|
Service |
queryService(String serviceName,
String groupName)
Query Service.
|
void |
registerService(String serviceName,
String groupName,
Instance instance)
register a instance to service with specified instance properties.
|
String |
reqApi(String api,
Map<String,String> params,
Map<String,String> body,
List<String> servers,
String method)
Request api.
|
String |
reqApi(String api,
Map<String,String> params,
Map<String,String> body,
String method) |
String |
reqApi(String api,
Map<String,String> params,
String method) |
com.fasterxml.jackson.databind.JsonNode |
sendBeat(BeatInfo beatInfo,
boolean lightBeatEnabled)
Send beat.
|
boolean |
serverHealthy()
Check Server healthy.
|
void |
setProperties(Properties properties) |
void |
setServerPort(int serverPort) |
void |
shutdown() |
void |
updateInstance(String serviceName,
String groupName,
Instance instance)
Update instance to service.
|
void |
updateService(Service service,
AbstractSelector selector)
Update service.
|
public NamingProxy(String namespaceId, String endpoint, String serverList, Properties properties)
public void registerService(String serviceName, String groupName, Instance instance) throws NacosException
serviceName - name of servicegroupName - group of serviceinstance - instance to registerNacosException - nacos exceptionpublic void deregisterService(String serviceName, Instance instance) throws NacosException
serviceName - name of serviceinstance - instanceNacosException - nacos exceptionpublic void updateInstance(String serviceName, String groupName, Instance instance) throws NacosException
serviceName - service namegroupName - group nameinstance - instanceNacosException - nacos exceptionpublic Service queryService(String serviceName, String groupName) throws NacosException
serviceName - service namegroupName - group nameNacosException - nacos exceptionpublic void createService(Service service, AbstractSelector selector) throws NacosException
service - serviceselector - selectorNacosException - nacos exceptionpublic boolean deleteService(String serviceName, String groupName) throws NacosException
serviceName - service namegroupName - group nameNacosException - nacos exceptionpublic void updateService(Service service, AbstractSelector selector) throws NacosException
service - serviceselector - selectorNacosException - nacos exceptionpublic String queryList(String serviceName, String clusters, int udpPort, boolean healthyOnly) throws NacosException
serviceName - service nameclusters - clustersudpPort - udp porthealthyOnly - healthy onlyNacosException - nacos exceptionpublic com.fasterxml.jackson.databind.JsonNode sendBeat(BeatInfo beatInfo, boolean lightBeatEnabled) throws NacosException
beatInfo - beat infolightBeatEnabled - light beatNacosException - nacos exceptionpublic boolean serverHealthy()
public ListView<String> getServiceList(int pageNo, int pageSize, String groupName) throws NacosException
NacosExceptionpublic ListView<String> getServiceList(int pageNo, int pageSize, String groupName, AbstractSelector selector) throws NacosException
NacosExceptionpublic String reqApi(String api, Map<String,String> params, String method) throws NacosException
NacosExceptionpublic String reqApi(String api, Map<String,String> params, Map<String,String> body, String method) throws NacosException
NacosExceptionpublic String reqApi(String api, Map<String,String> params, Map<String,String> body, List<String> servers, String method) throws NacosException
api - apiparams - parametersbody - bodyservers - serversmethod - http methodNacosException - nacos exceptionpublic String callServer(String api, Map<String,String> params, Map<String,String> body, String curServer) throws NacosException
NacosExceptionpublic String callServer(String api, Map<String,String> params, Map<String,String> body, String curServer, String method) throws NacosException
api - apiparams - parametersbody - bodycurServer - ?method - http methodNacosException - nacos exceptionpublic Header builderHeader()
public String getAccessKey()
public String getSecretKey()
public void setProperties(Properties properties)
public String getNamespaceId()
public void setServerPort(int serverPort)
public void shutdown()
throws NacosException
shutdown 在接口中 CloseableNacosExceptionCopyright © 2018–2021 Alibaba Group. All rights reserved.