Naoki Shiota | aea8858 | 2013-11-12 17:58:34 -0800 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.flowprogrammer; |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 2 | |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 3 | import org.openflow.protocol.OFBarrierReply; |
| 4 | import org.openflow.protocol.OFMessage; |
| 5 | |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 6 | import net.floodlightcontroller.core.IOFSwitch; |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 7 | import net.floodlightcontroller.core.internal.OFMessageFuture; |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 8 | import net.floodlightcontroller.core.module.IFloodlightService; |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 9 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry; |
| 10 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath; |
| 11 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 12 | import net.onrc.onos.ofcontroller.util.FlowPath; |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 13 | |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 14 | public interface IFlowPusherService extends IFloodlightService { |
| 15 | /** |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 16 | * Add a message to the queue of the switch. |
| 17 | * @param sw Switch to which message is pushed. |
| 18 | * @param msg Message object to be added. |
| 19 | * @return true if message is successfully added to a queue. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 20 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 21 | boolean add(IOFSwitch sw, OFMessage msg); |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Create a message from FlowEntry and add it to the queue of the switch. |
| 25 | * @param sw Switch to which message is pushed. |
| 26 | * @param flowPath FlowPath object used for creating message. |
| 27 | * @param flowEntry FlowEntry object used for creating message. |
| 28 | * @return true if message is successfully added to a queue. |
| 29 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 30 | boolean add(IOFSwitch sw, FlowPath flowPath, FlowEntry flowEntry); |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Create a message from IFlowEntry and add it to the queue of the switch. |
| 34 | * @param sw Switch to which message is pushed. |
| 35 | * @param flowObj IFlowPath object used for creating message. |
| 36 | * @param flowEntryObj IFlowEntry object used for creating message. |
| 37 | * @return true if message is successfully added to a queue. |
| 38 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 39 | boolean add(IOFSwitch sw, IFlowPath flowObj, IFlowEntry flowEntryObj); |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 40 | |
| 41 | /** |
| 42 | * Add BARRIER message to queue and wait for reply. |
| 43 | * @param sw Switch to which barrier message is pushed. |
| 44 | * @return BARRIER_REPLY message sent from switch. |
| 45 | */ |
| 46 | OFBarrierReply barrier(IOFSwitch sw); |
| 47 | |
| 48 | /** |
| 49 | * Add BARRIER message to queue asynchronously. |
| 50 | * @param sw Switch to which barrier message is pushed. |
| 51 | * @return Future object of BARRIER_REPLY message which will be sent from switch. |
| 52 | */ |
| 53 | OFMessageFuture<OFBarrierReply> barrierAsync(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * Suspend pushing message to a switch. |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 57 | * @param sw Switch to be suspended pushing message. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 58 | * @return true if success |
| 59 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 60 | boolean suspend(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * Resume pushing message to a switch. |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 64 | * @param sw Switch to be resumed pushing message. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 65 | * @return true if success |
| 66 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 67 | boolean resume(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Get whether pushing of message is suspended or not. |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 71 | * @param sw Switch to be checked. |
| 72 | * @return true if suspended. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 73 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 74 | boolean isSuspended(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 75 | } |