Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.core.matchaction; |
| 2 | |
| 3 | import java.util.Collection; |
| 4 | import java.util.EventListener; |
| 5 | |
| 6 | import net.onrc.onos.api.batchoperation.BatchOperation; |
| 7 | import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy; |
| 8 | |
| 9 | /** |
| 10 | * Manages Match-Action entries. |
| 11 | * <p> |
| 12 | * TODO: Make all methods thread-safe |
| 13 | */ |
| 14 | public class MatchActionModule implements IMatchActionService { |
| 15 | |
| 16 | @Override |
| 17 | public boolean addMatchAction(MatchAction matchAction) { |
| 18 | BatchOperation<MatchAction> phase = new BatchOperation<MatchAction>(); |
| 19 | phase.addAddOperation(matchAction); |
| 20 | MatchActionPlan plan = new MatchActionPlan(); |
| 21 | plan.addPhase(phase); |
| 22 | return executePlan(plan); |
| 23 | } |
| 24 | |
| 25 | @Override |
| 26 | public boolean removeMatchAction(String id) { |
| 27 | BatchOperation<MatchAction> phase = new BatchOperation<MatchAction>(); |
| 28 | phase.addRemoveOperation(id); |
| 29 | MatchActionPlan plan = new MatchActionPlan(); |
| 30 | plan.addPhase(phase); |
| 31 | return executePlan(plan); |
| 32 | } |
| 33 | |
| 34 | @Override |
| 35 | public boolean updateMatchAction(MatchAction matchAction) { |
| 36 | BatchOperation<MatchAction> phase = new BatchOperation<MatchAction>(); |
| 37 | phase.addUpdateOperation(matchAction.getId(), matchAction); |
| 38 | MatchActionPlan plan = new MatchActionPlan(); |
| 39 | plan.addPhase(phase); |
| 40 | return executePlan(plan); |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public Collection<MatchAction> getMatchActions() { |
| 45 | // TODO Auto-generated method stub |
| 46 | return null; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public boolean executePlan(MatchActionPlan plan) { |
| 51 | // TODO Auto-generated method stub |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public void setConflictDetectionPolicy(ConflictDetectionPolicy policy) { |
| 57 | // TODO Auto-generated method stub |
| 58 | |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public ConflictDetectionPolicy getConflictDetectionPolicy() { |
| 63 | // TODO Auto-generated method stub |
| 64 | return null; |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public void addEventListener(EventListener listener) { |
| 69 | // TODO Auto-generated method stub |
| 70 | |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public void removeEventListener(EventListener listener) { |
| 75 | // TODO Auto-generated method stub |
| 76 | |
| 77 | } |
| 78 | } |