Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 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'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.store.host.impl; |
Yuta HIGUCHI | 5fa3dc0 | 2014-10-15 17:08:13 -0700 | [diff] [blame] | 17 | |
| 18 | import static com.google.common.base.Preconditions.checkNotNull; |
| 19 | |
| 20 | import java.util.Map; |
| 21 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 22 | import org.onosproject.cluster.NodeId; |
| 23 | import org.onosproject.net.HostId; |
| 24 | import org.onosproject.store.Timestamp; |
Yuta HIGUCHI | 5fa3dc0 | 2014-10-15 17:08:13 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Host AE Advertisement message. |
| 28 | */ |
| 29 | public 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 | } |