use of org.springframework.cloud.netflix.eureka.EurekaDiscoveryClient.EurekaServiceInstance in project coffeenet-starter by coffeenet.
the class IntegrationCoffeeNetAppService method toApp.
private static CoffeeNetApp toApp(ServiceInstance serviceInstance) {
if (!(serviceInstance instanceof EurekaServiceInstance)) {
return null;
}
EurekaServiceInstance eurekaServiceInstance = (EurekaServiceInstance) serviceInstance;
InstanceInfo instanceInfo = eurekaServiceInstance.getInstanceInfo();
Set<String> allowedAuthorities = commaDelimitedListToSet(instanceInfo.getMetadata().get("allowedAuthorities")).stream().map(String::trim).collect(toSet());
return new CoffeeNetApp(instanceInfo.getVIPAddress(), instanceInfo.getHomePageUrl(), allowedAuthorities);
}
Aggregations