类 ServiceInfo
java.lang.Object
com.alibaba.nacos.api.naming.pojo.ServiceInfo
Service Information with instances and without cluster information, used in data pushing and cached for nacos-client.
- 作者:
- nkorange, shizhengxing
-
构造器概要
构造器构造器说明ServiceInfo(String key) There is only one form of the key:groupName@@name@@clusters.ServiceInfo(String name, String clusters) -
方法概要
修饰符和类型方法说明voidaddAllHosts(List<? extends Instance> hosts) voidbooleanexpired()static ServiceInfoGetServiceInfofrom key.longgetHosts()getKey()static StringlonggetName()intipCount()booleanisAllIps()booleanbooleanisValid()voidsetAllIps(boolean allIps) voidsetCacheMillis(long cacheMillis) voidsetChecksum(String checksum) voidsetClusters(String clusters) voidsetGroupName(String groupName) voidvoidsetJsonFromServer(String jsonFromServer) voidsetLastRefTime(long lastRefTime) voidvoidsetReachProtectionThreshold(boolean reachProtectionThreshold) toString()booleanvalidate()Judge whether service info is validate.
-
构造器详细资料
-
ServiceInfo
public ServiceInfo() -
ServiceInfo
There is only one form of the key:groupName@@name@@clusters. This constructor used by DiskCache.read(String) and FailoverReactor.FailoverFileReader,you should know that 'groupName' must not be null,and 'clusters' can be null. -
ServiceInfo
-
-
方法详细资料
-
isAllIps
public boolean isAllIps() -
setAllIps
public void setAllIps(boolean allIps) -
ipCount
public int ipCount() -
expired
public boolean expired() -
setHosts
-
addHost
-
addAllHosts
-
getHosts
-
isValid
public boolean isValid() -
getName
-
setName
-
getGroupName
-
setGroupName
-
setLastRefTime
public void setLastRefTime(long lastRefTime) -
getLastRefTime
public long getLastRefTime() -
getClusters
-
setClusters
-
getCacheMillis
public long getCacheMillis() -
setCacheMillis
public void setCacheMillis(long cacheMillis) -
validate
public boolean validate()Judge whether service info is validate.- 返回:
- true if validate, otherwise false
-
getJsonFromServer
-
setJsonFromServer
-
getKey
-
getKey
-
getKeyWithoutClusters
-
getKeyEncoded
-
fromKey
GetServiceInfofrom key.- 参数:
key- key of service info- 返回:
- new service info
-
toString
-
getChecksum
-
setChecksum
-
isReachProtectionThreshold
public boolean isReachProtectionThreshold() -
setReachProtectionThreshold
public void setReachProtectionThreshold(boolean reachProtectionThreshold)
-