类 ServiceInfo


  • public class ServiceInfo
    extends java.lang.Object
    ServiceInfo.
    作者:
    nkorange, shizhengxing
    • 字段详细资料

      • GROUP_POSITION

        private static final int GROUP_POSITION
        file 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

        private java.lang.String jsonFromServer
      • EMPTY

        private static final java.lang.String EMPTY
        另请参阅:
        常量字段值
      • DEFAULT_CHARSET

        private static final java.lang.String DEFAULT_CHARSET
        另请参阅:
        常量字段值
      • name

        private java.lang.String name
      • groupName

        private java.lang.String groupName
      • clusters

        private java.lang.String clusters
      • cacheMillis

        private long cacheMillis
      • hosts

        private java.util.List<Instance> hosts
      • lastRefTime

        private long lastRefTime
      • checksum

        private java.lang.String checksum
      • allIPs

        private volatile boolean allIPs
      • reachProtectionThreshold

        private volatile boolean reachProtectionThreshold
    • 构造器详细资料

      • ServiceInfo

        public ServiceInfo()
      • ServiceInfo

        public ServiceInfo​(java.lang.String key)
        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

        public ServiceInfo​(java.lang.String name,
                           java.lang.String clusters)
    • 方法详细资料

      • isAllIPs

        public boolean isAllIPs()
      • setAllIPs

        public void setAllIPs​(boolean allIPs)
      • ipCount

        public int ipCount()
      • expired

        public boolean expired()
      • setHosts

        public void setHosts​(java.util.List<Instance> hosts)
      • addHost

        public void addHost​(Instance host)
      • addAllHosts

        public void addAllHosts​(java.util.List<? extends Instance> hosts)
      • getHosts

        public java.util.List<Instance> getHosts()
      • isValid

        public boolean isValid()
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • getGroupName

        public java.lang.String getGroupName()
      • setGroupName

        public void setGroupName​(java.lang.String groupName)
      • setLastRefTime

        public void setLastRefTime​(long lastRefTime)
      • getLastRefTime

        public long getLastRefTime()
      • getClusters

        public java.lang.String getClusters()
      • setClusters

        public void setClusters​(java.lang.String clusters)
      • 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

        public java.lang.String getJsonFromServer()
      • setJsonFromServer

        public void setJsonFromServer​(java.lang.String jsonFromServer)
      • getKey

        public java.lang.String getKey()
      • getKey

        public static java.lang.String getKey​(java.lang.String name,
                                              java.lang.String clusters)
      • getKeyEncoded

        public java.lang.String getKeyEncoded()
      • getGroupedServiceName

        private java.lang.String getGroupedServiceName()
      • fromKey

        public static ServiceInfo fromKey​(java.lang.String key)
        Get ServiceInfo from key.
        参数:
        key - key of service info
        返回:
        new service info
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object
      • getChecksum

        public java.lang.String getChecksum()
      • setChecksum

        public void setChecksum​(java.lang.String checksum)
      • isEmpty

        private static boolean isEmpty​(java.lang.String str)
      • isReachProtectionThreshold

        public boolean isReachProtectionThreshold()
      • setReachProtectionThreshold

        public void setReachProtectionThreshold​(boolean reachProtectionThreshold)