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