Thomas Vachuska

Fixing GUI to work with the new flow objective intents.

Fixing onos-check-flows script; it was broken badly.

Change-Id: I0962dcf879a1030449ac7cd5c0b19c211d5f36df
......@@ -6,16 +6,14 @@
aux=/tmp/stc-$$.log
trap "rm -f $aux 2>/dev/null" EXIT
onos ${1:-$OCI} "onos:flows" > $aux
cat $aux
for i in {1..5}; do
let status=0
grep "PENDING_" $aux && let status=status+1
if [ "$status" == "0" ]
then
onos ${1:-$OCI} "onos:flows" > $aux
if grep "PENDING_" $aux; then
sleep 5
else
cat $aux
exit 0
fi
sleep 5
done
cat $aux
exit 1
......
......@@ -29,6 +29,7 @@ import org.onosproject.net.flow.FlowEntry;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions.OutputInstruction;
import org.onosproject.net.intent.FlowObjectiveIntent;
import org.onosproject.net.intent.FlowRuleIntent;
import org.onosproject.net.intent.Intent;
import org.onosproject.net.intent.LinkCollectionIntent;
......@@ -572,6 +573,8 @@ public class TrafficMonitor {
links = ((PathIntent) installable).path().links();
} else if (installable instanceof FlowRuleIntent) {
links = linkResources(installable);
} else if (installable instanceof FlowObjectiveIntent) {
links = linkResources(installable);
} else if (installable instanceof LinkCollectionIntent) {
links = ((LinkCollectionIntent) installable).links();
} else if (installable instanceof OpticalPathIntent) {
......
......@@ -24,6 +24,7 @@ import org.onosproject.net.Link;
import org.onosproject.net.device.DeviceService;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.host.HostService;
import org.onosproject.net.intent.FlowObjectiveIntent;
import org.onosproject.net.intent.FlowRuleIntent;
import org.onosproject.net.intent.HostToHostIntent;
import org.onosproject.net.intent.Intent;
......@@ -180,6 +181,10 @@ public class TopoIntentFilter {
if (rulesContainDevice(flowRuleIntent.flowRules(), device.id())) {
return true;
}
} else if (installable instanceof FlowObjectiveIntent) {
FlowObjectiveIntent objectiveIntent = (FlowObjectiveIntent) installable;
return objectiveIntent.devices().contains(device.id());
} else if (installable instanceof LinkCollectionIntent) {
LinkCollectionIntent linksIntent = (LinkCollectionIntent) installable;
if (pathContainsDevice(linksIntent.links(), device.id())) {
......