本文整理汇总了Java中com.ecwid.consul.v1.health.model.HealthService.Service方法的典型用法代码示例。如果您正苦于以下问题:Java HealthService.Service方法的具体用法?Java HealthService.Service怎么用?Java HealthService.Service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ecwid.consul.v1.health.model.HealthService
的用法示例。
在下文中一共展示了HealthService.Service方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newServer
import com.ecwid.consul.v1.health.model.HealthService; //导入方法依赖的package包/类
private ConsulServer newServer(Check.CheckStatus checkStatus) {
HealthService healthService = new HealthService();
HealthService.Node node = new HealthService.Node();
node.setAddress("nodeaddr"+checkStatus.name());
node.setNode("nodenode"+checkStatus.name());
healthService.setNode(node);
HealthService.Service service = new HealthService.Service();
service.setAddress("serviceaddr"+checkStatus.name());
service.setId("serviceid"+checkStatus.name());
service.setPort(8080);
service.setService("serviceservice"+checkStatus.name());
healthService.setService(service);
ArrayList<Check> checks = new ArrayList<>();
Check check = new Check();
check.setStatus(checkStatus);
checks.add(check);
healthService.setChecks(checks);
return new ConsulServer(healthService);
}
示例2: findHost
import com.ecwid.consul.v1.health.model.HealthService; //导入方法依赖的package包/类
private static String findHost(HealthService healthService) {
HealthService.Service service = healthService.getService();
HealthService.Node node = healthService.getNode();
if (org.springframework.util.StringUtils.hasText(service.getAddress())) {
return service.getAddress();
} else if (org.springframework.util.StringUtils.hasText(node.getAddress())) {
return node.getAddress();
}
return node.getNode();
}
示例3: findHost
import com.ecwid.consul.v1.health.model.HealthService; //导入方法依赖的package包/类
public static String findHost(HealthService healthService) {
HealthService.Service service = healthService.getService();
HealthService.Node node = healthService.getNode();
if (StringUtils.isNotBlank(service.getAddress())) {
return service.getAddress();
} else if (StringUtils.isNotBlank(node.getAddress())) {
return node.getAddress();
}
return node.getNode();
}
示例4: findHost
import com.ecwid.consul.v1.health.model.HealthService; //导入方法依赖的package包/类
public static String findHost(HealthService healthService) {
HealthService.Service service = healthService.getService();
HealthService.Node node = healthService.getNode();
if (StringUtils.hasText(service.getAddress())) {
return fixIPv6Address(service.getAddress());
} else if (StringUtils.hasText(node.getAddress())) {
return fixIPv6Address(node.getAddress());
}
return node.getNode();
}