Madan Jampani | 2ff0559 | 2014-10-10 15:42:47 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.link.impl; |
| 2 | |
| 3 | import org.onlab.onos.net.LinkKey; |
| 4 | import org.onlab.onos.store.Timestamp; |
| 5 | |
| 6 | import com.google.common.base.MoreObjects; |
| 7 | |
| 8 | /** |
| 9 | * Information published by GossipLinkStore to notify peers of a link |
| 10 | * being removed. |
| 11 | */ |
| 12 | public class InternalLinkRemovedEvent { |
| 13 | |
| 14 | private final LinkKey linkKey; |
| 15 | private final Timestamp timestamp; |
| 16 | |
| 17 | /** |
| 18 | * Creates a InternalLinkRemovedEvent. |
| 19 | * @param linkKey identifier of the removed link. |
| 20 | * @param timestamp timestamp of when the link was removed. |
| 21 | */ |
| 22 | public InternalLinkRemovedEvent(LinkKey linkKey, Timestamp timestamp) { |
| 23 | this.linkKey = linkKey; |
| 24 | this.timestamp = timestamp; |
| 25 | } |
| 26 | |
| 27 | public LinkKey linkKey() { |
| 28 | return linkKey; |
| 29 | } |
| 30 | |
| 31 | public Timestamp timestamp() { |
| 32 | return timestamp; |
| 33 | } |
| 34 | |
| 35 | @Override |
| 36 | public String toString() { |
| 37 | return MoreObjects.toStringHelper(getClass()) |
| 38 | .add("linkKey", linkKey) |
| 39 | .add("timestamp", timestamp) |
| 40 | .toString(); |
| 41 | } |
| 42 | |
| 43 | // for serializer |
| 44 | @SuppressWarnings("unused") |
| 45 | private InternalLinkRemovedEvent() { |
| 46 | linkKey = null; |
| 47 | timestamp = null; |
| 48 | } |
Yuta HIGUCHI | 8ce0873 | 2014-10-11 10:40:45 -0700 | [diff] [blame^] | 49 | } |