blob: b8b9c1096b4aa260ab2d843b8c597836fe49d621 [file] [log] [blame]
tom8bb16062014-09-12 14:47:46 -07001package org.onlab.onos.net.flow;
2
3import java.util.List;
4
5/**
6 * Abstraction of network traffic treatment.
7 */
8public 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 */
alshabib369d2942014-09-12 17:59:35 -070028 Builder add(Instruction instruction);
tom8bb16062014-09-12 14:47:46 -070029
30 /**
31 * Builds an immutable traffic treatment descriptor.
32 *
33 * @return traffic treatment
34 */
35 TrafficTreatment build();
36 }
37
38}