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