blob: d2d3b8b1bb5283f9145129e639e3c093535afd4e [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.store.device.impl;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070017
18import static com.google.common.base.Preconditions.checkNotNull;
19
20import java.util.Map;
21
Brian O'Connorabafb502014-12-02 22:26:20 -080022import org.onosproject.cluster.NodeId;
23import org.onosproject.net.DeviceId;
24import org.onosproject.store.Timestamp;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070025
26
27/**
28 * Device Advertisement message.
29 */
30public class DeviceAntiEntropyAdvertisement {
31
32 private final NodeId sender;
33 private final Map<DeviceFragmentId, Timestamp> deviceFingerPrints;
34 private final Map<PortFragmentId, Timestamp> portFingerPrints;
35 private final Map<DeviceId, Timestamp> offline;
36
37
38 public DeviceAntiEntropyAdvertisement(NodeId sender,
39 Map<DeviceFragmentId, Timestamp> devices,
40 Map<PortFragmentId, Timestamp> ports,
41 Map<DeviceId, Timestamp> offline) {
42 this.sender = checkNotNull(sender);
43 this.deviceFingerPrints = checkNotNull(devices);
44 this.portFingerPrints = checkNotNull(ports);
45 this.offline = checkNotNull(offline);
46 }
47
48 public NodeId sender() {
49 return sender;
50 }
51
52 public Map<DeviceFragmentId, Timestamp> deviceFingerPrints() {
53 return deviceFingerPrints;
54 }
55
56 public Map<PortFragmentId, Timestamp> ports() {
57 return portFingerPrints;
58 }
59
60 public Map<DeviceId, Timestamp> offline() {
61 return offline;
62 }
63
64 // For serializer
65 @SuppressWarnings("unused")
66 private DeviceAntiEntropyAdvertisement() {
67 this.sender = null;
68 this.deviceFingerPrints = null;
69 this.portFingerPrints = null;
70 this.offline = null;
71 }
72}