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 | import net.floodlightcontroller.core.web.serializers.IPv4Serializer; |
| 5 | |
| 6 | import org.codehaus.jackson.annotate.JsonProperty; |
| 7 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 8 | |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 9 | /** |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 10 | * Topology Switch event history related classes and members |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 11 | * |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 12 | * @author subrata |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 13 | */ |
| 14 | public class EventHistoryTopologySwitch { |
| 15 | // The following fields are not stored as String to save memory |
| 16 | // They should be converted to appropriate human-readable strings by |
| 17 | // the front end (e.g. in cli in Python) |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 18 | public long dpid; |
| 19 | public int ipv4Addr; |
| 20 | public int l4Port; |
| 21 | public String reason; |
| 22 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 23 | @JsonProperty("Switch") |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 24 | @JsonSerialize(using = DPIDSerializer.class) |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 25 | public long getDpid() { |
| 26 | return dpid; |
| 27 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 28 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 29 | @JsonProperty("IpAddr") |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 30 | @JsonSerialize(using = IPv4Serializer.class) |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 31 | public int getIpv4Addr() { |
| 32 | return ipv4Addr; |
| 33 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 34 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 35 | @JsonProperty("Port") |
| 36 | public int getL4Port() { |
| 37 | return l4Port; |
| 38 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 39 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 40 | @JsonProperty("Reason") |
| 41 | public String getReason() { |
| 42 | return reason; |
| 43 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame^] | 44 | |
| 45 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 46 | } |