类 ConnectionManager

java.lang.Object
com.alibaba.nacos.common.notify.listener.Subscriber<ConnectionLimitRuleChangeEvent>
com.alibaba.nacos.core.remote.ConnectionManager

@Service public class ConnectionManager extends com.alibaba.nacos.common.notify.listener.Subscriber<ConnectionLimitRuleChangeEvent>
connect manager.
版本:
$Id: ConnectionManager.java, v 0.1 2020年07月13日 7:07 PM liuzunfei Exp $
作者:
liuzunfei
  • 字段详细资料

  • 构造器详细资料

    • ConnectionManager

      public ConnectionManager()
  • 方法详细资料

    • traced

      public boolean traced(String clientIp)
      if monitor detail.
      参数:
      clientIp - clientIp.
      返回:
    • initLimitRue

      @PostConstruct protected void initLimitRue()
    • checkValid

      public boolean checkValid(String connectionId)
      check connection id is valid.
      参数:
      connectionId - connectionId to be check.
      返回:
      is valid or not.
    • register

      public boolean register(String connectionId, Connection connection)
      register a new connect.
      参数:
      connectionId - connectionId
      connection - connection
    • unregister

      public void unregister(String connectionId)
      unregister a connection .
      参数:
      connectionId - connectionId.
    • getConnection

      public Connection getConnection(String connectionId)
      get by connection id.
      参数:
      connectionId - connection id.
      返回:
      connection of the id.
    • getConnectionByIp

      public List<Connection> getConnectionByIp(String clientIp)
      get by client ip.
      参数:
      clientIp - client ip.
      返回:
      connections of the client ip.
    • getCurrentConnectionCount

      public int getCurrentConnectionCount()
      get current connections count.
      返回:
      get all connection count
    • refreshActiveTime

      public void refreshActiveTime(String connectionId)
      regresh connection active time.
      参数:
      connectionId - connectionId.
    • start

      @PostConstruct public void start()
      Start Task:Expel the connection which active Time expire.
    • loadCount

      public void loadCount(int loadClient, String redirectAddress)
    • loadSingle

      public void loadSingle(String connectionId, String redirectAddress)
      send load request to spefic connetionId.
      参数:
      connectionId - connection id of client.
      redirectAddress - server address to redirect.
    • currentClientsCount

      public int currentClientsCount()
      get all client count.
      返回:
      client count.
    • currentClientsCount

      public int currentClientsCount(Map<String,​String> filterLabels)
      get client count with labels filter.
      参数:
      filterLabels - label to filter client count.
      返回:
      count with the specific filter labels.
    • currentSdkClientCount

      public int currentSdkClientCount()
      get client count from sdk.
      返回:
    • currentClients

      public Map<String,​Connection> currentClients()
    • onEvent

      public void onEvent(ConnectionLimitRuleChangeEvent event)
      指定者:
      onEvent 在类中 com.alibaba.nacos.common.notify.listener.Subscriber<ConnectionLimitRuleChangeEvent>
    • subscribeType

      public Class<? extends com.alibaba.nacos.common.notify.Event> subscribeType()
      指定者:
      subscribeType 在类中 com.alibaba.nacos.common.notify.listener.Subscriber<ConnectionLimitRuleChangeEvent>
    • getConnectionLimitRule

      public com.alibaba.nacos.core.remote.ConnectionManager.ConnectionLimitRule getConnectionLimitRule()