blob: 12a8a191128e8e1433b756a1bec132873be7be3a [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Madan Jampani47c93732014-10-06 20:46:08 -070016package org.onlab.onos.store.device.impl;
17
18import org.onlab.onos.net.DeviceId;
19import org.onlab.onos.net.device.PortDescription;
20import org.onlab.onos.net.provider.ProviderId;
Yuta HIGUCHIeecee552014-10-16 14:09:01 -070021import org.onlab.onos.store.impl.Timestamped;
Madan Jampani47c93732014-10-06 20:46:08 -070022
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070023import com.google.common.base.MoreObjects;
24
Madan Jampani2206e012014-10-06 21:04:20 -070025/**
26 * Information published by GossipDeviceStore to notify peers of a port
27 * status change event.
28 */
Madan Jampani47c93732014-10-06 20:46:08 -070029public class InternalPortStatusEvent {
30
31 private final ProviderId providerId;
32 private final DeviceId deviceId;
33 private final Timestamped<PortDescription> portDescription;
34
35 protected InternalPortStatusEvent(
36 ProviderId providerId,
37 DeviceId deviceId,
38 Timestamped<PortDescription> portDescription) {
39 this.providerId = providerId;
40 this.deviceId = deviceId;
41 this.portDescription = portDescription;
42 }
43
44 public DeviceId deviceId() {
45 return deviceId;
46 }
47
48 public ProviderId providerId() {
49 return providerId;
50 }
51
52 public Timestamped<PortDescription> portDescription() {
53 return portDescription;
54 }
Yuta HIGUCHI3cc19072014-10-07 17:33:23 -070055
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070056 @Override
57 public String toString() {
58 return MoreObjects.toStringHelper(getClass())
59 .add("providerId", providerId)
60 .add("deviceId", deviceId)
61 .add("portDescription", portDescription)
62 .toString();
63 }
64
Yuta HIGUCHI3cc19072014-10-07 17:33:23 -070065 // for serializer
66 protected InternalPortStatusEvent() {
67 this.providerId = null;
68 this.deviceId = null;
69 this.portDescription = null;
70 }
Madan Jampani47c93732014-10-06 20:46:08 -070071}