tom | 5bcc946 | 2014-09-19 10:11:31 -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.Host; |
| 6 | import org.onlab.onos.net.HostId; |
| 7 | import org.onlab.onos.net.provider.ProviderId; |
Ayaka Koshibe | 1d56fe4 | 2014-09-19 16:51:58 -0700 | [diff] [blame] | 8 | import org.onlab.packet.IpPrefix; |
tom | 5bcc946 | 2014-09-19 10:11:31 -0700 | [diff] [blame] | 9 | import org.onlab.packet.MacAddress; |
| 10 | import org.onlab.packet.VlanId; |
| 11 | |
| 12 | import java.util.Set; |
| 13 | |
| 14 | /** |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame^] | 15 | * Manages inventory of end-station hosts; not intended for direct use. |
tom | 5bcc946 | 2014-09-19 10:11:31 -0700 | [diff] [blame] | 16 | */ |
| 17 | public interface HostStore { |
| 18 | |
| 19 | /** |
| 20 | * Creates a new host or updates the existing one based on the specified |
| 21 | * description. |
| 22 | * |
| 23 | * @param providerId provider identification |
| 24 | * @param hostId host identification |
| 25 | * @param hostDescription host description data |
| 26 | * @return appropriate event or null if no change resulted |
| 27 | */ |
| 28 | HostEvent createOrUpdateHost(ProviderId providerId, HostId hostId, |
| 29 | HostDescription hostDescription); |
| 30 | |
| 31 | /** |
| 32 | * Removes the specified host from the inventory. |
| 33 | * |
| 34 | * @param hostId host identification |
| 35 | * @return remove event or null if host was not found |
| 36 | */ |
| 37 | HostEvent removeHost(HostId hostId); |
| 38 | |
| 39 | /** |
| 40 | * Returns the number of hosts in the store. |
| 41 | * |
| 42 | * @return host count |
| 43 | */ |
| 44 | int getHostCount(); |
| 45 | |
| 46 | /** |
| 47 | * Returns a collection of all hosts in the store. |
| 48 | * |
| 49 | * @return iterable collection of all hosts |
| 50 | */ |
| 51 | Iterable<Host> getHosts(); |
| 52 | |
| 53 | /** |
| 54 | * Returns the host with the specified identifer. |
| 55 | * |
| 56 | * @param hostId host identification |
| 57 | * @return host or null if not found |
| 58 | */ |
| 59 | Host getHost(HostId hostId); |
| 60 | |
| 61 | /** |
| 62 | * Returns the set of all hosts within the specified VLAN. |
| 63 | * |
| 64 | * @param vlanId vlan id |
| 65 | * @return set of hosts in the vlan |
| 66 | */ |
| 67 | Set<Host> getHosts(VlanId vlanId); |
| 68 | |
| 69 | /** |
| 70 | * Returns the set of hosts with the specified MAC address. |
| 71 | * |
| 72 | * @param mac mac address |
| 73 | * @return set of hosts with the given mac |
| 74 | */ |
| 75 | Set<Host> getHosts(MacAddress mac); |
| 76 | |
| 77 | /** |
| 78 | * Returns the set of hosts with the specified IP address. |
| 79 | * |
| 80 | * @param ip ip address |
| 81 | * @return set of hosts with the given IP |
| 82 | */ |
Ayaka Koshibe | 1d56fe4 | 2014-09-19 16:51:58 -0700 | [diff] [blame] | 83 | Set<Host> getHosts(IpPrefix ip); |
tom | 5bcc946 | 2014-09-19 10:11:31 -0700 | [diff] [blame] | 84 | |
| 85 | /** |
| 86 | * Returns the set of hosts whose location falls on the given connection point. |
| 87 | * |
| 88 | * @param connectPoint connection point |
| 89 | * @return set of hosts |
| 90 | */ |
| 91 | Set<Host> getConnectedHosts(ConnectPoint connectPoint); |
| 92 | |
| 93 | /** |
| 94 | * Returns the set of hosts whose location falls on the given device. |
| 95 | * |
| 96 | * @param deviceId infrastructure device identifier |
| 97 | * @return set of hosts |
| 98 | */ |
| 99 | Set<Host> getConnectedHosts(DeviceId deviceId); |
| 100 | |
| 101 | } |