Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.topology; |
| 2 | |
| 3 | import java.util.Collection; |
| 4 | |
| 5 | import net.floodlightcontroller.util.MACAddress; |
| 6 | import net.onrc.onos.core.util.Dpid; |
| 7 | import net.onrc.onos.core.util.LinkTuple; |
Yuta HIGUCHI | 45ccade | 2014-08-18 17:09:19 -0700 | [diff] [blame] | 8 | import net.onrc.onos.core.util.PortNumber; |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 9 | import net.onrc.onos.core.util.SwitchPort; |
| 10 | |
Yuta HIGUCHI | d92b10c | 2014-08-25 09:30:28 -0700 | [diff] [blame] | 11 | // FIXME This Class hierarchy is wrong. |
| 12 | // - We need BaseTopology + access to self-contained *Event objects. |
| 13 | // abstract class implementing BaseTopology? |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 14 | /** |
| 15 | * Interface to reference internal self-contained elements. |
| 16 | */ |
Yuta HIGUCHI | d92b10c | 2014-08-25 09:30:28 -0700 | [diff] [blame] | 17 | public interface TopologyInternal extends MutableTopology { |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 18 | /** |
| 19 | * Gets a SwitchEvent. |
| 20 | * |
| 21 | * @param dpid Switch DPID |
| 22 | * @return the SwitchEvent for the Switch DPID if found, otherwise null |
| 23 | */ |
| 24 | public SwitchEvent getSwitchEvent(Dpid dpid); |
| 25 | |
| 26 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 27 | * Gets all SwitchEvent entries. |
| 28 | * |
| 29 | * @return all SwitchEvent entries. |
| 30 | */ |
| 31 | public Collection<SwitchEvent> getAllSwitchEvents(); |
| 32 | |
| 33 | /** |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 34 | * Gets a PortEvent. |
| 35 | * |
| 36 | * @param port Port identifier |
| 37 | * @return the PortEvent for the Port identifier if found, otherwise null |
| 38 | */ |
| 39 | public PortEvent getPortEvent(SwitchPort port); |
| 40 | |
| 41 | /** |
Yuta HIGUCHI | 45ccade | 2014-08-18 17:09:19 -0700 | [diff] [blame] | 42 | * Gets a PortEvent. |
| 43 | * |
| 44 | * @param dpid Switch DPID |
| 45 | * @param portNumber Port number |
| 46 | * @return the PortEvent for the (Dpid, PortNumber) if found, otherwise null |
| 47 | */ |
| 48 | public PortEvent getPortEvent(Dpid dpid, PortNumber portNumber); |
| 49 | |
| 50 | /** |
| 51 | * Gets all the PortEvents on a switch. |
| 52 | * |
| 53 | * @param dpid Switch DPID |
| 54 | * @return PortEvents |
| 55 | */ |
| 56 | public Collection<PortEvent> getPortEvents(Dpid dpid); |
| 57 | |
| 58 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 59 | * Gets all PortEvent entries. |
| 60 | * |
| 61 | * @return all PortEvent entries. |
| 62 | */ |
| 63 | public Collection<PortEvent> getAllPortEvents(); |
| 64 | |
| 65 | /** |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 66 | * Gets a LinkEvent. |
| 67 | * |
| 68 | * @param linkId Link identifier |
| 69 | * @return the LinkEvent for the Link identifier if found, otherwise null |
| 70 | */ |
| 71 | public LinkEvent getLinkEvent(LinkTuple linkId); |
| 72 | |
| 73 | /** |
| 74 | * Gets a LinkEvent. |
| 75 | * |
| 76 | * @param linkId Link identifier |
| 77 | * @param type type |
| 78 | * @return the LinkEvent for the Link identifier and type if found, otherwise null |
| 79 | */ |
| 80 | public LinkEvent getLinkEvent(final LinkTuple linkId, final String type); |
| 81 | |
| 82 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 83 | * Gets a collection of LinkEvent entries. |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 84 | * |
| 85 | * @param linkId Link identifier |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 86 | * @return Collection of LinkEvent entries. |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 87 | */ |
| 88 | public Collection<LinkEvent> getLinkEvents(LinkTuple linkId); |
| 89 | |
| 90 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 91 | * Gets all LinkEvent entries. |
| 92 | * |
| 93 | * @return all LinkEvent entries. |
| 94 | */ |
| 95 | public Collection<LinkEvent> getAllLinkEvents(); |
| 96 | |
| 97 | /** |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 98 | * Gets a HostEvent. |
| 99 | * |
| 100 | * @param mac MACAddress of the host |
| 101 | * @return the HostEvent for the MACAddress if found, otherwise null |
| 102 | */ |
| 103 | public HostEvent getHostEvent(MACAddress mac); |
| 104 | |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 105 | /** |
| 106 | * Gets all HostEvent entries. |
| 107 | * |
| 108 | * @return all HostEvent entries. |
| 109 | */ |
| 110 | public Collection<HostEvent> getAllHostEvents(); |
Yuta HIGUCHI | 8b389a7 | 2014-07-18 13:50:00 -0700 | [diff] [blame] | 111 | } |