Interface DeviceStore

    • 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 identifier
        deviceId - device identifier
        deviceDescription - 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 identifier
        deviceId - device identifier
        portDescriptions - 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 identifier
        deviceId - device identifier
        portDescription - 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 identifier
        deviceId - 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 identifier
        deviceId - device identifier
        portStats - 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 identifier
        portNumber - 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 identifier
        portNumber - 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 identifier
        portNumber - port number
        Returns:
        device port
      • getPortDescription

        PortDescription getPortDescription​(ProviderId providerId,
                                           DeviceId deviceId,
                                           PortNumber portNumber)
        Returns the specified device port description.
        Parameters:
        providerId - provider identifier
        deviceId - device identifier
        portNumber - port number
        Returns:
        device port description
      • 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