blob: ff59ab067d2a77da3f03132d31181b0f6f6cdd2f [file] [log] [blame]
Madan Jampani47c93732014-10-06 20:46:08 -07001package org.onlab.onos.store.device.impl;
2
3import org.onlab.onos.net.DeviceId;
4import org.onlab.onos.net.device.PortDescription;
5import org.onlab.onos.net.provider.ProviderId;
Yuta HIGUCHIeecee552014-10-16 14:09:01 -07006import org.onlab.onos.store.impl.Timestamped;
Madan Jampani47c93732014-10-06 20:46:08 -07007
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -07008import com.google.common.base.MoreObjects;
9
Madan Jampani2206e012014-10-06 21:04:20 -070010/**
11 * Information published by GossipDeviceStore to notify peers of a port
12 * status change event.
13 */
Madan Jampani47c93732014-10-06 20:46:08 -070014public 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 HIGUCHI3cc19072014-10-07 17:33:23 -070040
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070041 @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 HIGUCHI3cc19072014-10-07 17:33:23 -070050 // for serializer
51 protected InternalPortStatusEvent() {
52 this.providerId = null;
53 this.deviceId = null;
54 this.portDescription = null;
55 }
Madan Jampani47c93732014-10-06 20:46:08 -070056}