类 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
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleancheckValid(String connectionId)check connection id is valid.intget all client count.intcurrentClientsCount(Map<String,String> filterLabels)get client count with labels filter.intget client count from sdk.getConnection(String connectionId)get by connection id.getConnectionByIp(String clientIp)get by client ip.com.alibaba.nacos.core.remote.ConnectionManager.ConnectionLimitRuleintget current connections count.protected voidvoidvoidloadSingle(String connectionId, String redirectAddress)send load request to spefic connetionId.voidvoidrefreshActiveTime(String connectionId)regresh connection active time.booleanregister(String connectionId, Connection connection)register a new connect.voidstart()Start Task:Expel the connection which active Time expire.Class<? extends com.alibaba.nacos.common.notify.Event>booleanif monitor detail.voidunregister(String connectionId)unregister a connection .从类继承的方法 com.alibaba.nacos.common.notify.listener.Subscriber
executor, ignoreExpireEvent
-
字段详细资料
-
RULE_FILE_NAME
- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
ConnectionManager
public ConnectionManager()
-
-
方法详细资料
-
traced
if monitor detail.- 参数:
clientIp- clientIp.- 返回:
-
initLimitRue
-
checkValid
check connection id is valid.- 参数:
connectionId- connectionId to be check.- 返回:
- is valid or not.
-
register
register a new connect.- 参数:
connectionId- connectionIdconnection- connection
-
unregister
unregister a connection .- 参数:
connectionId- connectionId.
-
getConnection
get by connection id.- 参数:
connectionId- connection id.- 返回:
- connection of the id.
-
getConnectionByIp
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
regresh connection active time.- 参数:
connectionId- connectionId.
-
start
Start Task:Expel the connection which active Time expire. -
loadCount
-
loadSingle
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
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
-
onEvent
- 指定者:
onEvent在类中com.alibaba.nacos.common.notify.listener.Subscriber<ConnectionLimitRuleChangeEvent>
-
subscribeType
- 指定者:
subscribeType在类中com.alibaba.nacos.common.notify.listener.Subscriber<ConnectionLimitRuleChangeEvent>
-
getConnectionLimitRule
public com.alibaba.nacos.core.remote.ConnectionManager.ConnectionLimitRule getConnectionLimitRule()
-