SDN Controller Programming Guide

207
Example: if one needs to flood out packets through a port, it can do a check using this
API to see if broadcast would be possible through this port. If this API indicates negative,
then it would mean the port is in blocked state.
Provide hooks for interested components to get notified of topology changes
The API’s are described in the following listing. See Javadoc on page 9 for details.
Topology Service:
public interface TopologyService {
boolean pathExists(DataPathId source, DataPathId dest);
L2Path path(DataPathId source, DataPathId dest);
Set<BigPortNumber> ports(DataPathId switchDpid);
boolean isConnectionPoint(DataPathId switchDpid,
BigPortNumber portId);
List<TopologyCluster> clusters();
TopologyCluster cluster(DataPathId switchDpid);
boolean participateInBroadcast(DataPathId switchDpid,
BigPortNumber portId);
Map<DataPathId, Link> tree(long clusterId);
void addListener(TopologyListener listener);
void removeListener(TopologyListener listener);
}