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, Collection<DeviceId> deviceIds)Adds the specified collection of devices to the region.RegioncreateRegion(RegionId regionId, String name, Region.Type type, Annotations annots, List<Set<NodeId>> masterNodeIds)Creates a new region using the supplied data.RegiongetRegion(RegionId regionId)Returns the region with the specified identifier.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.Set<Region>getRegions()Returns set of all regions.voidremoveDevices(RegionId regionId, 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, String name, Region.Type type, Annotations annots, List<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
- 
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 identifiername- friendly nametype- region typeannots- annotationsmasterNodeIds- 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 identifiername- friendly nametype- region typeannots- annotationsmasterNodeIds- 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 identifierdeviceIds- list of device identifiers
 
- 
removeDevices
void removeDevices(RegionId regionId, Collection<DeviceId> deviceIds)
Removes the specified collection of devices from the region.- Parameters:
 regionId- region identifierdeviceIds- list of device identifiers
 
 - 
 
 -