blob: 068bc2c820ad9235b8d4fa26cb7ae99958f477e3 [file] [log] [blame]
tom8bb16062014-09-12 14:47:46 -07001package org.onlab.onos.net.flow;
2
3import java.util.List;
4
alshabib55a55d92014-09-16 11:59:31 -07005import org.onlab.onos.net.flow.instructions.Instruction;
6
tom8bb16062014-09-12 14:47:46 -07007/**
8 * Abstraction of network traffic treatment.
9 */
10public 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 */
alshabib369d2942014-09-12 17:59:35 -070030 Builder add(Instruction instruction);
tom8bb16062014-09-12 14:47:46 -070031
32 /**
33 * Builds an immutable traffic treatment descriptor.
34 *
35 * @return traffic treatment
36 */
37 TrafficTreatment build();
38 }
39
40}