Yuta HIGUCHI | 5fa3dc0 | 2014-10-15 17:08:13 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.store.host.impl; |
| 2 | |
| 3 | import static com.google.common.base.Preconditions.checkNotNull; |
| 4 | |
| 5 | import java.util.Map; |
| 6 | |
| 7 | import org.onlab.onos.cluster.NodeId; |
| 8 | import org.onlab.onos.net.HostId; |
| 9 | import org.onlab.onos.store.Timestamp; |
| 10 | |
| 11 | /** |
| 12 | * Host AE Advertisement message. |
| 13 | */ |
| 14 | public final class HostAntiEntropyAdvertisement { |
| 15 | |
| 16 | private final NodeId sender; |
| 17 | private final Map<HostFragmentId, Timestamp> timestamps; |
| 18 | private final Map<HostId, Timestamp> tombstones; |
| 19 | |
| 20 | |
| 21 | public HostAntiEntropyAdvertisement(NodeId sender, |
| 22 | Map<HostFragmentId, Timestamp> timestamps, |
| 23 | Map<HostId, Timestamp> tombstones) { |
| 24 | this.sender = checkNotNull(sender); |
| 25 | this.timestamps = checkNotNull(timestamps); |
| 26 | this.tombstones = checkNotNull(tombstones); |
| 27 | } |
| 28 | |
| 29 | public NodeId sender() { |
| 30 | return sender; |
| 31 | } |
| 32 | |
| 33 | public Map<HostFragmentId, Timestamp> timestamps() { |
| 34 | return timestamps; |
| 35 | } |
| 36 | |
| 37 | public Map<HostId, Timestamp> tombstones() { |
| 38 | return tombstones; |
| 39 | } |
| 40 | |
| 41 | // For serializer |
| 42 | @SuppressWarnings("unused") |
| 43 | private HostAntiEntropyAdvertisement() { |
| 44 | this.sender = null; |
| 45 | this.timestamps = null; |
| 46 | this.tombstones = null; |
| 47 | } |
| 48 | } |