Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 1 | package org.onlab.onos.store.service.impl; |
| 2 | |
Yuta HIGUCHI | 361664e | 2014-11-06 17:28:47 -0800 | [diff] [blame] | 3 | import java.io.Serializable; |
| 4 | |
Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 5 | import org.onlab.onos.store.service.ReadResult; |
| 6 | |
Madan Jampani | 686fa18 | 2014-11-04 23:16:27 -0800 | [diff] [blame] | 7 | /** |
| 8 | * Result of a read operation executed on the DatabaseStateMachine. |
| 9 | */ |
Yuta HIGUCHI | 361664e | 2014-11-06 17:28:47 -0800 | [diff] [blame] | 10 | @SuppressWarnings("serial") |
| 11 | public class InternalReadResult implements Serializable { |
Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 12 | |
| 13 | public enum Status { |
| 14 | OK, |
| 15 | NO_SUCH_TABLE |
| 16 | } |
| 17 | |
| 18 | private final Status status; |
| 19 | private final ReadResult result; |
| 20 | |
| 21 | public InternalReadResult(Status status, ReadResult result) { |
| 22 | this.status = status; |
| 23 | this.result = result; |
| 24 | } |
| 25 | |
| 26 | public Status status() { |
| 27 | return status; |
| 28 | } |
| 29 | |
| 30 | public ReadResult result() { |
| 31 | return result; |
| 32 | } |
| 33 | |
| 34 | @Override |
| 35 | public String toString() { |
| 36 | return "InternalReadResult [status=" + status + ", result=" + result |
| 37 | + "]"; |
| 38 | } |
| 39 | } |