public class NamingHttpClientProxy extends AbstractNamingClientProxy
| 构造器和说明 |
|---|
NamingHttpClientProxy(String namespaceId,
SecurityProxy securityProxy,
ServerListManager serverListManager,
Properties properties,
ServiceInfoHolder serviceInfoHolder) |
| 限定符和类型 | 方法和说明 |
|---|---|
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,
String groupName,
Instance instance)
Deregister instance from a service.
|
BeatReactor |
getBeatReactor() |
String |
getNamespaceId() |
ListView<String> |
getServiceList(int pageNo,
int pageSize,
String groupName,
AbstractSelector selector)
Get service list.
|
boolean |
isSubscribed(String serviceName,
String groupName,
String clusters)
Judge whether service has been subscribed.
|
void |
onEvent(ServerListChangedEvent event) |
ServiceInfo |
queryInstancesOfService(String serviceName,
String groupName,
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 |
setServerPort(int serverPort) |
void |
shutdown() |
ServiceInfo |
subscribe(String serviceName,
String groupName,
String clusters)
Subscribe service.
|
Class<? extends Event> |
subscribeType() |
void |
unsubscribe(String serviceName,
String groupName,
String clusters)
Unsubscribe service.
|
void |
updateBeatInfo(Set<Instance> modifiedInstances)
Update beat info.
|
void |
updateInstance(String serviceName,
String groupName,
Instance instance)
Update instance to service.
|
void |
updateService(Service service,
AbstractSelector selector)
Update service.
|
getSecurityHeaders, getSpasHeadersexecutor, ignoreExpireEventpublic NamingHttpClientProxy(String namespaceId, SecurityProxy securityProxy, ServerListManager serverListManager, Properties properties, ServiceInfoHolder serviceInfoHolder)
public void onEvent(ServerListChangedEvent event)
onEvent 在类中 Subscriber<ServerListChangedEvent>public Class<? extends Event> subscribeType()
subscribeType 在类中 Subscriber<ServerListChangedEvent>public void registerService(String serviceName, String groupName, Instance instance) throws NacosException
NamingClientProxyserviceName - name of servicegroupName - group of serviceinstance - instance to registerNacosException - nacos exceptionpublic void deregisterService(String serviceName, String groupName, Instance instance) throws NacosException
NamingClientProxyserviceName - name of servicegroupName - group nameinstance - instanceNacosException - nacos exceptionpublic void updateInstance(String serviceName, String groupName, Instance instance) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameinstance - instanceNacosException - nacos exceptionpublic ServiceInfo queryInstancesOfService(String serviceName, String groupName, String clusters, int udpPort, boolean healthyOnly) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameclusters - clustersudpPort - udp porthealthyOnly - healthy onlyNacosException - nacos exceptionpublic Service queryService(String serviceName, String groupName) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameNacosException - nacos exceptionpublic void createService(Service service, AbstractSelector selector) throws NacosException
NamingClientProxyservice - serviceselector - selectorNacosException - nacos exceptionpublic boolean deleteService(String serviceName, String groupName) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameNacosException - nacos exceptionpublic void updateService(Service service, AbstractSelector selector) throws NacosException
NamingClientProxyservice - serviceselector - selectorNacosException - nacos exceptionpublic com.fasterxml.jackson.databind.JsonNode sendBeat(BeatInfo beatInfo, boolean lightBeatEnabled) throws NacosException
beatInfo - beat infolightBeatEnabled - light beatNacosException - nacos exceptionpublic boolean serverHealthy()
NamingClientProxypublic ListView<String> getServiceList(int pageNo, int pageSize, String groupName, AbstractSelector selector) throws NacosException
NamingClientProxypageNo - page numberpageSize - size per pagegroupName - group name of serviceselector - selectorNacosException - nacos exceptionpublic ServiceInfo subscribe(String serviceName, String groupName, String clusters) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameclusters - clusters, current only support subscribe all clusters, maybe deprecatedNacosException - nacos exceptionpublic void unsubscribe(String serviceName, String groupName, String clusters) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameclusters - clusters, current only support subscribe all clusters, maybe deprecatedNacosException - nacos exceptionpublic boolean isSubscribed(String serviceName, String groupName, String clusters) throws NacosException
NamingClientProxyserviceName - service namegroupName - group nameclusters - clusters, current only support subscribe all clusters, maybe deprecatedtrue if subscribed, otherwise falseNacosException - nacos exceptionpublic void updateBeatInfo(Set<Instance> modifiedInstances)
NamingClientProxymodifiedInstances - modified instancespublic 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, String method) throws NacosException
api - apiparams - parametersbody - bodycurServer - ?method - http methodNacosException - nacos exceptionpublic String getNamespaceId()
public void setServerPort(int serverPort)
public BeatReactor getBeatReactor()
public void shutdown()
throws NacosException
NacosExceptionCopyright © 2018–2022 Alibaba Group. All rights reserved.