@Override public String getHost() { return endpointAddress.getIp(); }
public EndpointAddressBuilder(EndpointAddress instance,Boolean validationEnabled){ this.fluent = this; this.withHostname(instance.getHostname()); this.withIp(instance.getIp()); this.withTargetRef(instance.getTargetRef()); this.validationEnabled = validationEnabled; }
public EndpointAddressBuilder( EndpointAddressFluent<?> fluent , EndpointAddress instance ){ this.fluent = fluent; fluent.withIp(instance.getIp()); fluent.withTargetRef(instance.getTargetRef()); } public EndpointAddressBuilder( EndpointAddress instance ){
public EndpointAddressBuilder(Boolean validationEnabled){ this(new EndpointAddress(), validationEnabled); } public EndpointAddressBuilder(EndpointAddressFluent<?> fluent){
public EndpointAddressBuilder( EndpointAddressFluent<?> fluent , EndpointAddress instance ){ this.fluent = fluent; fluent.withIP(instance.getIP()); fluent.withTargetRef(instance.getTargetRef()); } public EndpointAddressBuilder( EndpointAddress instance ){
if (podIP != null) { String url = podIP + ":" + portNumber; EndpointAddress address = new EndpointAddress(); address.setIp(podIP); ObjectReference ref = new ObjectReference(); ref.setNamespace(namespace); ref.setName(getName(pod)); address.setTargetRef(ref); addresses.add(address);
@Override public ServiceInstance getLocalServiceInstance() { String serviceName = properties.getServiceName(); String podName = System.getenv(HOSTNAME); ServiceInstance defaultInstance = new DefaultServiceInstance(serviceName, "localhost", 8080, false); Endpoints endpoints = client.endpoints().withName(serviceName).get(); if (Utils.isNullOrEmpty(podName) || endpoints == null) { return defaultInstance; } try { return endpoints.getSubsets() .stream() .filter(s -> s.getAddresses().get(0).getTargetRef().getName().equals(podName)) .map(s -> (ServiceInstance) new KubernetesServiceInstance(serviceName, s.getAddresses().stream().findFirst().orElseThrow(IllegalStateException::new), s.getPorts().stream().findFirst().orElseThrow(IllegalStateException::new), false)) .findFirst().orElse(defaultInstance); } catch (Throwable t) { return defaultInstance; } }
public EndpointAddressBuilder(EndpointAddressFluent<?> fluent,EndpointAddress instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withHostname(instance.getHostname()); fluent.withIp(instance.getIp()); fluent.withTargetRef(instance.getTargetRef()); this.validationEnabled = validationEnabled; } public EndpointAddressBuilder(EndpointAddress instance){
public EndpointAddressBuilder( EndpointAddress instance ){ this.fluent = this; this.withIp(instance.getIp()); this.withTargetRef(instance.getTargetRef()); }
public EndpointAddressBuilder(){ this(new EndpointAddress()); } public EndpointAddressBuilder( EndpointAddressFluent<?> fluent ){
public EndpointAddressBuilder( EndpointAddress instance ){ this.fluent = this; this.withIP(instance.getIP()); this.withTargetRef(instance.getTargetRef()); }
@Override public ServiceInstance getLocalServiceInstance() { String serviceName = properties.getServiceName(); String podName = System.getenv(HOSTNAME); ServiceInstance defaultInstance = new DefaultServiceInstance(serviceName, "localhost", 8080, false); Endpoints endpoints = client.endpoints().withName(serviceName).get(); if (Utils.isNullOrEmpty(podName) || endpoints == null) { return defaultInstance; } try { return endpoints.getSubsets() .stream() .filter(s -> s.getAddresses().get(0).getTargetRef().getName().equals(podName)) .map(s -> (ServiceInstance) new KubernetesServiceInstance(serviceName, s.getAddresses().stream().findFirst().orElseThrow(IllegalStateException::new), s.getPorts().stream().findFirst().orElseThrow(IllegalStateException::new), false)) .findFirst().orElse(defaultInstance); } catch (Throwable t) { return defaultInstance; } }
EndpointPort port = subset.getPorts().get(FIRST); for (EndpointAddress address : subset.getAddresses()) { result.add(new Server(address.getIp(), port.getPort())); || portName.endsWith(port.getName())) { for (EndpointAddress address : subset.getAddresses()) { result.add(new Server(address.getIp(), port.getPort()));
public EndpointAddressFluentImpl(EndpointAddress instance){ this.withHostname(instance.getHostname()); this.withIp(instance.getIp()); this.withTargetRef(instance.getTargetRef()); }
for (EndpointSubset subset : endpoints.getSubsets()) { for (EndpointAddress address : subset.getAddresses()) { String podName = address.getTargetRef().getName(); podNames.add(podName); String privateIp = address.getIp(); privateIps.add(privateIp);
public EndpointAddressBuilder( EndpointAddressFluent<?> fluent ){ this(fluent, new EndpointAddress()); } public EndpointAddressBuilder( EndpointAddressFluent<?> fluent , EndpointAddress instance ){
@Override public String getHost() { return endpointAddress.getIp(); }
public EndpointAddressBuilder(){ this(new EndpointAddress()); } public EndpointAddressBuilder( EndpointAddressFluent<?> fluent ){
EndpointPort port = subset.getPorts().get(FIRST); for (EndpointAddress address : subset.getAddresses()) { result.add(new Server(address.getIp(), port.getPort())); if (Utils.isNullOrEmpty(portName) || portName.endsWith(port.getName())) { for (EndpointAddress address : subset.getAddresses()) { result.add(new Server(address.getIp(), port.getPort()));
public EndpointAddressBuilder( EndpointAddressFluent<?> fluent ){ this(fluent, new EndpointAddress()); } public EndpointAddressBuilder( EndpointAddressFluent<?> fluent , EndpointAddress instance ){