类 ServiceInfo

java.lang.Object
com.alibaba.nacos.api.naming.pojo.ServiceInfo

public class ServiceInfo extends Object
Service Information with instances and without cluster information, used in data pushing and cached for nacos-client.
作者:
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 String jsonFromServer
    • EMPTY

      private static final String EMPTY
      另请参阅:
    • DEFAULT_CHARSET

      private static final String DEFAULT_CHARSET
      另请参阅:
    • name

      private String name
    • groupName

      private String groupName
    • clusters

      private String clusters
    • cacheMillis

      private long cacheMillis
    • hosts

      private List<Instance> hosts
    • lastRefTime

      private long lastRefTime
    • checksum

      private String checksum
    • allIps

      private volatile boolean allIps
    • reachProtectionThreshold

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

    • ServiceInfo

      public ServiceInfo()
    • ServiceInfo

      public ServiceInfo(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(String name, String clusters)
  • 方法详细资料

    • isAllIps

      public boolean isAllIps()
    • setAllIps

      public void setAllIps(boolean allIps)
    • ipCount

      public int ipCount()
    • expired

      public boolean expired()
    • setHosts

      public void setHosts(List<Instance> hosts)
    • addHost

      public void addHost(Instance host)
    • addAllHosts

      public void addAllHosts(List<? extends Instance> hosts)
    • getHosts

      public List<Instance> getHosts()
    • isValid

      public boolean isValid()
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getGroupName

      public String getGroupName()
    • setGroupName

      public void setGroupName(String groupName)
    • setLastRefTime

      public void setLastRefTime(long lastRefTime)
    • getLastRefTime

      public long getLastRefTime()
    • getClusters

      public String getClusters()
    • setClusters

      public void setClusters(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 String getJsonFromServer()
    • setJsonFromServer

      public void setJsonFromServer(String jsonFromServer)
    • getKey

      public String getKey()
    • getKey

      public static String getKey(String name, String clusters)
    • getKeyWithoutClusters

      public String getKeyWithoutClusters()
    • getKeyEncoded

      public String getKeyEncoded()
    • getGroupedServiceName

      private String getGroupedServiceName()
    • fromKey

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

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

      public String getChecksum()
    • setChecksum

      public void setChecksum(String checksum)
    • isEmpty

      private static boolean isEmpty(String str)
    • isReachProtectionThreshold

      public boolean isReachProtectionThreshold()
    • setReachProtectionThreshold

      public void setReachProtectionThreshold(boolean reachProtectionThreshold)