类 IpPortBasedClient
- java.lang.Object
-
- com.alibaba.nacos.naming.core.v2.client.AbstractClient
-
- com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient
-
- 所有已实现的接口:
Client
public class IpPortBasedClient extends AbstractClient
Nacos naming client based ip and port.The client is bind to the ip and port users registered. It's a abstract content to simulate the tcp session client.
- 作者:
- xiweng.yy
-
-
字段概要
字段 修饰符和类型 字段 说明 private ClientBeatCheckTaskV2beatCheckTaskprivate java.lang.StringclientIdprivate booleanephemeralprivate HealthCheckTaskV2healthCheckTaskV2static java.lang.StringID_DELIMITERprivate java.lang.StringresponsibleId-
从类继承的字段 com.alibaba.nacos.naming.core.v2.client.AbstractClient
attributes, lastUpdatedTime, publishers, revision, subscribers
-
-
构造器概要
构造器 构造器 说明 IpPortBasedClient(java.lang.String clientId, boolean ephemeral)IpPortBasedClient(java.lang.String clientId, boolean ephemeral, java.lang.Long revision)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanaddServiceInstance(Service service, InstancePublishInfo instancePublishInfo)Add a new instance for service for current client.java.util.Collection<InstancePublishInfo>getAllInstancePublishInfo()java.lang.StringgetClientId()Get the unique id of current client.static java.lang.StringgetClientId(java.lang.String address, boolean ephemeral)java.lang.StringgetResponsibleId()private java.lang.StringgetResponsibleTagFromId()voidinit()Init client.booleanisEphemeral()Whether is ephemeral of current client.booleanisExpire(long currentTime)Whether current client is expired.private HealthCheckInstancePublishInfoparseToHealthCheckInstance(InstancePublishInfo instancePublishInfo)voidputServiceInstance(Service service, InstancePublishInfo instance)Purely put instance into service without publish events.voidrelease()Release current client and release resources if neccessary.-
从类继承的方法 com.alibaba.nacos.naming.core.v2.client.AbstractClient
addServiceSubscriber, generateSyncData, getAllPublishedService, getAllSubscribeService, getClientAttributes, getInstancePublishInfo, getLastUpdatedTime, getRevision, getSubscriber, recalculateRevision, removeServiceInstance, removeServiceSubscriber, setAttributes, setLastUpdatedTime, setRevision
-
-
-
-
字段详细资料
-
ID_DELIMITER
public static final java.lang.String ID_DELIMITER
- 另请参阅:
- 常量字段值
-
clientId
private final java.lang.String clientId
-
ephemeral
private final boolean ephemeral
-
responsibleId
private final java.lang.String responsibleId
-
beatCheckTask
private ClientBeatCheckTaskV2 beatCheckTask
-
healthCheckTaskV2
private HealthCheckTaskV2 healthCheckTaskV2
-
-
方法详细资料
-
getResponsibleTagFromId
private java.lang.String getResponsibleTagFromId()
-
getClientId
public static java.lang.String getClientId(java.lang.String address, boolean ephemeral)
-
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
-
getResponsibleId
public java.lang.String getResponsibleId()
-
addServiceInstance
public boolean addServiceInstance(Service service, InstancePublishInfo instancePublishInfo)
从接口复制的说明:ClientAdd a new instance for service for current client.- 指定者:
addServiceInstance在接口中Client- 覆盖:
addServiceInstance在类中AbstractClient- 参数:
service- publish serviceinstancePublishInfo- instance- 返回:
- true if add successfully, otherwise false
-
isExpire
public boolean isExpire(long currentTime)
从接口复制的说明:ClientWhether current client is expired.- 参数:
currentTime- unified current timestamp- 返回:
- true if client has expired, otherwise false
-
getAllInstancePublishInfo
public java.util.Collection<InstancePublishInfo> getAllInstancePublishInfo()
-
release
public void release()
从接口复制的说明:ClientRelease current client and release resources if neccessary.- 指定者:
release在接口中Client- 覆盖:
release在类中AbstractClient
-
parseToHealthCheckInstance
private HealthCheckInstancePublishInfo parseToHealthCheckInstance(InstancePublishInfo instancePublishInfo)
-
init
public void init()
Init client.
-
putServiceInstance
public void putServiceInstance(Service service, InstancePublishInfo instance)
Purely put instance into service without publish events.
-
-