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.device.impl; |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 17 | |
| 18 | import static com.google.common.base.Preconditions.checkNotNull; |
| 19 | |
| 20 | import java.util.Collection; |
| 21 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 22 | import org.onosproject.cluster.NodeId; |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Message to request for other peers information. |
| 26 | */ |
| 27 | public class DeviceAntiEntropyRequest { |
| 28 | |
| 29 | private final NodeId sender; |
| 30 | private final Collection<DeviceFragmentId> devices; |
| 31 | private final Collection<PortFragmentId> ports; |
| 32 | |
| 33 | public DeviceAntiEntropyRequest(NodeId sender, |
| 34 | Collection<DeviceFragmentId> devices, |
| 35 | Collection<PortFragmentId> ports) { |
| 36 | |
| 37 | this.sender = checkNotNull(sender); |
| 38 | this.devices = checkNotNull(devices); |
| 39 | this.ports = checkNotNull(ports); |
| 40 | } |
| 41 | |
| 42 | public NodeId sender() { |
| 43 | return sender; |
| 44 | } |
| 45 | |
| 46 | public Collection<DeviceFragmentId> devices() { |
| 47 | return devices; |
| 48 | } |
| 49 | |
| 50 | public Collection<PortFragmentId> ports() { |
| 51 | return ports; |
| 52 | } |
| 53 | |
| 54 | // For serializer |
| 55 | @SuppressWarnings("unused") |
| 56 | private DeviceAntiEntropyRequest() { |
| 57 | this.sender = null; |
| 58 | this.devices = null; |
| 59 | this.ports = null; |
| 60 | } |
| 61 | } |