blob: 32d20cc22e1bdca006cec499e2e9664a3dcb3de5 [file] [log] [blame]
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -08001package net.floodlightcontroller.flowcache.web;
2
3import net.floodlightcontroller.flowcache.IFlowService;
4import net.floodlightcontroller.util.FlowPath;
5
6import org.restlet.resource.Get;
7import org.restlet.resource.ServerResource;
8import org.slf4j.Logger;
9import org.slf4j.LoggerFactory;
10
11public class GetFlowByInstallerIdResource extends ServerResource {
12 protected static Logger log = LoggerFactory.getLogger(GetFlowByInstallerIdResource.class);
13
14 @Get("json")
15 public FlowPath retrieve() {
16 FlowPath result = null;
17
18 IFlowService flowService =
19 (IFlowService)getContext().getAttributes().
20 get(IFlowService.class.getCanonicalName());
21
22 if (flowService == null) {
23 log.debug("ONOS Flow Service not found");
24 return result;
25 }
26
27 // Extract the arguments
28 String installerIdStr = (String) getRequestAttributes().get("installer-id");
29 String dataPathEndpointsStr = (String) getRequestAttributes().get("data-path-endpoints");
30 log.debug("Get Flow Installer: " + installerIdStr + " Endpoints: " + dataPathEndpointsStr);
31
32 // TODO: Implement it.
33
34 return result;
35 }
36}