blob: ea316b2347d0b7148a0a1faf5a650259d9ffa4ce [file] [log] [blame]
tom5bcc9462014-09-19 10:11:31 -07001package org.onlab.onos.net.host;
2
3import org.onlab.onos.net.ConnectPoint;
4import org.onlab.onos.net.DeviceId;
5import org.onlab.onos.net.Host;
6import org.onlab.onos.net.HostId;
7import org.onlab.onos.net.provider.ProviderId;
Ayaka Koshibe1d56fe42014-09-19 16:51:58 -07008import org.onlab.packet.IpPrefix;
tom5bcc9462014-09-19 10:11:31 -07009import org.onlab.packet.MacAddress;
10import org.onlab.packet.VlanId;
11
12import java.util.Set;
13
14/**
tome4729872014-09-23 00:37:37 -070015 * Manages inventory of end-station hosts; not intended for direct use.
tom5bcc9462014-09-19 10:11:31 -070016 */
17public 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 Koshibe1d56fe42014-09-19 16:51:58 -070083 Set<Host> getHosts(IpPrefix ip);
tom5bcc9462014-09-19 10:11:31 -070084
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}