tom

Experimenting.

......@@ -7,6 +7,7 @@ import org.onlab.onos.net.flow.FlowRuleService;
import org.onlab.onos.net.host.HostService;
import org.onlab.onos.net.intent.IntentService;
import org.onlab.onos.net.link.LinkService;
import org.onlab.onos.net.topology.Topology;
import org.onlab.onos.net.topology.TopologyService;
/**
......@@ -19,12 +20,14 @@ public class SummaryCommand extends AbstractShellCommand {
@Override
protected void execute() {
TopologyService topologyService = get(TopologyService.class);
print("nodes=%d, devices=%d, links=%d, hosts=%d, clusters=%s, flows=%d, intents=%d",
Topology topology = topologyService.currentTopology();
print("nodes=%d, devices=%d, links=%d, hosts=%d, clusters=%s, paths=%d, flows=%d, intents=%d",
get(ClusterService.class).getNodes().size(),
get(DeviceService.class).getDeviceCount(),
get(LinkService.class).getLinkCount(),
get(HostService.class).getHostCount(),
topologyService.getClusters(topologyService.currentTopology()).size(),
topologyService.getClusters(topology).size(),
topology.pathCount(),
get(FlowRuleService.class).getFlowRuleCount(),
get(IntentService.class).getIntentCount());
}
......
......@@ -115,12 +115,7 @@ public class FlowTracker implements FlowTrackerService {
for (Event reason : event.reasons()) {
if (reason instanceof LinkEvent) {
LinkEvent linkEvent = (LinkEvent) reason;
if (linkEvent.type() == LinkEvent.Type.LINK_ADDED ||
linkEvent.type() == LinkEvent.Type.LINK_UPDATED) {
delegate.bumpIntents(intentsByLink.get(new LinkKey(linkEvent.subject())));
} else if (linkEvent.type() == LinkEvent.Type.LINK_REMOVED) {
delegate.failIntents(intentsByLink.get(new LinkKey(linkEvent.subject())));
}
}
}
}
......
......@@ -359,13 +359,5 @@ public class IntentManager
}
}
@Override
public void failIntents(Iterable<IntentId> intentIds) {
for (IntentId intentId : intentIds) {
Intent intent = getIntent(intentId);
uninstallIntent(intent);
compileIntent(intent);
}
}
}
}
......
......@@ -15,12 +15,4 @@ public interface TopologyChangeDelegate {
*/
void bumpIntents(Iterable<IntentId> intentIds);
/**
* Notifies that topology has changed in such a way that the specified
* intents should be marked failed and then recompiled.
*
* @param intentIds intents that should be failed and recompiled
*/
void failIntents(Iterable<IntentId> intentIds);
}
......