ImmutableRegistration.Builder registrationBuilder = ImmutableRegistration.builder() .name(registerConfig.getString("name")) .address(registerConfig.getString("host")) .port(registerConfig.getInt("port")) .tags(registerConfig.getStringList("tags")) .id(UUID.randomUUID().toString()); checkConfig.getString("path")); Registration.RegCheck check = Registration.RegCheck.http(http, checkConfig.getDuration("interval", TimeUnit.SECONDS), checkConfig.getDuration("timeout", TimeUnit.SECONDS)); registrationBuilder.check(check); Registration registration = registrationBuilder.build(); env.onStop(() -> agentClient.deregister(registration.getId()));
/** * Copy the current immutable object by setting a value for the {@link Ports#getServer() server} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for server * @return A modified copy of the {@code this} object */ public final ImmutablePorts withServer(int value) { if (this.server == value) return this; return new ImmutablePorts(this.dns, this.http, this.rpc, this.serfLan, this.serfWan, value); }
/** * Creates a builder for {@link ImmutableConfig ImmutableConfig}. * @return A new ImmutableConfig builder */ public static ImmutableConfig.Builder builder() { return new ImmutableConfig.Builder(); }
public static RegCheck grpc(String grpc, long interval, boolean useTls) { return ImmutableRegCheck .builder() .grpc(grpc) .grpcUseTls(useTls) .interval(String.format("%ss", interval)) .build(); }
/** * Builds a new {@link ImmutableTelemetry ImmutableTelemetry}. * @return An immutable instance of Telemetry * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableTelemetry build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableTelemetry(statsiteAddr, statsdAddr, statsitePrefix, disableHostname, dogStatsdAddr, dogStatsdTags); }
/** * Creates a builder for {@link ImmutableRegistration ImmutableRegistration}. * @return A new ImmutableRegistration builder */ public static ImmutableRegistration.Builder builder() { return new ImmutableRegistration.Builder(); }
/** * Creates a builder for {@link ImmutableRegCheck ImmutableRegCheck}. * @return A new ImmutableRegCheck builder */ public static ImmutableRegCheck.Builder builder() { return new ImmutableRegCheck.Builder(); }
/** * Creates a builder for {@link ImmutableDebugConfig ImmutableDebugConfig}. * @return A new ImmutableDebugConfig builder */ public static ImmutableDebugConfig.Builder builder() { return new ImmutableDebugConfig.Builder(); }
/** * Creates a builder for {@link ImmutableCheck ImmutableCheck}. * @return A new ImmutableCheck builder */ public static ImmutableCheck.Builder builder() { return new ImmutableCheck.Builder(); }
/** * Creates a builder for {@link ImmutableTelemetry ImmutableTelemetry}. * @return A new ImmutableTelemetry builder */ public static ImmutableTelemetry.Builder builder() { return new ImmutableTelemetry.Builder(); }
/** * Creates a builder for {@link ImmutableMember ImmutableMember}. * @return A new ImmutableMember builder */ public static ImmutableMember.Builder builder() { return new ImmutableMember.Builder(); }
/** * Creates a builder for {@link ImmutableAgent ImmutableAgent}. * @return A new ImmutableAgent builder */ public static ImmutableAgent.Builder builder() { return new ImmutableAgent.Builder(); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getRpc() rpc} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for rpc * @return A modified copy of the {@code this} object */ public final ImmutablePorts withRpc(int value) { if (this.rpc == value) return this; return new ImmutablePorts(this.dns, this.http, value, this.serfLan, this.serfWan, this.server); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getSerfWan() serfWan} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for serfWan * @return A modified copy of the {@code this} object */ public final ImmutablePorts withSerfWan(int value) { if (this.serfWan == value) return this; return new ImmutablePorts(this.dns, this.http, this.rpc, this.serfLan, value, this.server); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getHttp() http} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for http * @return A modified copy of the {@code this} object */ public final ImmutablePorts withHttp(int value) { if (this.http == value) return this; return new ImmutablePorts(this.dns, value, this.rpc, this.serfLan, this.serfWan, this.server); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getSerfLan() serfLan} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for serfLan * @return A modified copy of the {@code this} object */ public final ImmutablePorts withSerfLan(int value) { if (this.serfLan == value) return this; return new ImmutablePorts(this.dns, this.http, this.rpc, value, this.serfWan, this.server); }