blob: e036ec6176b9018cddcd5f129981ffdc501f30c2 [file] [log] [blame]
Madan Jampani47c93732014-10-06 20:46:08 -07001package org.onlab.onos.store.device.impl;
2
3import java.util.List;
4
5import org.onlab.onos.net.DeviceId;
6import org.onlab.onos.net.device.PortDescription;
7import org.onlab.onos.net.provider.ProviderId;
Yuta HIGUCHIeecee552014-10-16 14:09:01 -07008import org.onlab.onos.store.impl.Timestamped;
Madan Jampani47c93732014-10-06 20:46:08 -07009
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070010import com.google.common.base.MoreObjects;
11
Madan Jampani2206e012014-10-06 21:04:20 -070012/**
13 * Information published by GossipDeviceStore to notify peers of a port
14 * change event.
15 */
Madan Jampani47c93732014-10-06 20:46:08 -070016public class InternalPortEvent {
17
18 private final ProviderId providerId;
19 private final DeviceId deviceId;
20 private final Timestamped<List<PortDescription>> portDescriptions;
21
22 protected InternalPortEvent(
23 ProviderId providerId,
24 DeviceId deviceId,
25 Timestamped<List<PortDescription>> portDescriptions) {
26 this.providerId = providerId;
27 this.deviceId = deviceId;
28 this.portDescriptions = portDescriptions;
29 }
30
31 public DeviceId deviceId() {
32 return deviceId;
33 }
34
35 public ProviderId providerId() {
36 return providerId;
37 }
38
39 public Timestamped<List<PortDescription>> portDescriptions() {
40 return portDescriptions;
41 }
Yuta HIGUCHI3cc19072014-10-07 17:33:23 -070042
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070043 @Override
44 public String toString() {
45 return MoreObjects.toStringHelper(getClass())
46 .add("providerId", providerId)
47 .add("deviceId", deviceId)
48 .add("portDescriptions", portDescriptions)
49 .toString();
50 }
51
Yuta HIGUCHI3cc19072014-10-07 17:33:23 -070052 // for serializer
53 protected InternalPortEvent() {
54 this.providerId = null;
55 this.deviceId = null;
56 this.portDescriptions = null;
57 }
Madan Jampani47c93732014-10-06 20:46:08 -070058}