Class LongPollingService
- java.lang.Object
-
- com.alibaba.nacos.config.server.utils.event.EventDispatcher.AbstractEventListener
-
- com.alibaba.nacos.config.server.service.LongPollingService
-
@Service public class LongPollingService extends EventDispatcher.AbstractEventListener
长轮询服务。负责处理- Author:
- Nacos
-
-
Field Summary
Fields Modifier and Type Field Description static StringLONG_POLLING_HEADERstatic StringLONG_POLLING_NO_HANG_UP_HEADER
-
Constructor Summary
Constructors Constructor Description LongPollingService()
-
Method Summary
-
-
-
Field Detail
-
LONG_POLLING_HEADER
public static final String LONG_POLLING_HEADER
- See Also:
- Constant Field Values
-
LONG_POLLING_NO_HANG_UP_HEADER
public static final String LONG_POLLING_NO_HANG_UP_HEADER
- See Also:
- Constant Field Values
-
-
Method Detail
-
isClientLongPolling
public boolean isClientLongPolling(String clientIp)
-
getSubscribleInfo
public SampleResult getSubscribleInfo(String dataId, String group, String tenant)
-
getSubscribleInfoByIp
public SampleResult getSubscribleInfoByIp(String clientIp)
-
mergeSampleResult
public SampleResult mergeSampleResult(List<SampleResult> sampleResults)
聚合采样结果中的采样ip和监听配置的信息;合并策略用后面的覆盖前面的是没有问题的- Parameters:
sampleResults- sample Results- Returns:
- Results
-
collectApplicationSubscribeConfigInfos
public Map<String,Set<String>> collectApplicationSubscribeConfigInfos()
-
getCollectSubscribleInfo
public SampleResult getCollectSubscribleInfo(String dataId, String group, String tenant)
-
getCollectSubscribleInfoByIp
public SampleResult getCollectSubscribleInfoByIp(String ip)
-
addLongPollingClient
public void addLongPollingClient(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp, Map<String,String> clientMd5Map, int probeRequestSize)
-
interest
public List<Class<? extends EventDispatcher.Event>> interest()
Description copied from class:EventDispatcher.AbstractEventListener感兴趣的事件列表- Specified by:
interestin classEventDispatcher.AbstractEventListener- Returns:
- event list
-
onEvent
public void onEvent(EventDispatcher.Event event)
Description copied from class:EventDispatcher.AbstractEventListener处理事件- Specified by:
onEventin classEventDispatcher.AbstractEventListener- Parameters:
event- event
-
isSupportLongPolling
public static boolean isSupportLongPolling(javax.servlet.http.HttpServletRequest req)
-
-