use of com.couchbase.connector.config.common.ConsulConfig in project couchbase-elasticsearch-connector by couchbase.
the class PauseCommand method consulBuilder.
protected Consul.Builder consulBuilder() {
try {
if (consulConfig == null) {
System.out.println("Consul config file not specified; will not override Consul agent ACL token.");
}
final ConsulConfig config = consulConfig == null ? null : ConsulConfig.from(consulConfig);
Consul.Builder builder = Consul.builder().withHostAndPort(HostAndPort.fromString(consulAgentAddress));
if (config != null && !config.aclToken().isEmpty()) {
System.out.println("Using Consul ACL token from " + consulConfig);
builder.withAclToken(config.aclToken());
}
return builder;
} catch (IOException e) {
throw new ConfigException(e.getMessage());
}
}
Aggregations