alshabib
Committed by Ray Milkey

Add an empty constraint as now a constraint is required for intent creation

fix typo

Change-Id: Ib769d8c68207367a12cf1d2525889935bdaf1dbc
...@@ -31,6 +31,7 @@ import org.onlab.onos.net.flow.DefaultTrafficTreatment; ...@@ -31,6 +31,7 @@ import org.onlab.onos.net.flow.DefaultTrafficTreatment;
31 import org.onlab.onos.net.flow.TrafficSelector; 31 import org.onlab.onos.net.flow.TrafficSelector;
32 import org.onlab.onos.net.flow.TrafficTreatment; 32 import org.onlab.onos.net.flow.TrafficTreatment;
33 import org.onlab.onos.net.host.HostService; 33 import org.onlab.onos.net.host.HostService;
34 +import org.onlab.onos.net.intent.Constraint;
34 import org.onlab.onos.net.intent.HostToHostIntent; 35 import org.onlab.onos.net.intent.HostToHostIntent;
35 import org.onlab.onos.net.intent.Intent; 36 import org.onlab.onos.net.intent.Intent;
36 import org.onlab.onos.net.intent.IntentService; 37 import org.onlab.onos.net.intent.IntentService;
...@@ -113,14 +114,14 @@ public class DemoInstaller implements DemoAPI { ...@@ -113,14 +114,14 @@ public class DemoInstaller implements DemoAPI {
113 public void run() { 114 public void run() {
114 TrafficSelector selector = DefaultTrafficSelector.builder().build(); 115 TrafficSelector selector = DefaultTrafficSelector.builder().build();
115 TrafficTreatment treatment = DefaultTrafficTreatment.builder().build(); 116 TrafficTreatment treatment = DefaultTrafficTreatment.builder().build();
116 - 117 + List<Constraint> constraint = Lists.newArrayList();
117 List<Host> hosts = Lists.newArrayList(hostService.getHosts()); 118 List<Host> hosts = Lists.newArrayList(hostService.getHosts());
118 while (!hosts.isEmpty()) { 119 while (!hosts.isEmpty()) {
119 Host src = hosts.remove(0); 120 Host src = hosts.remove(0);
120 for (Host dst : hosts) { 121 for (Host dst : hosts) {
121 HostToHostIntent intent = new HostToHostIntent(appId, src.id(), dst.id(), 122 HostToHostIntent intent = new HostToHostIntent(appId, src.id(), dst.id(),
122 selector, treatment, 123 selector, treatment,
123 - null); 124 + constraint);
124 existingIntents.add(intent); 125 existingIntents.add(intent);
125 intentService.submit(intent); 126 intentService.submit(intent);
126 } 127 }
......