- private boolean tunnelPortWithIpExists() {
- boolean tunnelPortWithIpExists = false;
- if (tunnelPort != null && nodeConfig != null && nodeConfig.getTunnelIp() != null) {
- tunnelPortWithIpExists = true;
+ private boolean tunnelWithIpAndNcExists() {
+ if (tunnelBuilderByType.isEmpty()) {
+ LOG.trace("No tunnel on switch {}", nodeId.getValue());
+ return false;
+ }
+ LOG.trace("Iterating over tunnel till tunnel with IP and node-connector is not found.");
+ for (TunnelBuilder tb : tunnelBuilderByType.values()) {
+ if (tb.getIp() != null && tb.getNodeConnectorId() != null) {
+ LOG.trace("Tunnel found. Type: {} IP: {} Port: {} Node-connector: {}", tb.getTunnelType()
+ .getSimpleName(), tb.getIp(), tb.getPort(), tb.getNodeConnectorId());
+ return true;
+ } else {
+ LOG.trace("Tunnel which is not completed: Type: {} IP: {} Port: {} Node-connector: {}",
+ tb.getTunnelType().getSimpleName(), tb.getIp(), tb.getPort(), tb.getNodeConnectorId());
+ }