HIGUCHI Yuta | 60a1014 | 2013-06-14 15:50:10 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.ofcontroller.flowmanager.web; |
Pavlin Radoslavov | 4ef543e | 2013-05-07 13:36:57 -0700 | [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 | 4ef543e | 2013-05-07 13:36:57 -0700 | [diff] [blame] | 4 | |
Pavlin Radoslavov | 4ef543e | 2013-05-07 13:36:57 -0700 | [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 MeasurementClearAllPathsFlowResource extends ServerResource { |
| 11 | protected static Logger log = LoggerFactory.getLogger(MeasurementClearAllPathsFlowResource.class); |
| 12 | |
| 13 | @Get("json") |
| 14 | public Boolean retrieve() { |
| 15 | Boolean result = false; |
| 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 | log.debug("Measurement Clear All Paths"); |
| 28 | |
| 29 | // Process the request |
| 30 | result = flowService.measurementClearAllPaths(); |
| 31 | return result; |
| 32 | } |
| 33 | } |