Class DeviceRegistry


  • public class DeviceRegistry
    extends Object
    Implements registry of devices deployed within simulated environment Currently can only hold access to the plain references of generators but in the future will be used as accessor to all deployed devices within simulated environment
    • Constructor Detail

      • DeviceRegistry

        public DeviceRegistry()
    • Method Detail

      • putDevice

        public boolean putDevice​(Unit device)
        registers device to registry
        Parameters:
        device - device to be stored
        Returns:
        true if device is not already in registry, false otherwise
      • removeDevice

        public boolean removeDevice​(UUID id)
        Removes device from registry
        Parameters:
        id - uuid of device to be deleted
        Returns:
        true when device was deleted, false otherwise
      • getDevice

        public Unit getDevice​(UUID id)
        Searches for device in registry
        Parameters:
        id - uuid of device in registry
        Returns:
        Unit object if it is found, null otherwise
      • getAllDevices

        public Collection<Unit> getAllDevices()
        Get stream of all devices
        Returns:
        all devices in stream
      • getDevicesByLabel

        public Collection<Unit> getDevicesByLabel​(String label)
        Returns stream of devices with specified label
        Parameters:
        label - searched label
        Returns:
        Units with concrete label