blob: 35367eb606b4cdb87ad835ab79da3014bc790283 [file] [log] [blame]
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -08001package net.floodlightcontroller.flowcache.web;
2
3import net.floodlightcontroller.flowcache.IFlowService;
4
5import org.restlet.resource.Get;
6import org.restlet.resource.ServerResource;
7import org.slf4j.Logger;
8import org.slf4j.LoggerFactory;
9
10public class AddFlowResource extends ServerResource {
11
12 protected static Logger log = LoggerFactory.getLogger(AddFlowResource.class);
13
14 @Get("json")
15 public Boolean retrieve() {
16 Boolean result = false;
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 flowPathStr = (String) getRequestAttributes().get("flow");
29 log.debug("Add Flow Path: " + flowPathStr);
30
31 // TODO: Implement it.
32 result = true;
33
34 return result;
35 }
36}