Add "East-bound" update by replication event interface
Change-Id: I79ce13bd0cd537af15d6c71afdbae6475fb2d265
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java
index 9186e43..f50273e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java
@@ -25,8 +25,8 @@
* re-ordering. e.g.) Link Add came in, but Switch was not there.
*
*/
-public class NetworkGraphImpl extends AbstractNetworkGraph
- implements NetworkGraphDiscoveryInterface {
+public class NetworkGraphImpl extends AbstractNetworkGraph implements
+ NetworkGraphDiscoveryInterface, NetworkGraphReplicationInterface {
private static final Logger log = LoggerFactory
.getLogger(NetworkGraphImpl.class);
@@ -675,4 +675,54 @@
// TODO implement
return true;
}
+
+ @Override
+ public void putSwitchReplicationEvent(SwitchEvent switchEvent) {
+ if (checkAddSwitchInvariant(switchEvent)) {
+ putSwitch(switchEvent);
+ }
+ // TODO handle invariant violation
+ }
+
+ @Override
+ public void removeSwitchReplicationEvent(SwitchEvent switchEvent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void putPortReplicationEvent(PortEvent portEvent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removePortReplicationEvent(PortEvent portEvent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void putLinkReplicationEvent(LinkEvent linkEvent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeLinkReplicationEvent(LinkEvent linkEvent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void putDeviceReplicationEvent(DeviceEvent deviceEvent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeDeviceReplicationEvent(DeviceEvent deviceEvent) {
+ // TODO Auto-generated method stub
+
+ }
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphReplicationInterface.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphReplicationInterface.java
new file mode 100644
index 0000000..6b77ece
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphReplicationInterface.java
@@ -0,0 +1,17 @@
+package net.onrc.onos.ofcontroller.networkgraph;
+
+/**
+ * Interface to use to update Network Graph triggered by notification.
+ *
+ * Requested change by these methods will not be propagated down to DataStore
+ */
+public interface NetworkGraphReplicationInterface {
+ public void putSwitchReplicationEvent(SwitchEvent switchEvent);
+ public void removeSwitchReplicationEvent(SwitchEvent switchEvent);
+ public void putPortReplicationEvent(PortEvent portEvent);
+ public void removePortReplicationEvent(PortEvent portEvent);
+ public void putLinkReplicationEvent(LinkEvent linkEvent);
+ public void removeLinkReplicationEvent(LinkEvent linkEvent);
+ public void putDeviceReplicationEvent(DeviceEvent deviceEvent);
+ public void removeDeviceReplicationEvent(DeviceEvent deviceEvent);
+}