Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.core.matchaction; |
| 2 | |
| 3 | import java.util.Collections; |
| 4 | import java.util.LinkedList; |
| 5 | import java.util.List; |
| 6 | |
| 7 | import 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 | */ |
| 15 | public 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 | } |