Package org.onosproject.net.host
Interface HostStore
-
- All Superinterfaces:
Store<HostEvent,HostStoreDelegate>
public interface HostStore extends Store<HostEvent,HostStoreDelegate>
Manages inventory of end-station hosts; not intended for direct use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default MacAddress
addPendingHostLocation(HostId hostId, ConnectPoint connectPoint, ProbeMode probeMode)
Notifies HostStore the beginning of pending host location verification and retrieves the unique MAC address for the probe.void
appendLocation(HostId hostId, HostLocation location)
Append the specified location to the host entry.HostEvent
createOrUpdateHost(ProviderId providerId, HostId hostId, HostDescription hostDescription, boolean replaceIps)
Creates a new host or updates the existing one based on the specified description.Set<Host>
getConnectedHosts(ConnectPoint connectPoint)
Returns the set of hosts that attach to the specified connection point.default Set<Host>
getConnectedHosts(ConnectPoint connectPoint, boolean matchAuxLocations)
Returns the set of host that attach to the specified connect point.Set<Host>
getConnectedHosts(DeviceId deviceId)
Returns the set of hosts that attach to the specified device.Host
getHost(HostId hostId)
Returns the host with the specified identifer.int
getHostCount()
Returns the number of hosts in the store.Iterable<Host>
getHosts()
Returns a collection of all hosts in the store.Set<Host>
getHosts(IpAddress ip)
Returns the set of hosts with the specified IP address.Set<Host>
getHosts(MacAddress mac)
Returns the set of hosts with the specified MAC address.Set<Host>
getHosts(VlanId vlanId)
Returns the set of all hosts within the specified VLAN.HostEvent
removeHost(HostId hostId)
Removes the specified host from the inventory.HostEvent
removeIp(HostId hostId, IpAddress ipAddress)
Removes the specified ip from the host entry.void
removeLocation(HostId hostId, HostLocation location)
Removes the specified location from the host entry.default void
removePendingHostLocation(MacAddress probeMac)
Notifies HostStore the end of pending host location verification.default void
suspend(HostId id)
Update the host to suspended state to true denotes host is in suspended state.default void
unsuspend(HostId id)
Update the host suspended state to false denotes host is in unsuspended state.-
Methods inherited from interface org.onosproject.store.Store
hasDelegate, setDelegate, unsetDelegate
-
-
-
-
Method Detail
-
createOrUpdateHost
HostEvent createOrUpdateHost(ProviderId providerId, HostId hostId, HostDescription hostDescription, boolean replaceIps)
Creates a new host or updates the existing one based on the specified description.- Parameters:
providerId
- provider identificationhostId
- host identificationhostDescription
- host description datareplaceIps
- replace IP set if true, merge IP set otherwise- Returns:
- appropriate event or null if no change resulted
-
removeHost
HostEvent removeHost(HostId hostId)
Removes the specified host from the inventory.- Parameters:
hostId
- host identification- Returns:
- remove event or null if host was not found
-
removeIp
HostEvent removeIp(HostId hostId, IpAddress ipAddress)
Removes the specified ip from the host entry.- Parameters:
hostId
- host identificationipAddress
- ipAddress to be removed- Returns:
- remove event or null if host was not found
-
appendLocation
void appendLocation(HostId hostId, HostLocation location)
Append the specified location to the host entry.- Parameters:
hostId
- host identificationlocation
- location to be added
-
removeLocation
void removeLocation(HostId hostId, HostLocation location)
Removes the specified location from the host entry.- Parameters:
hostId
- host identificationlocation
- location to be removed
-
getHostCount
int getHostCount()
Returns the number of hosts in the store.- Returns:
- host count
-
getHosts
Iterable<Host> getHosts()
Returns a collection of all hosts in the store.- Returns:
- iterable collection of all hosts
-
getHost
Host getHost(HostId hostId)
Returns the host with the specified identifer.- Parameters:
hostId
- host identification- Returns:
- host or null if not found
-
getHosts
Set<Host> getHosts(VlanId vlanId)
Returns the set of all hosts within the specified VLAN.- Parameters:
vlanId
- vlan id- Returns:
- set of hosts in the vlan
-
getHosts
Set<Host> getHosts(MacAddress mac)
Returns the set of hosts with the specified MAC address.- Parameters:
mac
- mac address- Returns:
- set of hosts with the given mac
-
getHosts
Set<Host> getHosts(IpAddress ip)
Returns the set of hosts with the specified IP address.- Parameters:
ip
- ip address- Returns:
- set of hosts with the given IP
-
getConnectedHosts
Set<Host> getConnectedHosts(ConnectPoint connectPoint)
Returns the set of hosts that attach to the specified connection point.- Parameters:
connectPoint
- connection point- Returns:
- set of hosts
-
getConnectedHosts
default Set<Host> getConnectedHosts(ConnectPoint connectPoint, boolean matchAuxLocations)
Returns the set of host that attach to the specified connect point.- Parameters:
connectPoint
- connect pointmatchAuxLocations
- true to match on the auxLocations, false to match on locations of the hosts- Returns:
- set of hosts connected to the connection point
-
getConnectedHosts
Set<Host> getConnectedHosts(DeviceId deviceId)
Returns the set of hosts that attach to the specified device.- Parameters:
deviceId
- infrastructure device identifier- Returns:
- set of hosts
-
addPendingHostLocation
default MacAddress addPendingHostLocation(HostId hostId, ConnectPoint connectPoint, ProbeMode probeMode)
Notifies HostStore the beginning of pending host location verification and retrieves the unique MAC address for the probe.- Parameters:
hostId
- ID of the hostconnectPoint
- the connect point that is under verificationprobeMode
- probe mode- Returns:
- probeMac, the source MAC address ONOS uses to probe the host
-
removePendingHostLocation
default void removePendingHostLocation(MacAddress probeMac)
Notifies HostStore the end of pending host location verification.- Parameters:
probeMac
- the source MAC address ONOS uses to probe the host
-
suspend
default void suspend(HostId id)
Update the host to suspended state to true denotes host is in suspended state.- Parameters:
id
- ID of the host
-
unsuspend
default void unsuspend(HostId id)
Update the host suspended state to false denotes host is in unsuspended state.- Parameters:
id
- ID of the host
-
-