HIGUCHI Yuta | 60a1014 | 2013-06-14 15:50:10 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.ofcontroller.flowmanager.web; |
Pavlin Radoslavov | f5d8041 | 2013-05-24 05:14:07 +0000 | [diff] [blame] | 2 | |
HIGUCHI Yuta | 60a1014 | 2013-06-14 15:50:10 -0700 | [diff] [blame^] | 3 | import net.onrc.onos.ofcontroller.flowmanager.IFlowService; |
Pavlin Radoslavov | f5d8041 | 2013-05-24 05:14:07 +0000 | [diff] [blame] | 4 | |
Pavlin Radoslavov | f5d8041 | 2013-05-24 05:14:07 +0000 | [diff] [blame] | 5 | import org.restlet.resource.Get; |
| 6 | import org.restlet.resource.ServerResource; |
| 7 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; |
| 9 | |
| 10 | public class MeasurementGetPerFlowInstallTimeFlowResource extends ServerResource { |
| 11 | protected static Logger log = LoggerFactory.getLogger(MeasurementGetPerFlowInstallTimeFlowResource.class); |
| 12 | |
| 13 | @Get("json") |
| 14 | public String retrieve() { |
| 15 | String result = null; |
| 16 | |
| 17 | IFlowService flowService = |
| 18 | (IFlowService)getContext().getAttributes(). |
| 19 | get(IFlowService.class.getCanonicalName()); |
| 20 | |
| 21 | if (flowService == null) { |
| 22 | log.debug("ONOS Flow Service not found"); |
| 23 | return result; |
| 24 | } |
| 25 | |
| 26 | // Extract the arguments |
| 27 | |
| 28 | // Process the request |
| 29 | result = flowService.measurementGetPerFlowInstallTime(); |
| 30 | |
| 31 | log.debug("Measurement Get Install Paths Time (nsec): " + result); |
| 32 | |
| 33 | return result; |
| 34 | } |
| 35 | } |