Yuta HIGUCHI | b5df76d | 2014-09-27 20:54:00 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.store.device.impl; |
Yuta HIGUCHI | 2e96389 | 2014-09-27 13:00:39 -0700 | [diff] [blame] | 2 | |
| 3 | import org.apache.felix.scr.annotations.Component; |
| 4 | import org.apache.felix.scr.annotations.Service; |
| 5 | import org.onlab.onos.cluster.MastershipTerm; |
| 6 | import org.onlab.onos.net.DeviceId; |
| 7 | import org.onlab.onos.store.ClockService; |
| 8 | import org.onlab.onos.store.Timestamp; |
| 9 | |
Yuta HIGUCHI | b5df76d | 2014-09-27 20:54:00 -0700 | [diff] [blame^] | 10 | // FIXME: Code clone in onos-core-trivial, onos-core-hz-net |
Yuta HIGUCHI | 2e96389 | 2014-09-27 13:00:39 -0700 | [diff] [blame] | 11 | /** |
| 12 | * Dummy implementation of {@link ClockService}. |
| 13 | */ |
| 14 | @Component(immediate = true) |
| 15 | @Service |
| 16 | public class NoOpClockService implements ClockService { |
| 17 | |
| 18 | @Override |
| 19 | public Timestamp getTimestamp(DeviceId deviceId) { |
| 20 | return new Timestamp() { |
| 21 | |
| 22 | @Override |
| 23 | public int compareTo(Timestamp o) { |
| 24 | throw new IllegalStateException("Never expected to be used."); |
| 25 | } |
| 26 | }; |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { |
| 31 | } |
| 32 | } |