blob: c48dce260015ec93e707d564c42431579e36dae0 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.core.matchaction;
2
3import java.util.Collections;
4import java.util.LinkedList;
5import java.util.List;
6
7import net.onrc.onos.api.batchoperation.BatchOperation;
8
9/**
10 * A match-action plan to be executed on the match-action module.
11 * <p>
12 * The plan is a list of phases, and the phase is a batch operation of
13 * match-actions.
14 */
15public class MatchActionPlan {
16 List<BatchOperation<MatchAction>> phases;
17
18 /**
19 * Constructor.
20 */
21 public MatchActionPlan() {
22 phases = new LinkedList<BatchOperation<MatchAction>>();
23 }
24
25 /**
26 * Adds the specified phase to the plan.
27 *
28 * @param phase The batch operation of match-actions to be added to the
29 * plan.
30 */
31 public void addPhase(BatchOperation<MatchAction> phase) {
32 phases.add(phase);
33 }
34
35 /**
36 * Gets the list of phases of the plan.
37 *
38 * @return The list of phases, batch operations of match-actions.
39 */
40 public List<BatchOperation<MatchAction>> getPhases() {
41 return Collections.unmodifiableList(phases);
42 }
43}