blob: 7e754fcab954bbdb47ae0d1e199118ec37f63a32 [file] [log] [blame]
Yuta HIGUCHI5ec89f92014-10-12 01:01:43 -07001package org.onlab.onos.store.device.impl;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -07002
3import static com.google.common.base.Preconditions.checkNotNull;
4
5import java.util.Map;
6
7import org.onlab.onos.cluster.NodeId;
8import org.onlab.onos.net.DeviceId;
9import org.onlab.onos.store.Timestamp;
10
11
12/**
13 * Device Advertisement message.
14 */
15public 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}