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/Match.java b/src/main/java/net/onrc/onos/intent/Match.java
index 308cfcf..5adb598 100644
--- a/src/main/java/net/onrc/onos/intent/Match.java
+++ b/src/main/java/net/onrc/onos/intent/Match.java
@@ -1,8 +1,8 @@
package net.onrc.onos.intent;
import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.ofcontroller.networkgraph.Port;
-import net.onrc.onos.ofcontroller.networkgraph.Switch;
+//import net.onrc.onos.ofcontroller.networkgraph.Port;
+//import net.onrc.onos.ofcontroller.networkgraph.Switch;
import net.onrc.onos.ofcontroller.util.FlowEntryMatch;
/**
@@ -12,13 +12,13 @@
*/
public class Match {
- protected Switch sw;
+ protected long sw;
protected MACAddress srcMac;
protected MACAddress dstMac;
- protected Port srcPort;
-
- public Match(Switch sw, Port srcPort,
- MACAddress srcMac, MACAddress dstMac) {
+ protected long srcPort;
+
+ public Match(long sw, long srcPort,
+ MACAddress srcMac, MACAddress dstMac) {
this.sw = sw;
this.srcPort = srcPort;
this.srcMac = srcMac;
@@ -43,12 +43,12 @@
FlowEntryMatch match = new FlowEntryMatch();
match.enableSrcMac(srcMac);
match.enableDstMac(dstMac);
- match.enableInPort(new net.onrc.onos.ofcontroller.util.Port(srcPort.getNumber().shortValue()));
+ match.enableInPort(new net.onrc.onos.ofcontroller.util.Port((short) srcPort));
return match;
}
@Override
public String toString() {
- return "(" + srcPort + "," + srcMac + "," + dstMac + ")";
+ return "Sw:" + sw + " (" + srcPort + "," + srcMac + "," + dstMac + ")";
}
}