blob: 4cd783c70ebc85f4e36af1299973fd9f4af78a7e [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 Jampani2ff05592014-10-10 15:42:47 -070016package org.onlab.onos.store.link.impl;
17
18import org.onlab.onos.net.LinkKey;
19import org.onlab.onos.store.Timestamp;
20
21import com.google.common.base.MoreObjects;
22
23/**
24 * Information published by GossipLinkStore to notify peers of a link
25 * being removed.
26 */
27public class InternalLinkRemovedEvent {
28
29 private final LinkKey linkKey;
30 private final Timestamp timestamp;
31
32 /**
33 * Creates a InternalLinkRemovedEvent.
34 * @param linkKey identifier of the removed link.
35 * @param timestamp timestamp of when the link was removed.
36 */
37 public InternalLinkRemovedEvent(LinkKey linkKey, Timestamp timestamp) {
38 this.linkKey = linkKey;
39 this.timestamp = timestamp;
40 }
41
42 public LinkKey linkKey() {
43 return linkKey;
44 }
45
46 public Timestamp timestamp() {
47 return timestamp;
48 }
49
50 @Override
51 public String toString() {
52 return MoreObjects.toStringHelper(getClass())
53 .add("linkKey", linkKey)
54 .add("timestamp", timestamp)
55 .toString();
56 }
57
58 // for serializer
59 @SuppressWarnings("unused")
60 private InternalLinkRemovedEvent() {
61 linkKey = null;
62 timestamp = null;
63 }
Yuta HIGUCHI8ce08732014-10-11 10:40:45 -070064}