use of org.openkilda.messaging.info.event.SwitchInfoData in project open-kilda by telstra.
the class NetworkCache method getDirectlyConnectedSwitches.
/**
* Gets all {@link SwitchInfoData} instances directly connected to specified.
*
* @param switchId switch id
* @return {@link Set} of {@link SwitchInfoData} instances
* @throws CacheException if {@link SwitchInfoData} instance with specified id does not exist
*/
public Set<SwitchInfoData> getDirectlyConnectedSwitches(String switchId) throws CacheException {
logger.debug("Get all switches directly connected to {} switch ", switchId);
SwitchInfoData node = getSwitch(switchId);
return network.adjacentNodes(node);
}
use of org.openkilda.messaging.info.event.SwitchInfoData in project open-kilda by telstra.
the class NetworkCache method getIslsBySource.
/**
* Gets all {@link IslInfoData} instances which start node is specified {@link SwitchInfoData} instance.
*
* @param switchId {@link SwitchInfoData} instance id
* @return {@link Set} of {@link IslInfoData} instances
* @throws CacheException if {@link SwitchInfoData} instance with specified id does not exists
*/
public Set<IslInfoData> getIslsBySource(String switchId) {
logger.debug("Get all isls by source switch {}", switchId);
SwitchInfoData startNode = getSwitch(switchId);
return network.outEdges(startNode);
}
use of org.openkilda.messaging.info.event.SwitchInfoData in project open-kilda by telstra.
the class TopologyEventsBasicTest method the_links_disappear_from_the_topology_engine.
@Then("^the links disappear from the topology engine\\.$")
public void the_links_disappear_from_the_topology_engine() throws Exception {
// todo check whether we need to wait until links will disappear or we might delete them instantly when switch goes down
TimeUnit.SECONDS.sleep(15);
final SwitchInfoData middleSwitch = getMiddleSwitch(SwitchesUtils.dumpSwitches());
final List<IslInfoData> links = LinksUtils.dumpLinks();
List<IslInfoData> switchLinks = links.stream().filter(isl -> isLinkBelongToSwitch(middleSwitch.getSwitchId(), isl)).filter(isl -> isl.getState() == IslChangeType.DISCOVERED).collect(Collectors.toList());
assertTrue("Switch shouldn't have any active links", switchLinks.isEmpty());
}
Aggregations