Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.linkdiscovery.internal; |
| 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 | |
| 9 | /*** |
| 10 | * Topology Switch event history related classes and members |
| 11 | * @author subrata |
| 12 | * |
| 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) |
| 18 | public long dpid; |
| 19 | public int ipv4Addr; |
| 20 | public int l4Port; |
| 21 | public String reason; |
| 22 | |
| 23 | @JsonProperty("Switch") |
| 24 | @JsonSerialize(using=DPIDSerializer.class) |
| 25 | public long getDpid() { |
| 26 | return dpid; |
| 27 | } |
| 28 | @JsonProperty("IpAddr") |
| 29 | @JsonSerialize(using=IPv4Serializer.class) |
| 30 | public int getIpv4Addr() { |
| 31 | return ipv4Addr; |
| 32 | } |
| 33 | @JsonProperty("Port") |
| 34 | public int getL4Port() { |
| 35 | return l4Port; |
| 36 | } |
| 37 | @JsonProperty("Reason") |
| 38 | public String getReason() { |
| 39 | return reason; |
| 40 | } |
| 41 | |
| 42 | |
| 43 | } |