类 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
-
字段概要
字段修饰符和类型字段说明private booleanprivate longprivate Stringprivate static final intprivate Stringprivate static final Stringprivate static final Stringprivate static final intprivate static final intfile name pattern: groupName@@name@@clusters.private Stringprivate Stringprivate longprivate Stringprivate booleanprivate static final int -
构造器概要
构造器构造器说明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.longprivate StringgetHosts()getKey()static StringlonggetName()intipCount()booleanisAllIps()private static booleanbooleanbooleanisValid()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.
-
字段详细资料
-
GROUP_POSITION
private static final int GROUP_POSITIONfile name pattern: groupName@@name@@clusters.- 另请参阅:
-
SERVICE_POSITION
private static final int SERVICE_POSITION- 另请参阅:
-
CLUSTER_POSITION
private static final int CLUSTER_POSITION- 另请参阅:
-
FILE_NAME_PARTS
private static final int FILE_NAME_PARTS- 另请参阅:
-
jsonFromServer
-
EMPTY
- 另请参阅:
-
DEFAULT_CHARSET
- 另请参阅:
-
name
-
groupName
-
clusters
-
cacheMillis
private long cacheMillis -
hosts
-
lastRefTime
private long lastRefTime -
checksum
-
allIps
private volatile boolean allIps -
reachProtectionThreshold
private volatile boolean reachProtectionThreshold
-
-
构造器详细资料
-
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
-
getGroupedServiceName
-
fromKey
GetServiceInfofrom key.- 参数:
key- key of service info- 返回:
- new service info
-
toString
-
getChecksum
-
setChecksum
-
isEmpty
-
isReachProtectionThreshold
public boolean isReachProtectionThreshold() -
setReachProtectionThreshold
public void setReachProtectionThreshold(boolean reachProtectionThreshold)
-