Ray Milkey | 18b44ac | 2014-08-22 08:29:47 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.matchaction; |
| 2 | |
| 3 | import net.onrc.onos.core.util.Dpid; |
| 4 | |
| 5 | public class SwitchResult { |
| 6 | private Dpid sw; |
| 7 | private Status status; |
| 8 | private MatchActionOperationsId matchSetId; |
| 9 | |
Brian O'Connor | 0efc906 | 2014-09-02 14:47:28 -0700 | [diff] [blame] | 10 | public enum Status { |
Ray Milkey | 18b44ac | 2014-08-22 08:29:47 -0700 | [diff] [blame] | 11 | SUCCESS, |
| 12 | FAILURE, |
| 13 | UNKNOWN |
| 14 | } |
| 15 | |
| 16 | protected SwitchResult(MatchActionOperationsId match, Dpid sw) { |
| 17 | this.sw = sw; |
| 18 | this.status = Status.UNKNOWN; |
| 19 | this.matchSetId = match; |
| 20 | } |
| 21 | |
Brian O'Connor | 0efc906 | 2014-09-02 14:47:28 -0700 | [diff] [blame] | 22 | /** |
| 23 | * no-arg constructor for Kryo. |
| 24 | */ |
| 25 | protected SwitchResult() { |
| 26 | |
| 27 | } |
| 28 | |
Ray Milkey | 18b44ac | 2014-08-22 08:29:47 -0700 | [diff] [blame] | 29 | protected void setStatus(Status newStatus) { |
| 30 | this.status = newStatus; |
| 31 | } |
| 32 | |
| 33 | protected Status getStatus() { |
| 34 | return this.status; |
| 35 | } |
| 36 | |
| 37 | protected MatchActionOperationsId getMatchActionOperationsId() { |
| 38 | return this.matchSetId; |
| 39 | } |
| 40 | |
| 41 | protected Dpid getSwitch() { |
| 42 | return this.sw; |
| 43 | } |
| 44 | } |