HIGUCHI Yuta | efa5488 | 2013-06-12 13:13:02 -0700 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.flowcache.web; |
Pavlin Radoslavov | f5d8041 | 2013-05-24 05:14:07 +0000 | [diff] [blame] | 2 | |
HIGUCHI Yuta | edf81d7 | 2013-06-12 12:06:57 -0700 | [diff] [blame] | 3 | import net.onrc.onos.ofcontroller.flowcache.IFlowService; |
HIGUCHI Yuta | 356086e | 2013-06-12 15:21:19 -0700 | [diff] [blame^] | 4 | import net.onrc.onos.ofcontroller.util.FlowId; |
Pavlin Radoslavov | f5d8041 | 2013-05-24 05:14:07 +0000 | [diff] [blame] | 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 MeasurementGetPerFlowInstallTimeFlowResource extends ServerResource { |
| 13 | protected static Logger log = LoggerFactory.getLogger(MeasurementGetPerFlowInstallTimeFlowResource.class); |
| 14 | |
| 15 | @Get("json") |
| 16 | public String retrieve() { |
| 17 | String 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 | |
| 30 | // Process the request |
| 31 | result = flowService.measurementGetPerFlowInstallTime(); |
| 32 | |
| 33 | log.debug("Measurement Get Install Paths Time (nsec): " + result); |
| 34 | |
| 35 | return result; |
| 36 | } |
| 37 | } |