Network Graph Refactoring: renamed the NetworkGraphDiscoveryInterface methods:

* The renaming is:
  putFooEvent -> putFooDiscoveryEvent
  removeFooEvent -> removeFooDiscoveryEvent

  After the renaming the method names are more consistent with
  NetworkGraphReplicationInterface

* Added Javadoc to the renamed NetworkGraphDiscoveryInterface methods.

Change-Id: I42516592a157dc4624f026e9317e59bbe105d8c0
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java
index 25a322b..0118294 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java
@@ -248,7 +248,7 @@
      * ******************************/
 
     @Override
-    public void putSwitchEvent(SwitchEvent switchEvent) {
+    public void putSwitchDiscoveryEvent(SwitchEvent switchEvent) {
 	if (prepareForAddSwitchEvent(switchEvent)) {
 	    datastore.addSwitch(switchEvent);
 	    putSwitch(switchEvent);
@@ -261,7 +261,7 @@
     }
 
     @Override
-    public void removeSwitchEvent(SwitchEvent switchEvent) {
+    public void removeSwitchDiscoveryEvent(SwitchEvent switchEvent) {
 	if (prepareForRemoveSwitchEvent(switchEvent)) {
 	    datastore.deactivateSwitch(switchEvent);
 	    removeSwitch(switchEvent);
@@ -272,7 +272,7 @@
     }
 
     @Override
-    public void putPortEvent(PortEvent portEvent) {
+    public void putPortDiscoveryEvent(PortEvent portEvent) {
 	if (prepareForAddPortEvent(portEvent)) {
 	    datastore.addPort(portEvent);
 	    putPort(portEvent);
@@ -285,7 +285,7 @@
     }
 
     @Override
-    public void removePortEvent(PortEvent portEvent) {
+    public void removePortDiscoveryEvent(PortEvent portEvent) {
 	if (prepareForRemovePortEvent(portEvent)) {
 	    datastore.deactivatePort(portEvent);
 	    removePort(portEvent);
@@ -296,7 +296,7 @@
     }
 
     @Override
-    public void putLinkEvent(LinkEvent linkEvent) {
+    public void putLinkDiscoveryEvent(LinkEvent linkEvent) {
 	if (prepareForAddLinkEvent(linkEvent)) {
 	    datastore.addLink(linkEvent);
 	    putLink(linkEvent);
@@ -309,12 +309,12 @@
     }
 
     @Override
-    public void removeLinkEvent(LinkEvent linkEvent) {
-	removeLinkEvent(linkEvent, false);
+    public void removeLinkDiscoveryEvent(LinkEvent linkEvent) {
+	removeLinkDiscoveryEvent(linkEvent, false);
     }
 
-    private void removeLinkEvent(LinkEvent linkEvent,
-				 boolean dstCheckBeforeDBmodify) {
+    private void removeLinkDiscoveryEvent(LinkEvent linkEvent,
+					  boolean dstCheckBeforeDBmodify) {
 	if (prepareForRemoveLinkEvent(linkEvent)) {
 	    if (dstCheckBeforeDBmodify) {
 		// write to DB only if it is owner of the dst dpid
@@ -332,7 +332,7 @@
     }
 
     @Override
-    public void putDeviceEvent(DeviceEvent deviceEvent) {
+    public void putDeviceDiscoveryEvent(DeviceEvent deviceEvent) {
 	if (prepareForAddDeviceEvent(deviceEvent)) {
 //	    datastore.addDevice(deviceEvent);
 //	    putDevice(deviceEvent);
@@ -348,7 +348,7 @@
     }
 
     @Override
-    public void removeDeviceEvent(DeviceEvent deviceEvent) {
+    public void removeDeviceDiscoveryEvent(DeviceEvent deviceEvent) {
 	if (prepareForRemoveDeviceEvent(deviceEvent)) {
 //	    datastore.removeDevice(deviceEvent);
 //	    removeDevice(deviceEvent);
@@ -397,7 +397,7 @@
 		if (!port_noOnEvent.contains(p.getNumber())) {
 		    //PortEvent rmEvent = new PortEvent(p.getSwitch().getDpid(), p.getNumber());
 		    // calling Discovery removePort() API to wipe from DB, etc.
-		    //removePortEvent(rmEvent);
+		    //removePortDiscoveryEvent(rmEvent);
 
 		    // We can't remove ports here because this will trigger a remove
 		    // from the switch's port list, which we are currently iterating
@@ -409,7 +409,7 @@
 		PortEvent rmEvent = new PortEvent(p.getSwitch().getDpid(),
 						  p.getNumber());
 		// calling Discovery removePort() API to wipe from DB, etc.
-		removePortEvent(rmEvent);
+		removePortDiscoveryEvent(rmEvent);
 	    }
 	}
     }
@@ -445,7 +445,7 @@
 	}
 	for (DeviceEvent devEvent : deviceEvents) {
 	    // calling Discovery API to wipe from DB, etc.
-	    removeDeviceEvent(devEvent);
+	    removeDeviceDiscoveryEvent(devEvent);
 	}
 
 	Set<Link> links = new HashSet<>();
@@ -465,7 +465,7 @@
 
 	    // Call internal remove Link, which will check
 	    // ownership of DST dpid and modify DB only if it is the owner
-	    removeLinkEvent(linkEvent, true);
+	    removeLinkDiscoveryEvent(linkEvent, true);
 	}
 	return true;
     }
@@ -497,7 +497,7 @@
 	}
 	for (DeviceEvent devEvent : deviceEvents) {
 	    // calling Discovery API to wipe from DB, etc.
-	    removeDeviceEvent(devEvent);
+	    removeDeviceDiscoveryEvent(devEvent);
 	}
 
 	return true;
@@ -718,15 +718,15 @@
 	    portsToRemove.add(portEvent);
 	}
 	for (PortEvent portEvent : portsToRemove) {
-	    // XXX calling removePortEvent() may trigger duplicate event,
-	    // once at prepare phase, second time here
+	    // XXX calling removePortDiscoveryEvent() may trigger duplicate
+	    // event, once at prepare phase, second time here
 	    // If event can be squashed, ignored etc. at receiver side it
 	    // shouldn't be a problem, but if not need to re-visit this issue.
 
-	    // Note: removePortEvent() implies removal of attached Device, etc.
-	    // if we decide not to call removePortEvent(), Device needs to be
-	    // handled properly
-	    removePortEvent(portEvent);
+	    // Note: removePortDiscoveryEvent() implies removal of attached
+	    // Device, etc. if we decide not to call
+	    // removePortDiscoveryEvent(), Device needs to be handled properly.
+	    removePortDiscoveryEvent(portEvent);
 	}
 
 	networkGraph.removeSwitch(swEvent.getDpid());
@@ -783,13 +783,13 @@
 	    devEvent.addAttachmentPoint(new SwitchPort(p.getSwitch().getDpid(),
 						       p.getNumber()));
 
-	    // XXX calling removeDeviceEvent() may trigger duplicate event,
-	    // once at prepare phase, second time here
+	    // XXX calling removeDeviceDiscoveryEvent() may trigger duplicate
+	    // event, once at prepare phase, second time here.
 	    // If event can be squashed, ignored etc. at receiver side it
 	    // shouldn't be a problem, but if not need to re-visit
 
 	    // calling Discovery API to wipe from DB, etc.
-	    removeDeviceEvent(devEvent);
+	    removeDeviceDiscoveryEvent(devEvent);
 	}
 	Set<Link> links = new HashSet<>();
 	links.add(p.getOutgoingLink());
@@ -807,13 +807,13 @@
 	    linksToRemove.add(linkEvent);
 	}
 	for (LinkEvent linkEvent : linksToRemove) {
-	    // XXX calling removeLinkEvent() may trigger duplicate event,
-	    // once at prepare phase, second time here
+	    // XXX calling removeLinkDiscoveryEvent() may trigger duplicate
+	    // event, once at prepare phase, second time here.
 	    // If event can be squashed, ignored etc. at receiver side it
 	    // shouldn't be a problem, but if not need to re-visit
 
 	    // calling Discovery API to wipe from DB, etc.
-	    removeLinkEvent(linkEvent);
+	    removeLinkDiscoveryEvent(linkEvent);
 	}
 
 	// remove Port from Switch
@@ -876,7 +876,7 @@
 	    DeviceEvent rmEvent = new DeviceEvent(d.getMacAddress());
 	    rmEvent.addAttachmentPoint(new SwitchPort(dstPort.getDpid(),
 						      dstPort.getNumber()));
-	    removeDeviceEvent(rmEvent);
+	    removeDeviceDiscoveryEvent(rmEvent);
 	}
 	dstPortMem.removeAllDevice();
 	for (Device d : srcPortMem.getDevices() ) {
@@ -889,7 +889,7 @@
 	    DeviceEvent rmEvent = new DeviceEvent(d.getMacAddress());
 	    rmEvent.addAttachmentPoint(new SwitchPort(dstPort.getDpid(),
 						      dstPort.getNumber()));
-	    removeDeviceEvent(rmEvent);
+	    removeDeviceDiscoveryEvent(rmEvent);
 	}
 	srcPortMem.removeAllDevice();
     }