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/DeviceEvent.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/DeviceEvent.java
index fa7a761..a4c3450 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/DeviceEvent.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/DeviceEvent.java
@@ -28,6 +28,14 @@
protected List<SwitchPort> attachmentPoints;
protected Set<InetAddress> ipAddresses;
+
+ /**
+ * Default constructor.
+ */
+ public DeviceEvent() {
+ mac = null;
+ }
+
public DeviceEvent(MACAddress mac) {
if (mac == null) {
throw new IllegalArgumentException("Device mac cannot be null");
@@ -78,5 +86,7 @@
.array();
}
-
+ public byte[] getID() {
+ return getDeviceID(mac.toBytes());
+ }
}