Jonathan Hart | 23701d1 | 2014-04-03 10:45:48 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.linkdiscovery.internal; |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 2 | |
| 3 | import net.floodlightcontroller.core.web.serializers.DPIDSerializer; |
| 4 | |
| 5 | import org.codehaus.jackson.annotate.JsonProperty; |
| 6 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 7 | |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 8 | /** |
Ray Milkey | b41100a | 2014-04-10 10:42:15 -0700 | [diff] [blame] | 9 | * Topology link up/down event history related classes and members. |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 10 | * |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 11 | * @author subrata |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 12 | */ |
| 13 | public class EventHistoryTopologyLink { |
| 14 | // The following fields are not stored as String to save memory |
Ray Milkey | 5d40601 | 2014-04-08 14:44:41 -0700 | [diff] [blame] | 15 | // They should be converted to appropriate human-readable strings by |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 16 | // the front end (e.g. in cli in Python) |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 17 | public long srcSwDpid; |
| 18 | public long dstSwDpid; |
| 19 | public int srcPortState; |
| 20 | public int dstPortState; |
| 21 | public int srcSwport; |
| 22 | public int dstSwport; |
| 23 | public String linkType; |
| 24 | public String reason; |
| 25 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 26 | @JsonProperty("Source-Switch") |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 27 | @JsonSerialize(using = DPIDSerializer.class) |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 28 | public long getSrcSwDpid() { |
| 29 | return srcSwDpid; |
| 30 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 31 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 32 | @JsonProperty("Dest-Switch") |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 33 | @JsonSerialize(using = DPIDSerializer.class) |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 34 | public long getDstSwDpid() { |
| 35 | return dstSwDpid; |
| 36 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 37 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 38 | @JsonProperty("SrcPortState") |
| 39 | public int getSrcPortState() { |
| 40 | return srcPortState; |
| 41 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 42 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 43 | @JsonProperty("DstPortState") |
| 44 | public int getDstPortState() { |
| 45 | return dstPortState; |
| 46 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 47 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 48 | @JsonProperty("SrcPort") |
| 49 | public int getSrcSwport() { |
| 50 | return srcSwport; |
| 51 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 52 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 53 | @JsonProperty("DstPort") |
| 54 | public int getDstSwport() { |
| 55 | return dstSwport; |
| 56 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 57 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 58 | @JsonProperty("LinkType") |
| 59 | public String getLinkType() { |
| 60 | return linkType; |
| 61 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 62 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 63 | @JsonProperty("Reason") |
| 64 | public String getReason() { |
| 65 | return reason; |
| 66 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 67 | |
| 68 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 69 | } |