Package org.onosproject.net.region
Interface RegionStore
-
- All Superinterfaces:
Store<RegionEvent,RegionStoreDelegate>
public interface RegionStore extends Store<RegionEvent,RegionStoreDelegate>
Manages inventory of regions of devices; not intended for direct use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDevices(RegionId regionId, java.util.Collection<DeviceId> deviceIds)Adds the specified collection of devices to the region.RegioncreateRegion(RegionId regionId, java.lang.String name, Region.Type type, Annotations annots, java.util.List<java.util.Set<NodeId>> masterNodeIds)Creates a new region using the supplied data.RegiongetRegion(RegionId regionId)Returns the region with the specified identifier.java.util.Set<DeviceId>getRegionDevices(RegionId regionId)Returns the set of devices that belong to the specified region.RegiongetRegionForDevice(DeviceId deviceId)Returns the region to which the specified device belongs.java.util.Set<Region>getRegions()Returns set of all regions.voidremoveDevices(RegionId regionId, java.util.Collection<DeviceId> deviceIds)Removes the specified collection of devices from the region.voidremoveRegion(RegionId regionId)Removes the specified region using the new set of data.RegionupdateRegion(RegionId regionId, java.lang.String name, Region.Type type, Annotations annots, java.util.List<java.util.Set<NodeId>> masterNodeIds)Updates the specified new region using the supplied data.-
Methods inherited from interface org.onosproject.store.Store
hasDelegate, setDelegate, unsetDelegate
-
-
-
-
Method Detail
-
getRegions
java.util.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
java.util.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, java.lang.String name, Region.Type type, Annotations annots, java.util.List<java.util.Set<NodeId>> masterNodeIds)
Creates a new region using the supplied data.- Parameters:
regionId- region identifiername- friendly nametype- region typeannots- annotationsmasterNodeIds- list of master nodes; null implies empty list- Returns:
- new region descriptor
- Throws:
java.lang.IllegalArgumentException- if item already exists
-
updateRegion
Region updateRegion(RegionId regionId, java.lang.String name, Region.Type type, Annotations annots, java.util.List<java.util.Set<NodeId>> masterNodeIds)
Updates the specified new region using the supplied data.- Parameters:
regionId- region identifiername- friendly nametype- region typeannots- annotationsmasterNodeIds- list of master nodes; null implies empty list- Returns:
- new region descriptor
- Throws:
java.lang.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, java.util.Collection<DeviceId> deviceIds)
Adds the specified collection of devices to the region.- Parameters:
regionId- region identifierdeviceIds- list of device identifiers
-
-