Jonathan Hart | 6df9017 | 2014-04-03 10:13:11 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.datastore.internal; |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 2 | |
Jonathan Hart | 6df9017 | 2014-04-03 10:13:11 -0700 | [diff] [blame] | 3 | import net.onrc.onos.core.datastore.IMultiEntryOperation; |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 4 | |
| 5 | /** |
| 6 | * Interface for backend to realize IMultiEntryOperation. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 7 | * <p/> |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 8 | * Backend implementation must use these interfaces to update IMultiEntryOperation |
| 9 | * in order to support KVObject. |
| 10 | */ |
| 11 | public interface IModifiableMultiEntryOperation extends IMultiEntryOperation { |
| 12 | |
| 13 | /** |
| 14 | * Set value and version. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 15 | * <p/> |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 16 | * Expected to be called on multiRead implementations. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 17 | * |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 18 | * @param value |
| 19 | * @param version |
| 20 | */ |
| 21 | public void setValue(final byte[] value, final long version); |
| 22 | |
| 23 | /** |
| 24 | * Update version of the value. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 25 | * <p/> |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 26 | * Expected to be called on multiWrite, multiRead implementations. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 27 | * |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 28 | * @param version |
| 29 | */ |
| 30 | public void setVersion(long version); |
| 31 | |
| 32 | /** |
| 33 | * Update status. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 34 | * <p/> |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 35 | * Backend implementation is expected to update to SUCCESS or FAILED after |
| 36 | * datastore operation. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 37 | * |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 38 | * @param status |
| 39 | */ |
| 40 | public void setStatus(STATUS status); |
| 41 | |
| 42 | /** |
| 43 | * Return actual IModifiableMultiEntryOperation if is a wrapper, this otherwise. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 44 | * |
Yuta HIGUCHI | 66ca1bf | 2014-03-12 18:34:09 -0700 | [diff] [blame] | 45 | * @return actual IModifiableMultiEntryOperation directly interact with data store |
| 46 | */ |
| 47 | public IModifiableMultiEntryOperation getActualOperation(); |
| 48 | } |