Madan Jampani | 47c9373 | 2014-10-06 20:46:08 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.device.impl; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | import org.onlab.onos.net.DeviceId; |
| 6 | import org.onlab.onos.net.device.PortDescription; |
| 7 | import org.onlab.onos.net.provider.ProviderId; |
Yuta HIGUCHI | fa891c9 | 2014-10-09 15:21:40 -0700 | [diff] [blame] | 8 | import org.onlab.onos.store.common.impl.Timestamped; |
Madan Jampani | 47c9373 | 2014-10-06 20:46:08 -0700 | [diff] [blame] | 9 | |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 10 | import com.google.common.base.MoreObjects; |
| 11 | |
Madan Jampani | 2206e01 | 2014-10-06 21:04:20 -0700 | [diff] [blame] | 12 | /** |
| 13 | * Information published by GossipDeviceStore to notify peers of a port |
| 14 | * change event. |
| 15 | */ |
Madan Jampani | 47c9373 | 2014-10-06 20:46:08 -0700 | [diff] [blame] | 16 | public class InternalPortEvent { |
| 17 | |
| 18 | private final ProviderId providerId; |
| 19 | private final DeviceId deviceId; |
| 20 | private final Timestamped<List<PortDescription>> portDescriptions; |
| 21 | |
| 22 | protected InternalPortEvent( |
| 23 | ProviderId providerId, |
| 24 | DeviceId deviceId, |
| 25 | Timestamped<List<PortDescription>> portDescriptions) { |
| 26 | this.providerId = providerId; |
| 27 | this.deviceId = deviceId; |
| 28 | this.portDescriptions = portDescriptions; |
| 29 | } |
| 30 | |
| 31 | public DeviceId deviceId() { |
| 32 | return deviceId; |
| 33 | } |
| 34 | |
| 35 | public ProviderId providerId() { |
| 36 | return providerId; |
| 37 | } |
| 38 | |
| 39 | public Timestamped<List<PortDescription>> portDescriptions() { |
| 40 | return portDescriptions; |
| 41 | } |
Yuta HIGUCHI | 3cc1907 | 2014-10-07 17:33:23 -0700 | [diff] [blame] | 42 | |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 43 | @Override |
| 44 | public String toString() { |
| 45 | return MoreObjects.toStringHelper(getClass()) |
| 46 | .add("providerId", providerId) |
| 47 | .add("deviceId", deviceId) |
| 48 | .add("portDescriptions", portDescriptions) |
| 49 | .toString(); |
| 50 | } |
| 51 | |
Yuta HIGUCHI | 3cc1907 | 2014-10-07 17:33:23 -0700 | [diff] [blame] | 52 | // for serializer |
| 53 | protected InternalPortEvent() { |
| 54 | this.providerId = null; |
| 55 | this.deviceId = null; |
| 56 | this.portDescriptions = null; |
| 57 | } |
Madan Jampani | 47c9373 | 2014-10-06 20:46:08 -0700 | [diff] [blame] | 58 | } |