tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.host; |
| 2 | |
| 3 | import org.onlab.onos.net.ConnectPoint; |
| 4 | import org.onlab.onos.net.DeviceId; |
| 5 | import org.onlab.onos.net.ElementId; |
| 6 | import org.onlab.onos.net.Host; |
| 7 | |
| 8 | import java.util.Set; |
| 9 | |
| 10 | /** |
| 11 | * Service for interacting with the inventory of end-station hosts. |
| 12 | */ |
| 13 | public interface HostService { |
| 14 | |
| 15 | /** |
| 16 | * Returns a collection of all end-station hosts. |
| 17 | * |
| 18 | * @return collection of hosts |
| 19 | */ |
| 20 | Iterable<Host> getHosts(); |
| 21 | |
| 22 | /** |
| 23 | * Returns the host with the specified identifier. |
| 24 | * |
| 25 | * @param hostId host identifier |
| 26 | * @return host or null if one with the given identifier is not known |
| 27 | */ |
| 28 | Host getHost(ElementId hostId); // TODO: change to HostId |
| 29 | |
| 30 | // TODO: determine which ones make sense or which we care to support |
| 31 | // Set<Host> getHostsByVlan(VlanId vlan); |
| 32 | // Set<Host> getHostsByMac(MacAddress mac); |
| 33 | // Set<Host> getHostsByIp(IpAddress ip); |
| 34 | |
| 35 | /** |
| 36 | * Returns the set of hosts whose most recent location is the specified |
| 37 | * connection point. |
| 38 | * |
| 39 | * @param connectPoint connection point |
| 40 | * @return set of hosts connected to the connection point |
| 41 | */ |
| 42 | Set<Host> getConnectedHosts(ConnectPoint connectPoint); |
| 43 | |
| 44 | /** |
| 45 | * Returns the set of hosts whose most recent location is the specified |
| 46 | * infrastructure device. |
| 47 | * |
| 48 | * @param deviceId device identifier |
| 49 | * @return set of hosts connected to the device |
| 50 | */ |
| 51 | Set<Host> getConnectedHosts(DeviceId deviceId); |
| 52 | |
| 53 | /** |
| 54 | * Adds the specified host listener. |
| 55 | * |
| 56 | * @param listener host listener |
| 57 | */ |
| 58 | void addListener(HostListener listener); |
| 59 | |
| 60 | /** |
| 61 | * Removes the specified host listener. |
| 62 | * |
| 63 | * @param listener host listener |
| 64 | */ |
| 65 | void removeListener(HostListener listener); |
| 66 | |
| 67 | } |