Madan Jampani | 3fc72ed | 2014-10-08 12:50:27 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.device.impl; |
| 2 | |
| 3 | import org.onlab.onos.net.DeviceId; |
Yuta HIGUCHI | d40483d | 2014-10-09 15:20:30 -0700 | [diff] [blame] | 4 | import org.onlab.onos.store.Timestamp; |
Madan Jampani | 3fc72ed | 2014-10-08 12:50:27 -0700 | [diff] [blame] | 5 | |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 6 | import com.google.common.base.MoreObjects; |
| 7 | |
Madan Jampani | 3fc72ed | 2014-10-08 12:50:27 -0700 | [diff] [blame] | 8 | /** |
| 9 | * Information published by GossipDeviceStore to notify peers of a device |
| 10 | * being administratively removed. |
| 11 | */ |
| 12 | public class InternalDeviceRemovedEvent { |
| 13 | |
| 14 | private final DeviceId deviceId; |
| 15 | private final Timestamp timestamp; |
| 16 | |
| 17 | /** |
| 18 | * Creates a InternalDeviceRemovedEvent. |
| 19 | * @param deviceId identifier of the removed device. |
| 20 | * @param timestamp timestamp of when the device was administratively removed. |
| 21 | */ |
| 22 | public InternalDeviceRemovedEvent(DeviceId deviceId, Timestamp timestamp) { |
| 23 | this.deviceId = deviceId; |
| 24 | this.timestamp = timestamp; |
| 25 | } |
| 26 | |
| 27 | public DeviceId deviceId() { |
| 28 | return deviceId; |
| 29 | } |
| 30 | |
| 31 | public Timestamp timestamp() { |
| 32 | return timestamp; |
| 33 | } |
| 34 | |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 35 | @Override |
| 36 | public String toString() { |
| 37 | return MoreObjects.toStringHelper(getClass()) |
| 38 | .add("deviceId", deviceId) |
| 39 | .add("timestamp", timestamp) |
| 40 | .toString(); |
| 41 | } |
| 42 | |
Madan Jampani | 3fc72ed | 2014-10-08 12:50:27 -0700 | [diff] [blame] | 43 | // for serializer |
| 44 | @SuppressWarnings("unused") |
| 45 | private InternalDeviceRemovedEvent() { |
| 46 | deviceId = null; |
| 47 | timestamp = null; |
| 48 | } |
| 49 | } |