Interface RegionStore

    • Method Detail

      • getRegions

        Set<Region> getRegions()
        Returns set of all regions.
        Returns:
        set of regions
      • getRegion

        Region getRegion​(RegionId regionId)
        Returns the region with the specified identifier.
        Parameters:
        regionId - region identifier
        Returns:
        region
        Throws:
        ItemNotFoundException - if region with given id does not exist
      • getRegionForDevice

        Region getRegionForDevice​(DeviceId deviceId)
        Returns the region to which the specified device belongs.
        Parameters:
        deviceId - device identifier
        Returns:
        region or null if device does not belong to any region
      • getRegionDevices

        Set<DeviceId> getRegionDevices​(RegionId regionId)
        Returns the set of devices that belong to the specified region.
        Parameters:
        regionId - region identifier
        Returns:
        set of identifiers for devices in the given region
      • createRegion

        Region createRegion​(RegionId regionId,
                            String name,
                            Region.Type type,
                            Annotations annots,
                            List<Set<NodeId>> masterNodeIds)
        Creates a new region using the supplied data.
        Parameters:
        regionId - region identifier
        name - friendly name
        type - region type
        annots - annotations
        masterNodeIds - list of master nodes; null implies empty list
        Returns:
        new region descriptor
        Throws:
        IllegalArgumentException - if item already exists
      • updateRegion

        Region updateRegion​(RegionId regionId,
                            String name,
                            Region.Type type,
                            Annotations annots,
                            List<Set<NodeId>> masterNodeIds)
        Updates the specified new region using the supplied data.
        Parameters:
        regionId - region identifier
        name - friendly name
        type - region type
        annots - annotations
        masterNodeIds - list of master nodes; null implies empty list
        Returns:
        new region descriptor
        Throws:
        IllegalArgumentException - if item already exists
      • removeRegion

        void removeRegion​(RegionId regionId)
        Removes the specified region using the new set of data.
        Parameters:
        regionId - region identifier
      • addDevices

        void addDevices​(RegionId regionId,
                        Collection<DeviceId> deviceIds)
        Adds the specified collection of devices to the region.
        Parameters:
        regionId - region identifier
        deviceIds - list of device identifiers
      • removeDevices

        void removeDevices​(RegionId regionId,
                           Collection<DeviceId> deviceIds)
        Removes the specified collection of devices from the region.
        Parameters:
        regionId - region identifier
        deviceIds - list of device identifiers