* Update the Flow Path REST API to call the appropriate methods
in class FlowManager.
* Replace ':' with '=" as a separator between
field name and field value in the toString() methods
of the data containers in floodlightcontroller/util/ .
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/GetFlowByInstallerIdResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/GetFlowByInstallerIdResource.java
index 32d20cc..6b5f7f4 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/GetFlowByInstallerIdResource.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/GetFlowByInstallerIdResource.java
@@ -1,8 +1,14 @@
package net.floodlightcontroller.flowcache.web;
import net.floodlightcontroller.flowcache.IFlowService;
+import net.floodlightcontroller.util.CallerId;
+import net.floodlightcontroller.util.DataPathEndpoints;
+import net.floodlightcontroller.util.Dpid;
import net.floodlightcontroller.util.FlowPath;
+import net.floodlightcontroller.util.Port;
+import net.floodlightcontroller.util.SwitchPort;
+import org.openflow.util.HexString;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
import org.slf4j.Logger;
@@ -25,11 +31,27 @@
}
// Extract the arguments
- String installerIdStr = (String) getRequestAttributes().get("installer-id");
- String dataPathEndpointsStr = (String) getRequestAttributes().get("data-path-endpoints");
- log.debug("Get Flow Installer: " + installerIdStr + " Endpoints: " + dataPathEndpointsStr);
+ String installerIdStr = (String) getRequestAttributes().get("installer-id");
+ String srcDpidStr = (String) getRequestAttributes().get("src-dpid");
+ String srcPortStr = (String) getRequestAttributes().get("src-port");
+ String dstDpidStr = (String) getRequestAttributes().get("dst-dpid");
+ String dstPortStr = (String) getRequestAttributes().get("dst-port");
- // TODO: Implement it.
+ log.debug("Get Flow By Installer: " + installerIdStr + " Endpoints: " +
+ srcDpidStr + "--" + srcPortStr + "--" +
+ dstDpidStr + "--" + dstPortStr);
+
+ CallerId installerId = new CallerId(installerIdStr);
+ Dpid srcDpid = new Dpid(HexString.toLong(srcDpidStr));
+ Port srcPort = new Port(Short.parseShort(srcPortStr));
+ Dpid dstDpid = new Dpid(HexString.toLong(dstDpidStr));
+ Port dstPort = new Port(Short.parseShort(dstPortStr));
+ SwitchPort srcSwitchPort = new SwitchPort(srcDpid, srcPort);
+ SwitchPort dstSwitchPort = new SwitchPort(dstDpid, dstPort);
+ DataPathEndpoints dataPathEndpoints =
+ new DataPathEndpoints(srcSwitchPort, dstSwitchPort);
+
+ flowService.getFlow(installerId, dataPathEndpoints, result);
return result;
}