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 | e319973 | 2013-11-25 16:14:43 -0800 | [diff] [blame^] | 16 | * Create a queue correspondent to the switch. |
| 17 | * @param sw Switch to which new queue is attached. |
| 18 | * @return true if new queue is successfully created. |
| 19 | */ |
| 20 | boolean createQueue(IOFSwitch sw); |
| 21 | |
| 22 | /** |
| 23 | * Delete a queue correspondent to the switch. |
| 24 | * Messages remains in queue will be all sent before queue is deleted. |
| 25 | * @param sw Switch of which queue is deleted. |
| 26 | * @return true if queue is successfully deleted. |
| 27 | */ |
| 28 | boolean deleteQueue(IOFSwitch sw); |
| 29 | |
| 30 | /** |
| 31 | * Delete a queue correspondent to the switch. |
| 32 | * By setting force flag on, queue will be deleted immediately. |
| 33 | * @param sw Switch of which queue is deleted. |
| 34 | * @param force If this flag is on, queue will be deleted immediately |
| 35 | * regardless of any messages in the queue. |
| 36 | * @return true if queue is successfully deleted. |
| 37 | */ |
| 38 | boolean deleteQueue(IOFSwitch sw, boolean force); |
| 39 | |
| 40 | /** |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 41 | * Add a message to the queue of the switch. |
| 42 | * @param sw Switch to which message is pushed. |
| 43 | * @param msg Message object to be added. |
| 44 | * @return true if message is successfully added to a queue. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 45 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 46 | boolean add(IOFSwitch sw, OFMessage msg); |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Create a message from FlowEntry and add it to the queue of the switch. |
| 50 | * @param sw Switch to which message is pushed. |
| 51 | * @param flowPath FlowPath object used for creating message. |
| 52 | * @param flowEntry FlowEntry object used for creating message. |
| 53 | * @return true if message is successfully added to a queue. |
| 54 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 55 | boolean add(IOFSwitch sw, FlowPath flowPath, FlowEntry flowEntry); |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Create a message from IFlowEntry and add it to the queue of the switch. |
| 59 | * @param sw Switch to which message is pushed. |
| 60 | * @param flowObj IFlowPath object used for creating message. |
| 61 | * @param flowEntryObj IFlowEntry object used for creating message. |
| 62 | * @return true if message is successfully added to a queue. |
| 63 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 64 | boolean add(IOFSwitch sw, IFlowPath flowObj, IFlowEntry flowEntryObj); |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 65 | |
| 66 | /** |
Naoki Shiota | e319973 | 2013-11-25 16:14:43 -0800 | [diff] [blame^] | 67 | * Set sending rate to a switch. |
| 68 | * @param sw Switch. |
| 69 | * @param rate Rate in bytes/ms. |
| 70 | */ |
| 71 | public void setRate(IOFSwitch sw, long rate); |
| 72 | |
| 73 | /** |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 74 | * Add BARRIER message to queue and wait for reply. |
| 75 | * @param sw Switch to which barrier message is pushed. |
| 76 | * @return BARRIER_REPLY message sent from switch. |
| 77 | */ |
| 78 | OFBarrierReply barrier(IOFSwitch sw); |
| 79 | |
| 80 | /** |
| 81 | * Add BARRIER message to queue asynchronously. |
| 82 | * @param sw Switch to which barrier message is pushed. |
| 83 | * @return Future object of BARRIER_REPLY message which will be sent from switch. |
| 84 | */ |
| 85 | OFMessageFuture<OFBarrierReply> barrierAsync(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * Suspend pushing message to a switch. |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 89 | * @param sw Switch to be suspended pushing message. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 90 | * @return true if success |
| 91 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 92 | boolean suspend(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Resume pushing message to a switch. |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 96 | * @param sw Switch to be resumed pushing message. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 97 | * @return true if success |
| 98 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 99 | boolean resume(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 100 | |
| 101 | /** |
| 102 | * Get whether pushing of message is suspended or not. |
Naoki Shiota | c1601d3 | 2013-11-20 10:47:34 -0800 | [diff] [blame] | 103 | * @param sw Switch to be checked. |
| 104 | * @return true if suspended. |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 105 | */ |
Brian O'Connor | 8c166a7 | 2013-11-14 18:41:48 -0800 | [diff] [blame] | 106 | boolean isSuspended(IOFSwitch sw); |
Naoki Shiota | 8ee48d5 | 2013-11-11 15:51:17 -0800 | [diff] [blame] | 107 | } |