Java Code Examples for com.netflix.appinfo.InstanceInfo#getHealthCheckUrl()

The following examples show how to use com.netflix.appinfo.InstanceInfo#getHealthCheckUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArmeriaEurekaClientTest.java    From armeria with Apache License 2.0 6 votes vote down vote up
private static com.linecorp.armeria.internal.common.eureka.InstanceInfo convertInstanceInfo(
        InstanceInfo info) {
    final PortWrapper port = new PortWrapper(info.isPortEnabled(PortType.UNSECURE), info.getPort());
    final PortWrapper securePort = new PortWrapper(info.isPortEnabled(PortType.SECURE),
                                                   info.getSecurePort());

    return new com.linecorp.armeria.internal.common.eureka.InstanceInfo(
            info.getInstanceId(),
            info.getAppName(), info.getAppGroupName(), info.getHostName(),
            info.getIPAddr(),
            info.getVIPAddress(), info.getSecureVipAddress(), port,
            securePort,
            com.linecorp.armeria.internal.common.eureka.InstanceInfo.InstanceStatus
                    .toEnum(info.getStatus().name()), info.getHomePageUrl(),
            info.getStatusPageUrl(),
            info.getHealthCheckUrl(),
            info.getSecureHealthCheckUrl(),
            convertDataCenterInfo(info.getDataCenterInfo()),
            convertLeaseInfo(info.getLeaseInfo()),
            info.getMetadata());
}
 
Example 2
Source File: EurekaServiceInstanceConverter.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Override
protected URI getHealthUrl(ServiceInstance instance) {
    Assert.isInstanceOf(EurekaServiceInstance.class, instance,
        "serviceInstance must be of type EurekaServiceInstance");

    InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo();
    String healthUrl = instanceInfo.getSecureHealthCheckUrl();
    if (StringUtils.isEmpty(healthUrl)) {
        healthUrl = instanceInfo.getHealthCheckUrl();
    }
    return URI.create(healthUrl);
}
 
Example 3
Source File: EurekaServiceInstanceConverter.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Override
protected URI getHealthUrl(ServiceInstance instance) {
    Assert.isInstanceOf(EurekaServiceInstance.class, instance,
        "serviceInstance must be of type EurekaServiceInstance");

    InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo();
    String healthUrl = instanceInfo.getSecureHealthCheckUrl();
    if (StringUtils.isEmpty(healthUrl)) {
        healthUrl = instanceInfo.getHealthCheckUrl();
    }
    return URI.create(healthUrl);
}
 
Example 4
Source File: ServiceInstance.java    From oneplatform with Apache License 2.0 5 votes vote down vote up
public ServiceInstance(InstanceInfo instanceInfo) {
	this.appName = instanceInfo.getAppName();
	this.instanceId = instanceInfo.getInstanceId();
	this.hostName = instanceInfo.getHostName();
	this.ipAddr = instanceInfo.getIPAddr();
	this.vipAddress = instanceInfo.getVIPAddress();
	this.status = instanceInfo.getStatus().name();
	this.port = instanceInfo.getPort();
	this.healthCheckUrl = instanceInfo.getHealthCheckUrl();
	this.lastRenewalTime = new Date(instanceInfo.getLastDirtyTimestamp());
	this.nodeId = instanceInfo.getMetadata().get("nodeId");
}
 
Example 5
Source File: EurekaServiceInstanceConverter.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Override
protected URI getHealthUrl(ServiceInstance instance) {
	if (!(instance instanceof EurekaServiceInstance)) {
		return super.getHealthUrl(instance);
	}

	InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo();
	String healthUrl = instanceInfo.getSecureHealthCheckUrl();
	if (StringUtils.isEmpty(healthUrl)) {
		healthUrl = instanceInfo.getHealthCheckUrl();
	}
	return URI.create(healthUrl);
}