tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame^] | 5 | import org.onlab.onos.net.flow.instructions.Instruction; |
| 6 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 7 | /** |
| 8 | * Abstraction of network traffic treatment. |
| 9 | */ |
| 10 | public interface TrafficTreatment { |
| 11 | |
| 12 | /** |
| 13 | * Returns list of instructions on how to treat traffic. |
| 14 | * |
| 15 | * @return list of treatment instructions |
| 16 | */ |
| 17 | List<Instruction> instructions(); |
| 18 | |
| 19 | /** |
| 20 | * Builder of traffic treatment entities. |
| 21 | */ |
| 22 | public interface Builder { |
| 23 | |
| 24 | /** |
| 25 | * Adds a traffic treatment instruction. If a same type instruction has |
| 26 | * already been added, it will be replaced by this one. |
| 27 | * |
| 28 | * @param instruction new instruction |
| 29 | */ |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 30 | Builder add(Instruction instruction); |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Builds an immutable traffic treatment descriptor. |
| 34 | * |
| 35 | * @return traffic treatment |
| 36 | */ |
| 37 | TrafficTreatment build(); |
| 38 | } |
| 39 | |
| 40 | } |