blob: 0df0990d66cfb4234065d97af6a013219a88af8c [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
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.host.impl;
Yuta HIGUCHI5fa3dc02014-10-15 17:08:13 -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.HostId;
24import org.onosproject.store.Timestamp;
Yuta HIGUCHI5fa3dc02014-10-15 17:08:13 -070025
26/**
27 * Host AE Advertisement message.
28 */
29public final class HostAntiEntropyAdvertisement {
30
31 private final NodeId sender;
32 private final Map<HostFragmentId, Timestamp> timestamps;
33 private final Map<HostId, Timestamp> tombstones;
34
35
36 public HostAntiEntropyAdvertisement(NodeId sender,
37 Map<HostFragmentId, Timestamp> timestamps,
38 Map<HostId, Timestamp> tombstones) {
39 this.sender = checkNotNull(sender);
40 this.timestamps = checkNotNull(timestamps);
41 this.tombstones = checkNotNull(tombstones);
42 }
43
44 public NodeId sender() {
45 return sender;
46 }
47
48 public Map<HostFragmentId, Timestamp> timestamps() {
49 return timestamps;
50 }
51
52 public Map<HostId, Timestamp> tombstones() {
53 return tombstones;
54 }
55
56 // For serializer
57 @SuppressWarnings("unused")
58 private HostAntiEntropyAdvertisement() {
59 this.sender = null;
60 this.timestamps = null;
61 this.tombstones = null;
62 }
63}