Pavlin Radoslavov | 4ef543e | 2013-05-07 13:36:57 -0700 | [diff] [blame^] | 1 | package net.floodlightcontroller.flowcache.web; |
| 2 | |
| 3 | import net.floodlightcontroller.flowcache.IFlowService; |
| 4 | import net.floodlightcontroller.util.FlowId; |
| 5 | |
| 6 | import org.openflow.util.HexString; |
| 7 | import org.restlet.resource.Get; |
| 8 | import org.restlet.resource.ServerResource; |
| 9 | import org.slf4j.Logger; |
| 10 | import org.slf4j.LoggerFactory; |
| 11 | |
| 12 | public class MeasurementInstallPathsFlowResource extends ServerResource { |
| 13 | protected static Logger log = LoggerFactory.getLogger(MeasurementInstallPathsFlowResource.class); |
| 14 | |
| 15 | @Get("json") |
| 16 | public Boolean retrieve() { |
| 17 | Boolean result = false; |
| 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 numThreadsStr = (String) getRequestAttributes().get("num-threads"); |
| 30 | Integer numThreads = new Integer(numThreadsStr); |
| 31 | log.debug("Measurement Install Paths Number of Threads " + numThreadsStr); |
| 32 | |
| 33 | // Process the request |
| 34 | result = flowService.measurementInstallPaths(numThreads); |
| 35 | return result; |
| 36 | } |
| 37 | } |