blob: 4540efbbb8144143e1b53572936b49b15238a831 [file] [log] [blame]
Madan Jampani5009cfb2014-10-08 11:21:07 -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 Jampani5009cfb2014-10-08 11:21:07 -07005
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -07006import com.google.common.base.MoreObjects;
7
Madan Jampani5009cfb2014-10-08 11:21:07 -07008/**
9 * Information published by GossipDeviceStore to notify peers of a device
10 * going offline.
11 */
12public class InternalDeviceOfflineEvent {
13
14 private final DeviceId deviceId;
15 private final Timestamp timestamp;
16
17 /**
18 * Creates a InternalDeviceOfflineEvent.
19 * @param deviceId identifier of device going offline.
20 * @param timestamp timestamp of when the device went offline.
21 */
22 public InternalDeviceOfflineEvent(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 Jampani5009cfb2014-10-08 11:21:07 -070043 // for serializer
44 @SuppressWarnings("unused")
45 private InternalDeviceOfflineEvent() {
46 deviceId = null;
47 timestamp = null;
48 }
49}