use of com.logicalclocks.servicediscoverclient.ServiceDiscoveryClient in project hopsworks by logicalclocks.
the class ServiceDiscoveryController method init.
@PostConstruct
public void init() {
try {
ServiceDiscoveryClient dnsClient = createClient(Type.DNS);
clients.put(Type.DNS, dnsClient);
} catch (ServiceDiscoveryException ex) {
LOG.log(Level.SEVERE, "Failed to initialize Service Discovery client", ex);
}
}
use of com.logicalclocks.servicediscoverclient.ServiceDiscoveryClient in project hopsworks by logicalclocks.
the class Settings method getAlertManagerService.
private static Optional<Service> getAlertManagerService(String serviceFQDN) throws ServiceDiscoveryException {
ServiceDiscoveryClient client = null;
Optional<Service> services;
try {
client = new Builder(Type.DNS).build();
String name = Strings.isNullOrEmpty(serviceFQDN) ? DEFAULT_ALERTMANAGER_FQDN : serviceFQDN;
services = client.getService(ServiceQuery.of(name, Collections.emptySet())).findFirst();
} finally {
if (client != null) {
client.close();
}
}
return services;
}
Aggregations