tcp(tcpOptional);
/** * Registers a TCP Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param tcp Health check TCP host and port. * @param interval Health script run interval in seconds. * @param notes Human readable notes. Not used by Consul. */ public void registerCheck(String checkId, String name, HostAndPort tcp, long interval, String notes) { Check check = ImmutableCheck.builder() .id(checkId) .name(name) .tcp(tcp.toString()) .interval(String.format("%ss", interval)) .notes(Optional.ofNullable(notes)) .build(); registerCheck(check); }
builder.tcp(json.tcp);