protected InstanceInfo buildClientInfo(String name) { return new Builder() .withId("id#" + name) .withApp("app#" + name) .withAppGroup("appGroup#" + name) .withVipAddress("vip#" + name) .withStatus(Status.UP) .withPorts(SampleServicePort.httpPorts()) .withDataCenterInfo(SampleAwsDataCenterInfo.UsEast1a.build()) .build(); } }
public static Service createServiceOf(String serverId, Application application, DataCenterInfoGenerator dataCenterInfoGenerator) { String id = application.getServiceName(); HashSet<String> healthcheckURLs = new HashSet<>(); healthcheckURLs.add("TODO"); Map<String, String> metaData = new HashMap<>(); metaData.put("key1", "value1"); Builder builder = new Builder() .withId(id) .withApp(application.getName()) .withAppGroup(application.getName() + "_group") .withAsg(application.getName() + "_asg") .withDataCenterInfo(dataCenterInfoGenerator.next()) .withHealthCheckUrls(healthcheckURLs) .withHomePageUrl("TODO") .withMetaData(metaData) .withPorts(SampleServicePort.httpPorts()) .withVipAddress(application.getName() + "_vip") .withSecureVipAddress(application.getName() + "_secureVip") .withStatus(Status.UP) .withStatusPageUrl("TODO"); if (serverId != null) { builder.withMetaData(TopologyFunctions.SERVER_ID_KEY, serverId); } InstanceInfo selfInfo = builder.build(); return new Service(application, selfInfo); } }
protected Builder eurekaWriteTemplate(int idx) { Builder builder = templateFor(this.name() + '#' + idx); builder.withPorts(Sets.asSet( SampleServicePort.EurekaRegistrationPort.build(), SampleServicePort.EurekaDiscoveryPort.build(), SampleServicePort.EurekaReplicationPort.build() )); return builder; }
protected Builder eurekaWriteTemplate(int idx) { Builder builder = templateFor(this.name() + '#' + idx); builder.withPorts(ExtCollections.asSet( SampleServicePort.EurekaRegistrationPort.build(), SampleServicePort.EurekaDiscoveryPort.build(), SampleServicePort.EurekaReplicationPort.build() )); return builder; }
@Override public Builder builder() { Builder builder = templateFor(this.name()); builder.withPorts(Sets.asSet( SampleServicePort.EurekaDiscoveryPort.build() )); return builder; } };
@Override public Builder builder() { Builder builder = templateFor(this.name()); builder.withPorts(ExtCollections.asSet( SampleServicePort.EurekaDiscoveryPort.build() )); return builder; } };
protected Builder templateFor(String name) { HashSet<String> healthCheckUrls = new HashSet<>(); healthCheckUrls.add("http://eureka/healthCheck/" + name + "1"); healthCheckUrls.add("http://eureka/healthCheck/" + name + "2"); HashSet<Integer> ports = new HashSet<>(); ports.add(80); ports.add(8080); HashSet<Integer> securePorts = new HashSet<>(); securePorts.add(443); securePorts.add(8443); return new Builder() .withId("id#" + name + "_" + UUID.randomUUID().toString()) .withApp("app#" + name) .withAppGroup("group#" + name) .withAsg("asg#" + name) .withHealthCheckUrls(healthCheckUrls) .withHomePageUrl("http://eureka/home/" + name) .withPorts(Sets.asSet(new ServicePort(7200, false), new ServicePort(7210, true))) .withSecureVipAddress("vipSecure#" + name) .withStatus(Status.UP) .withStatusPageUrl("http://eureka/status/" + name) .withVipAddress("vip#" + name) .withMetaData("optionA", "valueA") .withMetaData("optionB", "valueB") .withDataCenterInfo(SampleAwsDataCenterInfo.UsEast1a.build()); }
protected Builder templateFor(String name) { HashSet<String> healthCheckUrls = new HashSet<>(); healthCheckUrls.add("http://eureka/healthCheck/" + name); healthCheckUrls.add("https://eureka/healthCheck/" + name); HashSet<Integer> ports = new HashSet<>(); ports.add(80); ports.add(8080); HashSet<Integer> securePorts = new HashSet<>(); securePorts.add(443); securePorts.add(8443); return new Builder() .withId("id#" + name + "_" + UUID.randomUUID().toString()) .withApp("app#" + name) .withAppGroup("group#" + name) .withAsg("asg#" + name) .withHealthCheckUrls(healthCheckUrls) .withHomePageUrl("http://eureka/home/" + name) .withPorts(ExtCollections.asSet(new ServicePort(7200, false), new ServicePort(7210, true))) .withSecureVipAddress("vipSecure#" + name) .withStatus(Status.UP) .withStatusPageUrl("http://eureka/status/" + name) .withVipAddress("vip#" + name) .withMetaData("optionA", "valueA") .withMetaData("optionB", "valueB") .withDataCenterInfo(SampleAwsDataCenterInfo.UsEast1a.build()); }