Work toward implementing Shortest Path Flow installation and
maintenance within ONOS itself.

This is a checkpoint commit. The new code is not used yet.
diff --git a/src/main/java/net/onrc/onos/flow/IFlowManager.java b/src/main/java/net/onrc/onos/flow/IFlowManager.java
index da6448c..f2f9d49 100644
--- a/src/main/java/net/onrc/onos/flow/IFlowManager.java
+++ b/src/main/java/net/onrc/onos/flow/IFlowManager.java
@@ -1,53 +1,136 @@
 package net.onrc.onos.flow;
 
+import java.util.Map;
+
+import net.floodlightcontroller.core.IOFSwitch;
 import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
 import net.floodlightcontroller.util.FlowEntry;
 import net.floodlightcontroller.util.FlowPath;
 
 public interface IFlowManager {
-	
-	/*
-	 * Generic create Flow from port to port
-	 */
-	public void createFlow(IPortObject src_port, IPortObject dest_port);
-	/*
-	 * get Flows matching a src_port & dest_port
-	 */
-	public Iterable<FlowPath> getFlows(IPortObject src_port, IPortObject dest_port);
-	/*
-	 * get all Flows going out from port
-	 */
-	public Iterable<FlowPath> getFlows(IPortObject port);
-	/*
-	 * Reconcile all flows on inactive port (src port of link which might be broken)
-	 */
-	public void reconcileFlows(IPortObject src_port);
-	/*
-	 * Reconcile flow based on flow
-	 */
-	public void reconcileFlow(IPortObject src_port, IPortObject dest_port);
-	/*
-	 * compute a flow path using src/dest port
-	 */
-	public FlowPath computeFlowPath(IPortObject src_port, IPortObject dest_port);
-	/*
-	 * Get all FlowEntries of a Flow
-	 */
-    public Iterable<FlowEntry> getFlowEntries(FlowPath flow);
-    /*
-     * install a flow entry on switch
+    /**
+     * Create a Flow from port to port.
+     *
+     * TODO: We don't need it for now.
+     *
+     * @param src_port the source port.
+     * @param dest_port the destination port.
      */
-    public void installFlowEntry(FlowEntry entry);
-    /*
-     * remove a flowEntry from switch
+    public void createFlow(IPortObject src_port, IPortObject dest_port);
+
+    /**
+     * Get all Flows matching a source and a destination port.
+     *
+     * TODO: Pankaj might be implementing it later.
+     *
+     * @param src_port the source port to match.
+     * @param dest_port the destination port to match.
+     * @return all flows matching the source and the destination port.
+     */
+    public Iterable<FlowPath> getFlows(IPortObject src_port,
+				       IPortObject dest_port);
+
+    /**
+     * Get all Flows going out from a port.
+     *
+     * TODO: We need it now: Pankaj
+     *
+     * @param port the port to match.
+     * @return the list of flows that are going out from the port.
+     */
+    public Iterable<FlowPath> getFlows(IPortObject port);
+
+    /**
+     * Reconcile all flows on inactive port (src port of link which might be
+     * broken).
+     *
+     * TODO: We need it now: Pavlin
+     *
+     * @param src_port the port that has become inactive.
+     */
+    public void reconcileFlows(IPortObject src_port);
+
+    /**
+     * Reconcile all flows between a source and a destination port.
+     *
+     * TODO: We don't need it for now.
+     *
+     * @param src_port the source port.
+     * @param dest_port the destination port.
+     */
+    public void reconcileFlow(IPortObject src_port, IPortObject dest_port);
+
+    /**
+     * Compute the shortest path between a source and a destination ports.
+     *
+     * TODO: We need it now: Pavlin
+     *
+     * @param src_port the source port.
+     * @param dest_port the destination port.
+     * @return the computed shortest path between the source and the
+     * destination ports.
+     */
+    public FlowPath computeFlowPath(IPortObject src_port,
+				    IPortObject dest_port);
+
+    /**
+     * Get all Flow Entries of a Flow.
+     *
+     * TODO: We need it now: Pavlin
+     *
+     * @param flow the flow whose flow entries should be returned.
+     * @return the flow entries of the flow.
+     */
+    public Iterable<FlowEntry> getFlowEntries(FlowPath flow);
+
+    /**
+     * Install a Flow Entry on a switch.
+     *
+     * TODO: We need it now: Pavlin
+     * - Install only for local switches
+     * - It will call the installRemoteFlowEntry() for remote switches.
+     * - To be called by reconcileFlow()
+     *
+     * @param mySwitches the DPID-to-Switch mapping for the switches
+     * controlled by this controller.
+     * @param flowEntry the flow entry to install.
+     * @return true on success, otherwise false.
+     */
+    public boolean installFlowEntry(Map<Long, IOFSwitch> mySwitches,
+				    FlowEntry flowEntry);
+
+    /**
+     * Remove a Flow Entry from a switch.
+     *
+     * TODO: We need it now: Pavlin
+     * - Remove only for local switches
+     * - It will call the removeRemoteFlowEntry() for remote switches.
+     * - To be called by reconcileFlow()
+     *
+     * @param entry the flow entry to remove.
      */
     public void removeFlowEntry(FlowEntry entry);
-    /*
-     * install flow entry on remote controller
+
+    /**
+     * Install a Flow Entry on a remote controller.
+     *
+     * TODO: We need it now: Jono
+     * - For now it will make a REST call to the remote controller.
+     * - Internally, it needs to know the name of the remote controller.
+     *
+     * @param entry the flow entry to install.
+     * @return true on success, otherwise false.
      */
-    public void installFlowEntry(String ctrlId, FlowEntry entry);
-    /*
-     * remove flow entry on remote controller
+    public boolean installRemoteFlowEntry(FlowEntry entry);
+
+    /**
+     * Remove a flow entry on a remote controller.
+     *
+     * TODO: We need it now: Jono
+     * - For now it will make a REST call to the remote controller.
+     * - Internally, it needs to know the name of the remote controller.
+     *
+     * @param entry the flow entry to remove.
      */
-    public void removeFlowEntry(String ctrlId, FlowEntry entry);        
+    public void removeRemoteFlowEntry(FlowEntry entry);        
 }