use of io.strimzi.api.kafka.model.listener.NodeAddressType in project strimzi-kafka-operator by strimzi.
the class InitWriter method writeExternalAddress.
/**
* Write the external address of this node
*
* @return if the operation was executed successfully
*/
public boolean writeExternalAddress() {
List<NodeAddress> addresses = client.nodes().withName(config.getNodeName()).get().getStatus().getAddresses();
StringBuilder externalAddresses = new StringBuilder();
String address = NodeUtils.findAddress(addresses, null);
if (address == null) {
LOGGER.error("External address not found");
return false;
} else {
LOGGER.info("Default External address found {}", address);
externalAddresses.append(externalAddressExport(null, address));
}
for (NodeAddressType type : NodeAddressType.values()) {
address = NodeUtils.findAddress(addresses, type);
LOGGER.info("External {} address found {}", type.toValue(), address);
externalAddresses.append(externalAddressExport(type, address));
}
return write(FILE_EXTERNAL_ADDRESS, externalAddresses.toString());
}
use of io.strimzi.api.kafka.model.listener.NodeAddressType in project strimzi by strimzi.
the class InitWriter method writeExternalAddress.
/**
* Write the external address of this node
*
* @return if the operation was executed successfully
*/
public boolean writeExternalAddress() {
List<NodeAddress> addresses = client.nodes().withName(config.getNodeName()).get().getStatus().getAddresses();
StringBuilder externalAddresses = new StringBuilder();
String address = NodeUtils.findAddress(addresses, null);
if (address == null) {
LOGGER.error("External address not found");
return false;
} else {
LOGGER.info("Default External address found {}", address);
externalAddresses.append(externalAddressExport(null, address));
}
for (NodeAddressType type : NodeAddressType.values()) {
address = NodeUtils.findAddress(addresses, type);
LOGGER.info("External {} address found {}", type.toValue(), address);
externalAddresses.append(externalAddressExport(type, address));
}
return write(FILE_EXTERNAL_ADDRESS, externalAddresses.toString());
}
Aggregations