Brian O'Connor | 7f8e301 | 2014-02-15 23:59:29 -0800 | [diff] [blame] | 1 | package net.onrc.onos.intent; |
| 2 | |
| 3 | import net.onrc.onos.ofcontroller.networkgraph.Port; |
Brian O'Connor | 67c6e66 | 2014-02-17 15:20:44 -0800 | [diff] [blame^] | 4 | import net.onrc.onos.ofcontroller.util.FlowEntryAction; |
Brian O'Connor | 7f8e301 | 2014-02-15 23:59:29 -0800 | [diff] [blame] | 5 | |
| 6 | /** |
| 7 | * |
| 8 | * @author Brian O'Connor <bocon@onlab.us> |
| 9 | * |
| 10 | */ |
| 11 | |
| 12 | class ForwardAction extends Action { |
| 13 | protected Port dstPort; |
| 14 | |
| 15 | public ForwardAction(Port dstPort) { |
| 16 | this.dstPort = dstPort; |
| 17 | } |
| 18 | |
| 19 | public String toString() { |
| 20 | return dstPort.toString(); |
| 21 | } |
Brian O'Connor | 67c6e66 | 2014-02-17 15:20:44 -0800 | [diff] [blame^] | 22 | |
| 23 | @Override |
| 24 | public FlowEntryAction getFlowEntryAction() { |
| 25 | FlowEntryAction action = new FlowEntryAction(); |
| 26 | action.setActionOutput(new net.onrc.onos.ofcontroller.util.Port(dstPort.getNumber().shortValue())); |
| 27 | return action; |
| 28 | } |
Brian O'Connor | 7f8e301 | 2014-02-15 23:59:29 -0800 | [diff] [blame] | 29 | |
| 30 | } |