Yuta HIGUCHI | 5ec89f9 | 2014-10-12 01:01:43 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.store.device.impl; |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 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.DeviceId; |
| 9 | import org.onlab.onos.store.Timestamp; |
| 10 | |
| 11 | |
| 12 | /** |
| 13 | * Device Advertisement message. |
| 14 | */ |
| 15 | public class DeviceAntiEntropyAdvertisement { |
| 16 | |
| 17 | private final NodeId sender; |
| 18 | private final Map<DeviceFragmentId, Timestamp> deviceFingerPrints; |
| 19 | private final Map<PortFragmentId, Timestamp> portFingerPrints; |
| 20 | private final Map<DeviceId, Timestamp> offline; |
| 21 | |
| 22 | |
| 23 | public DeviceAntiEntropyAdvertisement(NodeId sender, |
| 24 | Map<DeviceFragmentId, Timestamp> devices, |
| 25 | Map<PortFragmentId, Timestamp> ports, |
| 26 | Map<DeviceId, Timestamp> offline) { |
| 27 | this.sender = checkNotNull(sender); |
| 28 | this.deviceFingerPrints = checkNotNull(devices); |
| 29 | this.portFingerPrints = checkNotNull(ports); |
| 30 | this.offline = checkNotNull(offline); |
| 31 | } |
| 32 | |
| 33 | public NodeId sender() { |
| 34 | return sender; |
| 35 | } |
| 36 | |
| 37 | public Map<DeviceFragmentId, Timestamp> deviceFingerPrints() { |
| 38 | return deviceFingerPrints; |
| 39 | } |
| 40 | |
| 41 | public Map<PortFragmentId, Timestamp> ports() { |
| 42 | return portFingerPrints; |
| 43 | } |
| 44 | |
| 45 | public Map<DeviceId, Timestamp> offline() { |
| 46 | return offline; |
| 47 | } |
| 48 | |
| 49 | // For serializer |
| 50 | @SuppressWarnings("unused") |
| 51 | private DeviceAntiEntropyAdvertisement() { |
| 52 | this.sender = null; |
| 53 | this.deviceFingerPrints = null; |
| 54 | this.portFingerPrints = null; |
| 55 | this.offline = null; |
| 56 | } |
| 57 | } |