Package org.onosproject.net.host
Interface HostService
-
- All Superinterfaces:
ListenerService<HostEvent,HostListener>
- All Known Subinterfaces:
HostAdminService
public interface HostService extends ListenerService<HostEvent,HostListener>
Service for interacting with the inventory of end-station hosts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<Host>getConnectedHosts(ConnectPoint connectPoint)Returns the set of hosts whose most recent location is the specified connection point.java.util.Set<Host>getConnectedHosts(DeviceId deviceId)Returns the set of hosts whose most recent location is the specified infrastructure device.HostgetHost(HostId hostId)Returns the host with the specified identifier.intgetHostCount()Returns the number of end-station hosts known to the system.java.lang.Iterable<Host>getHosts()Returns a collection of all end-station hosts.java.util.Set<Host>getHostsByIp(org.onlab.packet.IpAddress ip)Returns the set of hosts that have the specified IP address.java.util.Set<Host>getHostsByMac(org.onlab.packet.MacAddress mac)Returns the set of hosts that have the specified MAC address.java.util.Set<Host>getHostsByVlan(org.onlab.packet.VlanId vlanId)Returns the set of hosts that belong to the specified VLAN.voidrequestMac(org.onlab.packet.IpAddress ip)Requests the host service to resolve the MAC address for the given IP address.voidstartMonitoringIp(org.onlab.packet.IpAddress ip)Requests the host service to monitor hosts with the given IP address and notify listeners of changes.voidstopMonitoringIp(org.onlab.packet.IpAddress ip)Stops the host service from monitoring an IP address.-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
getHostCount
int getHostCount()
Returns the number of end-station hosts known to the system.- Returns:
- number of end-station hosts
-
getHosts
java.lang.Iterable<Host> getHosts()
Returns a collection of all end-station hosts.- Returns:
- collection of hosts
-
getHost
Host getHost(HostId hostId)
Returns the host with the specified identifier.- Parameters:
hostId- host identifier- Returns:
- host or null if one with the given identifier is not known
-
getHostsByVlan
java.util.Set<Host> getHostsByVlan(org.onlab.packet.VlanId vlanId)
Returns the set of hosts that belong to the specified VLAN.- Parameters:
vlanId- vlan identifier- Returns:
- set of hosts in the given vlan id
-
getHostsByMac
java.util.Set<Host> getHostsByMac(org.onlab.packet.MacAddress mac)
Returns the set of hosts that have the specified MAC address.- Parameters:
mac- mac address- Returns:
- set of hosts with the given mac
-
getHostsByIp
java.util.Set<Host> getHostsByIp(org.onlab.packet.IpAddress ip)
Returns the set of hosts that have the specified IP address.- Parameters:
ip- ip address- Returns:
- set of hosts with the given IP
-
getConnectedHosts
java.util.Set<Host> getConnectedHosts(ConnectPoint connectPoint)
Returns the set of hosts whose most recent location is the specified connection point.- Parameters:
connectPoint- connection point- Returns:
- set of hosts connected to the connection point
-
getConnectedHosts
java.util.Set<Host> getConnectedHosts(DeviceId deviceId)
Returns the set of hosts whose most recent location is the specified infrastructure device.- Parameters:
deviceId- device identifier- Returns:
- set of hosts connected to the device
-
startMonitoringIp
void startMonitoringIp(org.onlab.packet.IpAddress ip)
Requests the host service to monitor hosts with the given IP address and notify listeners of changes.- Parameters:
ip- IP address of the host to monitor
-
stopMonitoringIp
void stopMonitoringIp(org.onlab.packet.IpAddress ip)
Stops the host service from monitoring an IP address.- Parameters:
ip- IP address to stop monitoring
-
requestMac
void requestMac(org.onlab.packet.IpAddress ip)
Requests the host service to resolve the MAC address for the given IP address. This will trigger a notification to the host listeners if the MAC address is found.- Parameters:
ip- IP address to find the MAC address for
-
-