blob: 128c406b44e43f3206a8a000dd9ff6a088ec727d [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.link.impl;
Madan Jampania97e8202014-10-10 17:01:33 -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.LinkKey;
24import org.onosproject.store.Timestamp;
Madan Jampania97e8202014-10-10 17:01:33 -070025
26/**
27 * Link AE Advertisement message.
28 */
29public class LinkAntiEntropyAdvertisement {
30
31 private final NodeId sender;
32 private final Map<LinkFragmentId, Timestamp> linkTimestamps;
33 private final Map<LinkKey, Timestamp> linkTombstones;
34
35
36 public LinkAntiEntropyAdvertisement(NodeId sender,
37 Map<LinkFragmentId, Timestamp> linkTimestamps,
38 Map<LinkKey, Timestamp> linkTombstones) {
39 this.sender = checkNotNull(sender);
40 this.linkTimestamps = checkNotNull(linkTimestamps);
41 this.linkTombstones = checkNotNull(linkTombstones);
42 }
43
44 public NodeId sender() {
45 return sender;
46 }
47
48 public Map<LinkFragmentId, Timestamp> linkTimestamps() {
49 return linkTimestamps;
50 }
51
52 public Map<LinkKey, Timestamp> linkTombstones() {
53 return linkTombstones;
54 }
55
56 // For serializer
57 @SuppressWarnings("unused")
58 private LinkAntiEntropyAdvertisement() {
59 this.sender = null;
60 this.linkTimestamps = null;
61 this.linkTombstones = null;
62 }
63}