Package org.onosproject.net.device
Interface DeviceStore
-
- All Superinterfaces:
Store<DeviceEvent,DeviceStoreDelegate>
public interface DeviceStore extends Store<DeviceEvent,DeviceStoreDelegate>
Manages inventory of infrastructure devices; not intended for direct use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DeviceEvent
createOrUpdateDevice(ProviderId providerId, DeviceId deviceId, DeviceDescription deviceDescription)
Creates a new infrastructure device, or updates an existing one using the supplied device description.int
getAvailableDeviceCount()
Returns the number of currently available devices known to the system.Iterable<Device>
getAvailableDevices()
Returns an iterable collection of all devices currently available to the system.default PortStatistics
getDeltaStatisticsForPort(DeviceId deviceId, PortNumber portNumber)
Returns the port delta statistics of the specified device and port.Device
getDevice(DeviceId deviceId)
Returns the device with the specified identifier.int
getDeviceCount()
Returns the number of devices known to the system.default DeviceDescription
getDeviceDescription(ProviderId providerId, DeviceId deviceId)
Returns the specified device description.Iterable<Device>
getDevices()
Returns an iterable collection of all devices known to the system.Port
getPort(DeviceId deviceId, PortNumber portNumber)
Returns the specified device port.List<PortStatistics>
getPortDeltaStatistics(DeviceId deviceId)
Returns the list of delta port statistics of the specified device.PortDescription
getPortDescription(ProviderId providerId, DeviceId deviceId, PortNumber portNumber)
Returns the specified device port description.Stream<PortDescription>
getPortDescriptions(ProviderId providerId, DeviceId deviceId)
Returns the stream of port descriptions that belong to the specified device.List<Port>
getPorts(DeviceId deviceId)
Returns the list of ports that belong to the specified device.List<PortStatistics>
getPortStatistics(DeviceId deviceId)
Returns the list of port statistics of the specified device.default PortStatistics
getStatisticsForPort(DeviceId deviceId, PortNumber portNumber)
Returns the port statistics of the specified device and port.boolean
isAvailable(DeviceId deviceId)
Indicates whether the specified device is available/online.DeviceEvent
markOffline(DeviceId deviceId)
Removes the specified infrastructure device.DeviceEvent
markOnline(DeviceId deviceId)
Marks the device as available.DeviceEvent
removeDevice(DeviceId deviceId)
Administratively removes the specified device from the store.List<DeviceEvent>
updatePorts(ProviderId providerId, DeviceId deviceId, List<PortDescription> portDescriptions)
Updates the ports of the specified infrastructure device using the given list of port descriptions.DeviceEvent
updatePortStatistics(ProviderId providerId, DeviceId deviceId, Collection<PortStatistics> portStats)
Updates the port statistics of the specified device using the give port statistics.DeviceEvent
updatePortStatus(ProviderId providerId, DeviceId deviceId, PortDescription portDescription)
Updates the port status of the specified infrastructure device using the given port description.-
Methods inherited from interface org.onosproject.store.Store
hasDelegate, setDelegate, unsetDelegate
-
-
-
-
Method Detail
-
getDeviceCount
int getDeviceCount()
Returns the number of devices known to the system.- Returns:
- number of devices
-
getAvailableDeviceCount
int getAvailableDeviceCount()
Returns the number of currently available devices known to the system.- Returns:
- number of devices
-
getDevices
Iterable<Device> getDevices()
Returns an iterable collection of all devices known to the system.- Returns:
- device collection
-
getAvailableDevices
Iterable<Device> getAvailableDevices()
Returns an iterable collection of all devices currently available to the system.- Returns:
- device collection
-
getDevice
Device getDevice(DeviceId deviceId)
Returns the device with the specified identifier.- Parameters:
deviceId
- device identifier- Returns:
- device
-
createOrUpdateDevice
DeviceEvent createOrUpdateDevice(ProviderId providerId, DeviceId deviceId, DeviceDescription deviceDescription)
Creates a new infrastructure device, or updates an existing one using the supplied device description.- Parameters:
providerId
- provider identifierdeviceId
- device identifierdeviceDescription
- device description- Returns:
- ready to send event describing what occurred; null if no change
-
markOffline
DeviceEvent markOffline(DeviceId deviceId)
Removes the specified infrastructure device.- Parameters:
deviceId
- device identifier- Returns:
- ready to send event describing what occurred; null if no change
-
markOnline
DeviceEvent markOnline(DeviceId deviceId)
Marks the device as available.- Parameters:
deviceId
- device identifier- Returns:
- ready to send event describing what occurred; null if no change
-
updatePorts
List<DeviceEvent> updatePorts(ProviderId providerId, DeviceId deviceId, List<PortDescription> portDescriptions)
Updates the ports of the specified infrastructure device using the given list of port descriptions. The list is assumed to be comprehensive.- Parameters:
providerId
- provider identifierdeviceId
- device identifierportDescriptions
- list of port descriptions- Returns:
- ready to send events describing what occurred; empty list if no change
-
updatePortStatus
DeviceEvent updatePortStatus(ProviderId providerId, DeviceId deviceId, PortDescription portDescription)
Updates the port status of the specified infrastructure device using the given port description.- Parameters:
providerId
- provider identifierdeviceId
- device identifierportDescription
- port description- Returns:
- ready to send event describing what occurred; null if no change
-
getPorts
List<Port> getPorts(DeviceId deviceId)
Returns the list of ports that belong to the specified device.- Parameters:
deviceId
- device identifier- Returns:
- list of device ports
-
getPortDescriptions
Stream<PortDescription> getPortDescriptions(ProviderId providerId, DeviceId deviceId)
Returns the stream of port descriptions that belong to the specified device.- Parameters:
providerId
- provider identifierdeviceId
- device identifier- Returns:
- stream of device portdescriptions
-
updatePortStatistics
DeviceEvent updatePortStatistics(ProviderId providerId, DeviceId deviceId, Collection<PortStatistics> portStats)
Updates the port statistics of the specified device using the give port statistics.- Parameters:
providerId
- provider identifierdeviceId
- device identifierportStats
- list of port statistics- Returns:
- ready to send event describing what occurred;
-
getPortStatistics
List<PortStatistics> getPortStatistics(DeviceId deviceId)
Returns the list of port statistics of the specified device.- Parameters:
deviceId
- device identifier- Returns:
- list of port statistics of all ports of the device
-
getStatisticsForPort
default PortStatistics getStatisticsForPort(DeviceId deviceId, PortNumber portNumber)
Returns the port statistics of the specified device and port.- Parameters:
deviceId
- device identifierportNumber
- port identifier- Returns:
- port statistics of specific port of the device
-
getPortDeltaStatistics
List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId)
Returns the list of delta port statistics of the specified device.- Parameters:
deviceId
- device identifier- Returns:
- list of delta port statistics of all ports of the device
-
getDeltaStatisticsForPort
default PortStatistics getDeltaStatisticsForPort(DeviceId deviceId, PortNumber portNumber)
Returns the port delta statistics of the specified device and port.- Parameters:
deviceId
- device identifierportNumber
- port identifier- Returns:
- port statistics of specific port of the device
-
getPort
Port getPort(DeviceId deviceId, PortNumber portNumber)
Returns the specified device port.- Parameters:
deviceId
- device identifierportNumber
- port number- Returns:
- device port
-
getPortDescription
PortDescription getPortDescription(ProviderId providerId, DeviceId deviceId, PortNumber portNumber)
Returns the specified device port description.- Parameters:
providerId
- provider identifierdeviceId
- device identifierportNumber
- port number- Returns:
- device port description
-
getDeviceDescription
default DeviceDescription getDeviceDescription(ProviderId providerId, DeviceId deviceId)
Returns the specified device description.- Parameters:
providerId
- provider identifierdeviceId
- device identifier- Returns:
- device description or null if not present
-
isAvailable
boolean isAvailable(DeviceId deviceId)
Indicates whether the specified device is available/online.- Parameters:
deviceId
- device identifier- Returns:
- true if device is available
-
removeDevice
DeviceEvent removeDevice(DeviceId deviceId)
Administratively removes the specified device from the store.- Parameters:
deviceId
- device to be removed- Returns:
- null if no such device, or was forwarded to remove master
-
-