类 ConnectionBasedClient
- java.lang.Object
-
- com.alibaba.nacos.naming.core.v2.client.AbstractClient
-
- com.alibaba.nacos.naming.core.v2.client.impl.ConnectionBasedClient
-
- 所有已实现的接口:
Client
public class ConnectionBasedClient extends AbstractClient
Nacos naming client based on tcp session.The client is bind to the tcp session. When the tcp session disconnect, the client should be clean.
- 作者:
- xiweng.yy
-
-
字段概要
字段 修饰符和类型 字段 说明 private java.lang.StringconnectionIdprivate booleanisNativetruemeans this client is directly connect to current server.private longlastRenewTimeOnly has meaning whenisNativeis false, which means that the last time verify from source server.-
从类继承的字段 com.alibaba.nacos.naming.core.v2.client.AbstractClient
attributes, lastUpdatedTime, publishers, revision, subscribers
-
-
构造器概要
构造器 构造器 说明 ConnectionBasedClient(java.lang.String connectionId, boolean isNative, java.lang.Long revision)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.lang.StringgetClientId()Get the unique id of current client.longgetLastRenewTime()booleanisEphemeral()Whether is ephemeral of current client.booleanisExpire(long currentTime)Whether current client is expired.booleanisNative()longrecalculateRevision()Recalculate client revision and get its value.voidsetLastRenewTime()-
从类继承的方法 com.alibaba.nacos.naming.core.v2.client.AbstractClient
addServiceInstance, addServiceSubscriber, generateSyncData, getAllPublishedService, getAllSubscribeService, getClientAttributes, getInstancePublishInfo, getLastUpdatedTime, getRevision, getSubscriber, release, removeServiceInstance, removeServiceSubscriber, setAttributes, setLastUpdatedTime, setRevision
-
-
-
-
字段详细资料
-
connectionId
private final java.lang.String connectionId
-
isNative
private final boolean isNative
truemeans this client is directly connect to current server.falsemeans this client is synced from other server.
-
lastRenewTime
private volatile long lastRenewTime
Only has meaning whenisNativeis false, which means that the last time verify from source server.
-
-
方法详细资料
-
getClientId
public java.lang.String getClientId()
从接口复制的说明:ClientGet the unique id of current client.- 返回:
- id of client
-
isEphemeral
public boolean isEphemeral()
从接口复制的说明:ClientWhether is ephemeral of current client.- 返回:
- true if client is ephemeral, otherwise false
-
isNative
public boolean isNative()
-
getLastRenewTime
public long getLastRenewTime()
-
setLastRenewTime
public void setLastRenewTime()
-
isExpire
public boolean isExpire(long currentTime)
从接口复制的说明:ClientWhether current client is expired.- 参数:
currentTime- unified current timestamp- 返回:
- true if client has expired, otherwise false
-
recalculateRevision
public long recalculateRevision()
从接口复制的说明:ClientRecalculate client revision and get its value.- 指定者:
recalculateRevision在接口中Client- 覆盖:
recalculateRevision在类中AbstractClient- 返回:
- recalculated revision value
-
-