当前位置: 首页>>代码示例>>Java>>正文


Java HealthService.Service方法代码示例

本文整理汇总了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);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-consul,代码行数:20,代码来源:HealthServiceServerListFilterTests.java

示例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();
}
 
开发者ID:darren-fu,项目名称:RestyPass,代码行数:12,代码来源:CloudConsulServerContext.java

示例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();
}
 
开发者ID:Netflix,项目名称:dyno,代码行数:12,代码来源:ConsulHelper.java

示例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();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-consul,代码行数:12,代码来源:ConsulServerUtils.java


注:本文中的com.ecwid.consul.v1.health.model.HealthService.Service方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。