com.mpush.tools.Utils.checkHealth()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(224)

本文整理了Java中com.mpush.tools.Utils.checkHealth()方法的一些代码示例,展示了Utils.checkHealth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.checkHealth()方法的具体详情如下:
包路径:com.mpush.tools.Utils
类名称:Utils
方法名:checkHealth

Utils.checkHealth介绍

暂无

代码示例

代码示例来源:origin: mpusher/mpush

@Test
public void test2() {
  boolean ret = Utils.checkHealth("120.27.196.68", 80);
  System.out.println(ret);
}

代码示例来源:origin: mpusher/mpush

@Test
public void test() {
  boolean ret = Utils.checkHealth("120.27.196.68", 82);
  System.out.println(ret);
}

代码示例来源:origin: mpusher/mpush

@Override
public void run() {
  logger.debug("do dns mapping checkHealth ...");
  Map<String, List<DnsMapping>> all = this.getAll();
  Map<String, List<DnsMapping>> available = Maps.newConcurrentMap();
  all.forEach((key, dnsMappings) -> {
    List<DnsMapping> okList = Lists.newArrayList();
    dnsMappings.forEach(dnsMapping -> {
      if (checkHealth(dnsMapping.getIp(), dnsMapping.getPort())) {
        okList.add(dnsMapping);
      } else {
        logger.warn("dns can not reachable:" + Jsons.toJson(dnsMapping));
      }
    });
    available.put(key, okList);
  });
  this.update(available);
}

代码示例来源:origin: com.github.mpusher/mpush-common

@Override
public void run() {
  logger.debug("do dns mapping checkHealth ...");
  Map<String, List<DnsMapping>> all = this.getAll();
  Map<String, List<DnsMapping>> available = Maps.newConcurrentMap();
  all.forEach((key, dnsMappings) -> {
    List<DnsMapping> okList = Lists.newArrayList();
    dnsMappings.forEach(dnsMapping -> {
      if (checkHealth(dnsMapping.getIp(), dnsMapping.getPort())) {
        okList.add(dnsMapping);
      } else {
        logger.warn("dns can not reachable:" + Jsons.toJson(dnsMapping));
      }
    });
    available.put(key, okList);
  });
  this.update(available);
}

相关文章