Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame^] | 1 | package net.floodlightcontroller.flowcache.web; |
| 2 | |
| 3 | import net.floodlightcontroller.flowcache.IFlowService; |
| 4 | import net.floodlightcontroller.util.FlowPath; |
| 5 | |
| 6 | import org.restlet.resource.Get; |
| 7 | import org.restlet.resource.ServerResource; |
| 8 | import org.slf4j.Logger; |
| 9 | import org.slf4j.LoggerFactory; |
| 10 | |
| 11 | public 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 | } |