blob: 456f176217c66e5fede4c6193d81e7aa8f23bc6b [file] [log] [blame]
Jonathan Hart23701d12014-04-03 10:45:48 -07001package net.onrc.onos.core.linkdiscovery.internal;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08002
3import net.floodlightcontroller.core.web.serializers.DPIDSerializer;
4import net.floodlightcontroller.core.web.serializers.IPv4Serializer;
5
6import org.codehaus.jackson.annotate.JsonProperty;
7import org.codehaus.jackson.map.annotate.JsonSerialize;
8
Ray Milkey269ffb92014-04-03 14:43:30 -07009/**
Ray Milkeyb41100a2014-04-10 10:42:15 -070010 * Topology Switch event history related classes and members.
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080011 *
Ray Milkey269ffb92014-04-03 14:43:30 -070012 * @author subrata
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080013 */
14public class EventHistoryTopologySwitch {
15 // The following fields are not stored as String to save memory
Ray Milkey5d406012014-04-08 14:44:41 -070016 // They should be converted to appropriate human-readable strings by
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080017 // the front end (e.g. in cli in Python)
Ray Milkey269ffb92014-04-03 14:43:30 -070018 public long dpid;
19 public int ipv4Addr;
20 public int l4Port;
21 public String reason;
22
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080023 @JsonProperty("Switch")
Ray Milkey269ffb92014-04-03 14:43:30 -070024 @JsonSerialize(using = DPIDSerializer.class)
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080025 public long getDpid() {
26 return dpid;
27 }
Ray Milkey269ffb92014-04-03 14:43:30 -070028
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080029 @JsonProperty("IpAddr")
Ray Milkey269ffb92014-04-03 14:43:30 -070030 @JsonSerialize(using = IPv4Serializer.class)
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080031 public int getIpv4Addr() {
32 return ipv4Addr;
33 }
Ray Milkey269ffb92014-04-03 14:43:30 -070034
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080035 @JsonProperty("Port")
36 public int getL4Port() {
37 return l4Port;
38 }
Ray Milkey269ffb92014-04-03 14:43:30 -070039
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080040 @JsonProperty("Reason")
41 public String getReason() {
42 return reason;
43 }
Ray Milkey269ffb92014-04-03 14:43:30 -070044
45
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080046}