Fixing GUI to work with the new flow objective intents.

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

Change-Id: I0962dcf879a1030449ac7cd5c0b19c211d5f36df
diff --git a/tools/test/bin/onos-check-flows b/tools/test/bin/onos-check-flows
index 1c76511..afff9af 100755
--- a/tools/test/bin/onos-check-flows
+++ b/tools/test/bin/onos-check-flows
@@ -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
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitor.java b/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitor.java
index 3d733f9..1de86de 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitor.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitor.java
@@ -29,6 +29,7 @@
 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 @@
                         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) {
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoIntentFilter.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoIntentFilter.java
index 8372ded..12b9ce9 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoIntentFilter.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoIntentFilter.java
@@ -24,6 +24,7 @@
 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 @@
                     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())) {