blob: 99f880cc7b8f6dd97e3f62848acdf830c574f2cd [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.openflow.util.HexString;
7import org.restlet.resource.Get;
8import org.restlet.resource.ServerResource;
9import org.slf4j.Logger;
10import org.slf4j.LoggerFactory;
11
12public class GetFlowByIdResource extends ServerResource {
13 protected static Logger log = LoggerFactory.getLogger(GetFlowByIdResource.class);
14
15 @Get("json")
16 public FlowPath retrieve() {
17 FlowPath result = null;
18
19 IFlowService flowService =
20 (IFlowService)getContext().getAttributes().
21 get(IFlowService.class.getCanonicalName());
22
23 if (flowService == null) {
24 log.debug("ONOS Flow Service not found");
25 return result;
26 }
27
28 // Extract the arguments
29 String flowIdStr = (String) getRequestAttributes().get("flow-id");
30 long flowId = HexString.toLong(flowIdStr);
31 log.debug("Get Flow Id: " + flowIdStr);
32
33 // TODO: Implement it.
34
35 return result;
36 }
37}