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 | |
| 5 | /** |
| 6 | * Abstraction of network traffic treatment. |
| 7 | */ |
| 8 | public interface TrafficTreatment { |
| 9 | |
| 10 | /** |
| 11 | * Returns list of instructions on how to treat traffic. |
| 12 | * |
| 13 | * @return list of treatment instructions |
| 14 | */ |
| 15 | List<Instruction> instructions(); |
| 16 | |
| 17 | /** |
| 18 | * Builder of traffic treatment entities. |
| 19 | */ |
| 20 | public interface Builder { |
| 21 | |
| 22 | /** |
| 23 | * Adds a traffic treatment instruction. If a same type instruction has |
| 24 | * already been added, it will be replaced by this one. |
| 25 | * |
| 26 | * @param instruction new instruction |
| 27 | */ |
| 28 | void add(Instruction instruction); |
| 29 | |
| 30 | /** |
| 31 | * Builds an immutable traffic treatment descriptor. |
| 32 | * |
| 33 | * @return traffic treatment |
| 34 | */ |
| 35 | TrafficTreatment build(); |
| 36 | } |
| 37 | |
| 38 | } |