@Override public URI getUri() { if (this.serviceInstance == null) { return null; } return URI.create(this.serviceInstance.buildUriSpec()); }
public String buildUriSpec() { return buildUriSpec(Maps.<String, Object>newHashMap()); }
public String buildUriSpec() { return buildUriSpec(Maps.<String, Object>newHashMap()); }
public void outputInstance(ServiceInstance<MetaData> instance) { log.info("\t" + instance.getPayload().toString() + ": " + instance.buildUriSpec()); } }
private static void outputInstance(ServiceInstance<InstanceDetails> instance) { System.out.println("\t" + instance.getPayload().getDescription() + ": " + instance.buildUriSpec()); }
private static void outputInstance(ServiceInstance<InstanceDetails> instance) { System.out.println("\t" + instance.getPayload().getDescription() + ": " + instance.buildUriSpec()); }
/** * @param serviceId The service id to be used * @param serviceInstance The zookeeper service instance described by this service instance */ public ZookeeperServiceInstance(String serviceId, org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance> serviceInstance) { this.serviceId = serviceId; this.serviceInstance = serviceInstance; this.host = this.serviceInstance.getAddress(); this.secure = serviceInstance.getSslPort() != null; Integer port = serviceInstance.getPort(); if (this.secure) { port = serviceInstance.getSslPort(); } this.port = port; this.uri = URI.create(serviceInstance.buildUriSpec()); if (serviceInstance.getPayload() != null) { this.metadata = serviceInstance.getPayload().getMetadata(); } else { this.metadata = new HashMap<>(); } }
@Override public void contextInitialized(ServletContextEvent sce) { try { ServiceInstanceBuilder<String> builder = ServiceInstance.<String>builder() .name(serviceName) .uriSpec(new UriSpec("{scheme}://{address}:{port}")); if(ssl) { builder.sslPort(port); } else { builder.port(port); } if(address != null) { builder.address(address); } instance = builder.build(); log.info(String.format("Service Registration :: %s -> %s", serviceName, instance.buildUriSpec())); Discovery.getInstance().registerService(instance); } catch (Exception e) { log.error("", e); } }
String uri = instance.buildUriSpec(); record.getLocation().put("endpoint", uri); } else {
String uri = instance.buildUriSpec(); record.getLocation().put("endpoint", uri); } else {