@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof CatalogNode)) return false; CatalogNode that = (CatalogNode) o; return !(node != null ? !node.equals(that.node) : that.node != null) && !(services != null ? !services.equals(that.services) : that.services != null); }
@Override public int hashCode() { int result = node != null ? node.hashCode() : 0; result = 31 * result + (services != null ? services.hashCode() : 0); return result; }
private EndpointDefinition convertToServiceDefinition(final ServiceHealth serviceHealth) { final String host = serviceHealth.getNode().getAddress(); final int port = serviceHealth.getService().getPort(); final String id = serviceHealth.getService().getId(); final String name = serviceHealth.getService().getService(); final List<String> tags = serviceHealth.getService().getTags(); final EndpointDefinition endpointDefinition = new EndpointDefinition(HealthStatus.PASS, id, name, host, port, tags); if (debug) logger.debug(sputs("convertToServiceDefinition \nserviceHealth", serviceHealth, "\nserviceDefinition", endpointDefinition)); return endpointDefinition; }
@Test public void getSingleNode() throws Exception { Consul client = Consul.consul(); CatalogEndpoint catalogClient = client.catalog(); ConsulResponse<CatalogNode> node = catalogClient.getNode(catalogClient.getNodes() .getResponse().iterator().next().getNode()); assertNotNull(node); }
private EndpointDefinition convertToServiceDefinition(final ServiceHealth serviceHealth) { final String host = serviceHealth.getNode().getAddress(); final int port = serviceHealth.getService().getPort(); final String id = serviceHealth.getService().getId(); final String name = serviceHealth.getService().getService(); final EndpointDefinition endpointDefinition = new EndpointDefinition(HealthStatus.PASS, id, name, host, port); if (debug) logger.debug(sputs("convertToServiceDefinition \nserviceHealth", serviceHealth, "\nserviceDefinition", endpointDefinition)); return endpointDefinition; }
@Override public int hashCode() { int result = node != null ? node.hashCode() : 0; result = 31 * result + (service != null ? service.hashCode() : 0); result = 31 * result + (checks != null ? checks.hashCode() : 0); return result; }
@SuppressWarnings("SimplifiableIfStatement") @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ServiceHealth)) return false; ServiceHealth that = (ServiceHealth) o; if (checks != null ? !checks.equals(that.checks) : that.checks != null) return false; return !(node != null ? !node.equals(that.node) : that.node != null) && !(service != null ? !service.equals(that.service) : that.service != null); }
@Override public int hashCode() { int result = node != null ? node.hashCode() : 0; result = 31 * result + (services != null ? services.hashCode() : 0); return result; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof CatalogNode)) return false; CatalogNode that = (CatalogNode) o; return !(node != null ? !node.equals(that.node) : that.node != null) && !(services != null ? !services.equals(that.services) : that.services != null); }
@Override public int hashCode() { int result = node != null ? node.hashCode() : 0; result = 31 * result + (service != null ? service.hashCode() : 0); result = 31 * result + (checks != null ? checks.hashCode() : 0); return result; }
@SuppressWarnings("SimplifiableIfStatement") @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ServiceHealth)) return false; ServiceHealth that = (ServiceHealth) o; if (checks != null ? !checks.equals(that.checks) : that.checks != null) return false; return !(node != null ? !node.equals(that.node) : that.node != null) && !(service != null ? !service.equals(that.service) : that.service != null); }