Class DeviceServiceAdapter

    • Constructor Detail

      • DeviceServiceAdapter

        public DeviceServiceAdapter​(java.util.List<Port> portList)
        Constructor with port list.
        Parameters:
        portList - port list
      • DeviceServiceAdapter

        public DeviceServiceAdapter()
        Default constructor.
    • Method Detail

      • getDeviceCount

        public int getDeviceCount()
        Description copied from interface: DeviceService
        Returns the number of infrastructure devices known to the system.
        Specified by:
        getDeviceCount in interface DeviceService
        Returns:
        number of infrastructure devices
      • getAvailableDeviceCount

        public int getAvailableDeviceCount()
        Description copied from interface: DeviceService
        Returns the number of currently available devices known to the system.
        Specified by:
        getAvailableDeviceCount in interface DeviceService
        Returns:
        number of available devices
      • getDevices

        public java.lang.Iterable<Device> getDevices()
        Description copied from interface: DeviceService
        Returns a collection of the currently known infrastructure devices.
        Specified by:
        getDevices in interface DeviceService
        Returns:
        collection of devices
      • getAvailableDevices

        public java.lang.Iterable<Device> getAvailableDevices()
        Description copied from interface: DeviceService
        Returns an iterable collection of all devices currently available to the system.
        Specified by:
        getAvailableDevices in interface DeviceService
        Returns:
        device collection
      • getDevice

        public Device getDevice​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Returns the device with the specified identifier.
        Specified by:
        getDevice in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        device or null if one with the given identifier is not known
      • getRole

        public MastershipRole getRole​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Returns the current mastership role for the specified device.
        Specified by:
        getRole in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        designated mastership role
      • getPorts

        public java.util.List<Port> getPorts​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Returns the list of ports associated with the device.
        Specified by:
        getPorts in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        list of ports
      • getPortStatistics

        public java.util.List<PortStatistics> getPortStatistics​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Returns the list of port statistics associated with the device.
        Specified by:
        getPortStatistics in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        list of port statistics
      • getPortDeltaStatistics

        public java.util.List<PortStatistics> getPortDeltaStatistics​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Returns the list of port delta statistics associated with the device.
        Specified by:
        getPortDeltaStatistics in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        list of port statistics
      • getStatisticsForPort

        public PortStatistics getStatisticsForPort​(DeviceId deviceId,
                                                   PortNumber portNumber)
        Description copied from interface: DeviceService
        Returns the port specific port statistics associated with the device and port.
        Specified by:
        getStatisticsForPort in interface DeviceService
        Parameters:
        deviceId - device identifier
        portNumber - port identifier
        Returns:
        port statistics of specified port
      • getDeltaStatisticsForPort

        public PortStatistics getDeltaStatisticsForPort​(DeviceId deviceId,
                                                        PortNumber portNumber)
        Description copied from interface: DeviceService
        Returns the port specific port delta statistics associated with the device and port.
        Specified by:
        getDeltaStatisticsForPort in interface DeviceService
        Parameters:
        deviceId - device identifier
        portNumber - port identifier
        Returns:
        port delta statistics of specified port
      • getPort

        public Port getPort​(DeviceId deviceId,
                            PortNumber portNumber)
        Description copied from interface: DeviceService
        Returns the port with the specified number and hosted by the given device.
        Specified by:
        getPort in interface DeviceService
        Parameters:
        deviceId - device identifier
        portNumber - port number
        Returns:
        device port
      • isAvailable

        public boolean isAvailable​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Indicates whether or not the device is presently online and available. Availability, unlike reachability, denotes whether ANY node in the cluster can discover that this device is in an operational state, this does not necessarily mean that there exists a node that can control this device.
        Specified by:
        isAvailable in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        true if the device is available
      • getDevices

        public java.lang.Iterable<Device> getDevices​(Device.Type type)
        Description copied from interface: DeviceService
        Returns a collection of the currently known infrastructure devices by device type.
        Specified by:
        getDevices in interface DeviceService
        Parameters:
        type - device type
        Returns:
        collection of devices
      • getAvailableDevices

        public java.lang.Iterable<Device> getAvailableDevices​(Device.Type type)
        Description copied from interface: DeviceService
        Returns an iterable collection of all devices currently available to the system by device type.
        Specified by:
        getAvailableDevices in interface DeviceService
        Parameters:
        type - device type
        Returns:
        device collection
      • localStatus

        public java.lang.String localStatus​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Indicates how long ago the device connected or disconnected from this controller instance.
        Specified by:
        localStatus in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        a human readable string indicating the time since the device connected-to or disconnected-from this controller instance.
      • getLastUpdatedInstant

        public long getLastUpdatedInstant​(DeviceId deviceId)
        Description copied from interface: DeviceService
        Indicates the time at which the given device connected or disconnected from this controller instance.
        Specified by:
        getLastUpdatedInstant in interface DeviceService
        Parameters:
        deviceId - device identifier
        Returns:
        time offset in miliseconds from Epoch