Intents: Converted Switch/Port objects to longs for Plan calc
Also, added notification once flows are received and installed
Change-Id: I13f8d9de9dcbf9eff584532e1bf901e78a8dc53f
diff --git a/src/main/java/net/onrc/onos/intent/FlowEntry.java b/src/main/java/net/onrc/onos/intent/FlowEntry.java
index 13bfa21..374e5d6 100644
--- a/src/main/java/net/onrc/onos/intent/FlowEntry.java
+++ b/src/main/java/net/onrc/onos/intent/FlowEntry.java
@@ -5,8 +5,6 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.intent.IntentOperation.Operator;
-import net.onrc.onos.ofcontroller.networkgraph.Port;
-import net.onrc.onos.ofcontroller.networkgraph.Switch;
import net.onrc.onos.ofcontroller.util.Dpid;
import net.onrc.onos.ofcontroller.util.FlowEntryActions;
import net.onrc.onos.ofcontroller.util.FlowEntryId;
@@ -19,12 +17,12 @@
*/
public class FlowEntry {
- protected Switch sw;
+ protected long sw;
protected Match match;
protected Set<Action> actions;
protected Operator operator;
- public FlowEntry(Switch sw, Port srcPort, Port dstPort,
+ public FlowEntry(long sw, long srcPort, long dstPort,
MACAddress srcMac, MACAddress dstMac,
Operator operator) {
this.sw = sw;
@@ -38,7 +36,7 @@
return match + "->" + actions;
}
- public Switch getSwitch() {
+ public long getSwitch() {
return sw;
}
@@ -52,7 +50,7 @@
public net.onrc.onos.ofcontroller.util.FlowEntry getFlowEntry() {
net.onrc.onos.ofcontroller.util.FlowEntry entry = new net.onrc.onos.ofcontroller.util.FlowEntry();
- entry.setDpid(new Dpid(sw.getDpid()));
+ entry.setDpid(new Dpid(sw));
entry.setFlowEntryId(new FlowEntryId(0)); // all zero for now
entry.setFlowEntryMatch(match.getFlowEntryMatch());
FlowEntryActions flowEntryActions = new FlowEntryActions();
@@ -67,6 +65,8 @@
case REMOVE:
entry.setFlowEntryUserState(FlowEntryUserState.FE_USER_DELETE);
break;
+ default:
+ break;
}
return entry;
}