Refactored LinkStorage and SwitchStorage preparing for event notification implementation.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java b/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java
index b56cfef..ce2379b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java
@@ -8,33 +8,33 @@
public interface ILinkStorage extends INetMapStorage {
/*
- * Link creation
- */
- public void update(Link link, DM_OPERATION op);
- public void update(Link link, LinkInfo linkinfo, DM_OPERATION op);
- public void update(List<Link> List, DM_OPERATION op);
-
- /*
- * Add Linkinfo
+ * Init with Storage conf
*/
- public void updateLink (Link link, LinkInfo linkinfo, DM_OPERATION op);
+ public void init(String conf);
/*
- * Delete a single link
+ * Generic operation method
+ */
+ public void update(Link link, LinkInfo linkinfo, DM_OPERATION op);
+
+ /*
+ * Link creation
+ */
+ public void addLink(Link link);
+ public void addLinks(List<Link> links);
+
+ /*
+ * Link deletion
*/
public void deleteLink(Link link);
+ public void deleteLinks(List<Link> links);
/*
- * Delete links associated with dpid and port
+ * Utility method to delete links associated with dpid and port
* If only dpid is used, All links associated for switch are removed
* Useful for port up/down and also switch join/remove events
*/
public void deleteLinksOnPort(Long dpid, short port);
-
- /*
- * Delete a list of links
- */
- public void deleteLinks(List<Link> links);
/*
* Get Links from Storage
@@ -44,10 +44,6 @@
public List<Link> getLinks(Long dpid, short port);
public List<Link> getLinks(String dpid);
public List<Link> getActiveLinks();
-
- /*
- * Init with Storage conf
- */
- public void init(String conf);
+ public LinkInfo getLinkInfo(Link link);
}