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 | */ |
Madan Jampani | 312a298 | 2014-10-14 21:07:16 -0700 | [diff] [blame] | 16 | package org.onlab.onos.store.host.impl; |
| 17 | |
| 18 | import org.onlab.onos.net.HostId; |
| 19 | import org.onlab.onos.net.host.HostDescription; |
| 20 | import org.onlab.onos.net.provider.ProviderId; |
| 21 | import org.onlab.onos.store.Timestamp; |
| 22 | |
| 23 | /** |
| 24 | * Information published by GossipHostStore to notify peers of a host |
| 25 | * change (create/update) event. |
| 26 | */ |
| 27 | public class InternalHostEvent { |
| 28 | |
| 29 | private final ProviderId providerId; |
| 30 | private final HostId hostId; |
| 31 | private final HostDescription hostDescription; |
| 32 | private final Timestamp timestamp; |
| 33 | |
| 34 | public InternalHostEvent(ProviderId providerId, HostId hostId, |
| 35 | HostDescription hostDescription, Timestamp timestamp) { |
| 36 | this.providerId = providerId; |
| 37 | this.hostId = hostId; |
| 38 | this.hostDescription = hostDescription; |
| 39 | this.timestamp = timestamp; |
| 40 | } |
| 41 | |
| 42 | public ProviderId providerId() { |
| 43 | return providerId; |
| 44 | } |
| 45 | |
| 46 | public HostId hostId() { |
| 47 | return hostId; |
| 48 | } |
| 49 | |
| 50 | public HostDescription hostDescription() { |
| 51 | return hostDescription; |
| 52 | } |
| 53 | |
| 54 | public Timestamp timestamp() { |
| 55 | return timestamp; |
| 56 | } |
| 57 | |
| 58 | // Needed for serialization. |
| 59 | @SuppressWarnings("unused") |
| 60 | private InternalHostEvent() { |
| 61 | providerId = null; |
| 62 | hostId = null; |
| 63 | hostDescription = null; |
| 64 | timestamp = null; |
| 65 | } |
| 66 | } |