Topology events related modifications:
* Added new class TopologyEvent which encapsulates one of the following
events: Switch event, Port event, Link event, Device event
* Added getID() method to the new TopologyEvent class, and to each
of the concrete topology related events.
* Added default constructors, because they are needed for Kryo-related
deserialization
* Added Kryo registration for the new classes.
Change-Id: I61233b3176a7124bdf9e906da9f5efdc663b3003
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/PortEvent.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/PortEvent.java
index e4caee5..b42bf1e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/PortEvent.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/PortEvent.java
@@ -13,6 +13,14 @@
public final Long dpid;
public final Long number;
+ /**
+ * Default constructor.
+ */
+ public SwitchPort() {
+ dpid = null;
+ number = null;
+ }
+
public SwitchPort(Long dpid, Long number) {
this.dpid = dpid;
this.number = number;
@@ -37,6 +45,13 @@
// TODO Add Hardware Address
// TODO Add Description
+ /**
+ * Default constructor.
+ */
+ public PortEvent() {
+ id = null;
+ }
+
public PortEvent(Long dpid, Long number) {
this.id = new SwitchPort(dpid, number);
}
@@ -67,4 +82,7 @@
.putChar('P').putLong(number).array();
}
+ public byte[] getID() {
+ return getPortID(getDpid(), getNumber());
+ }
}