Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.networkgraph; |
| 2 | |
Yuta HIGUCHI | dac4caa | 2014-02-11 18:51:35 -0800 | [diff] [blame] | 3 | import java.util.ArrayList; |
| 4 | import java.util.List; |
| 5 | |
Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 6 | /** |
Yuta HIGUCHI | dac4caa | 2014-02-11 18:51:35 -0800 | [diff] [blame] | 7 | * Self-contained Switch and Port event Object |
Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 8 | * |
| 9 | * TODO: We probably want common base class/interface for Self-Contained Event Object |
| 10 | * |
| 11 | */ |
| 12 | public class SwitchEvent { |
| 13 | private final Long dpid; |
| 14 | |
Yuta HIGUCHI | dac4caa | 2014-02-11 18:51:35 -0800 | [diff] [blame] | 15 | private List<PortEvent> ports; |
| 16 | |
Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 17 | public SwitchEvent(Long dpid) { |
Yuta HIGUCHI | dac4caa | 2014-02-11 18:51:35 -0800 | [diff] [blame] | 18 | this(dpid, new ArrayList<PortEvent>()); |
| 19 | } |
| 20 | |
| 21 | public SwitchEvent(Long dpid, List<PortEvent> ports) { |
Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 22 | this.dpid = dpid; |
Yuta HIGUCHI | dac4caa | 2014-02-11 18:51:35 -0800 | [diff] [blame] | 23 | this.ports = ports; |
Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | public Long getDpid() { |
| 27 | return dpid; |
| 28 | } |
| 29 | |
Yuta HIGUCHI | dac4caa | 2014-02-11 18:51:35 -0800 | [diff] [blame] | 30 | public List<PortEvent> getPorts() { |
| 31 | return ports; |
| 32 | } |
| 33 | |
| 34 | public void setPorts(List<PortEvent> ports) { |
| 35 | this.ports = ports; |
| 36 | } |
| 37 | |
Yuta HIGUCHI | 54ab8cd | 2014-02-11 09:43:34 -0800 | [diff] [blame] | 38 | @Override |
| 39 | public String toString() { |
| 40 | return "[SwitchEvent 0x" + Long.toHexString(dpid) + "]"; |
| 41 | } |
| 42 | |
| 43 | } |