blob: 42cb17789426045baeecc5c5f7c530f3a32b35d5 [file] [log] [blame]
Madan Jampani3fc72ed2014-10-08 12:50:27 -07001package org.onlab.onos.store.device.impl;
2
3import org.onlab.onos.net.DeviceId;
Yuta HIGUCHId40483d2014-10-09 15:20:30 -07004import org.onlab.onos.store.Timestamp;
Madan Jampani3fc72ed2014-10-08 12:50:27 -07005
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -07006import com.google.common.base.MoreObjects;
7
Madan Jampani3fc72ed2014-10-08 12:50:27 -07008/**
9 * Information published by GossipDeviceStore to notify peers of a device
10 * being administratively removed.
11 */
12public 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 HIGUCHI9ee60f62014-10-09 10:00:01 -070035 @Override
36 public String toString() {
37 return MoreObjects.toStringHelper(getClass())
38 .add("deviceId", deviceId)
39 .add("timestamp", timestamp)
40 .toString();
41 }
42
Madan Jampani3fc72ed2014-10-08 12:50:27 -070043 // for serializer
44 @SuppressWarnings("unused")
45 private InternalDeviceRemovedEvent() {
46 deviceId = null;
47 timestamp = null;
48 }
49}