use of org.openkilda.messaging.info.event.IslInfoData in project open-kilda by telstra.
the class TopologyEventsBasicTest method isSwitchHasLessThanTwoLinks.
private boolean isSwitchHasLessThanTwoLinks(String switchId, List<IslInfoData> links) {
int inputsAmount = 0;
int outputsAmount = 0;
for (IslInfoData isl : links) {
for (PathNode node : isl.getPath()) {
if (switchId.equalsIgnoreCase(node.getSwitchId())) {
if (node.getSeqId() == 0) {
outputsAmount++;
} else if (node.getSeqId() == 1) {
inputsAmount++;
}
}
}
}
// check whether switch has more than one link in both direction (sequence id 0 and 1)
return inputsAmount <= NumberUtils.INTEGER_ONE && outputsAmount <= NumberUtils.INTEGER_ONE;
}
Aggregations