类 ClientWorker

java.lang.Object
com.alibaba.nacos.client.config.impl.ClientWorker
所有已实现的接口:
com.alibaba.nacos.common.lifecycle.Closeable

public class ClientWorker extends Object implements com.alibaba.nacos.common.lifecycle.Closeable
Long polling.
作者:
Nacos
  • 构造器详细资料

    • ClientWorker

      public ClientWorker(ConfigFilterChainManager configFilterChainManager, ConfigServerListManager serverListManager, com.alibaba.nacos.client.env.NacosClientProperties properties) throws com.alibaba.nacos.api.exception.NacosException
      抛出:
      com.alibaba.nacos.api.exception.NacosException
  • 方法详细资料

    • addListeners

      public void addListeners(String dataId, String group, List<? extends com.alibaba.nacos.api.config.listener.Listener> listeners) throws com.alibaba.nacos.api.exception.NacosException
      Add listeners for data.
      参数:
      dataId - dataId of data
      group - group of data
      listeners - listeners
      抛出:
      com.alibaba.nacos.api.exception.NacosException
    • addTenantListeners

      public void addTenantListeners(String dataId, String group, List<? extends com.alibaba.nacos.api.config.listener.Listener> listeners) throws com.alibaba.nacos.api.exception.NacosException
      Add listeners for tenant.
      参数:
      dataId - dataId of data
      group - group of data
      listeners - listeners
      抛出:
      com.alibaba.nacos.api.exception.NacosException - nacos exception
    • addTenantListenersWithContent

      public void addTenantListenersWithContent(String dataId, String group, String content, String encryptedDataKey, List<? extends com.alibaba.nacos.api.config.listener.Listener> listeners) throws com.alibaba.nacos.api.exception.NacosException
      Add listeners for tenant with content.
      参数:
      dataId - dataId of data
      group - group of data
      content - content
      encryptedDataKey - encryptedDataKey
      listeners - listeners
      抛出:
      com.alibaba.nacos.api.exception.NacosException - nacos exception
    • removeListener

      public void removeListener(String dataId, String group, com.alibaba.nacos.api.config.listener.Listener listener)
      Remove listener.
      参数:
      dataId - dataId of data
      group - group of data
      listener - listener
    • removeTenantListener

      public void removeTenantListener(String dataId, String group, com.alibaba.nacos.api.config.listener.Listener listener)
      Remove listeners for tenant.
      参数:
      dataId - dataId of data
      group - group of data
      listener - listener
    • addTenantFuzzyWatcher

      public ConfigFuzzyWatchContext addTenantFuzzyWatcher(String dataIdPattern, String groupPattern, com.alibaba.nacos.api.config.listener.FuzzyWatchEventWatcher fuzzyWatchEventWatcher)
      Adds a list of fuzzy listen listeners for the specified data ID pattern and group.
      参数:
      dataIdPattern - The pattern of the data ID to listen for.
      groupPattern - The group of the configuration.
      fuzzyWatchEventWatcher - The configFuzzyWatcher to add.
      抛出:
      com.alibaba.nacos.api.exception.NacosException - If an error occurs while adding the listeners.
    • removeFuzzyListenListener

      public void removeFuzzyListenListener(String dataIdPattern, String group, com.alibaba.nacos.api.config.listener.FuzzyWatchEventWatcher watcher)
      Removes a fuzzy listen listener for the specified data ID pattern, group, and listener.
      参数:
      dataIdPattern - The pattern of the data ID.
      group - The group of the configuration.
      watcher - The listener to remove.
      抛出:
      com.alibaba.nacos.api.exception.NacosException - If an error occurs while removing the listener.
    • removeConfig

      public boolean removeConfig(String dataId, String group, String tenant, String tag) throws com.alibaba.nacos.api.exception.NacosException
      remove config.
      参数:
      dataId - dataId.
      group - group.
      tenant - tenant.
      tag - tag.
      返回:
      success or not.
      抛出:
      com.alibaba.nacos.api.exception.NacosException - exception to throw.
    • publishConfig

      public boolean publishConfig(String dataId, String group, String tenant, String appName, String tag, String betaIps, String content, String encryptedDataKey, String casMd5, String type) throws com.alibaba.nacos.api.exception.NacosException
      publish config.
      参数:
      dataId - dataId.
      group - group.
      tenant - tenant.
      appName - appName.
      tag - tag.
      betaIps - betaIps.
      content - content.
      casMd5 - casMd5.
      type - type.
      返回:
      success or not.
      抛出:
      com.alibaba.nacos.api.exception.NacosException - exception throw.
    • addCacheDataIfAbsent

      public CacheData addCacheDataIfAbsent(String dataId, String group)
      Add cache data if absent.
      参数:
      dataId - data id if data
      group - group of data
      返回:
      cache data
    • addCacheDataIfAbsent

      public CacheData addCacheDataIfAbsent(String dataId, String group, String tenant) throws com.alibaba.nacos.api.exception.NacosException
      Add cache data if absent.
      参数:
      dataId - data id if data
      group - group of data
      tenant - tenant of data
      返回:
      cache data
      抛出:
      com.alibaba.nacos.api.exception.NacosException
    • getCache

      public CacheData getCache(String dataId, String group)
    • getCache

      public CacheData getCache(String dataId, String group, String tenant)
    • getServerConfig

      public ConfigResponse getServerConfig(String dataId, String group, String tenant, long readTimeout, boolean notify) throws com.alibaba.nacos.api.exception.NacosException
      抛出:
      com.alibaba.nacos.api.exception.NacosException
    • shutdown

      public void shutdown() throws com.alibaba.nacos.api.exception.NacosException
      指定者:
      shutdown 在接口中 com.alibaba.nacos.common.lifecycle.Closeable
      抛出:
      com.alibaba.nacos.api.exception.NacosException
    • isHealthServer

      public boolean isHealthServer()
      check if it has any connectable server endpoint.
      返回:
      true: that means has atleast one connected rpc client. flase: that means does not have any connected rpc client.
    • getAgentName

      public String getAgentName()
    • getAgent

      public ConfigTransportClient getAgent()