Class BasicRegionConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<S>
-
- org.onosproject.net.config.basics.AllowedEntityConfig<S>
-
- org.onosproject.net.config.basics.BasicElementConfig<RegionId>
-
- org.onosproject.net.config.basics.BasicRegionConfig
-
public final class BasicRegionConfig extends BasicElementConfig<RegionId>
Basic configuration for network regions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.config.Config
Config.FieldPresence
-
-
Field Summary
-
Fields inherited from class org.onosproject.net.config.basics.BasicElementConfig
GRID_X, GRID_Y, LATITUDE, LOC_TYPE_GEO, LOC_TYPE_GRID, LOC_TYPE_NONE, LONGITUDE, NAME, OWNER, RACK_ADDRESS, ROLES, UI_TYPE, ZERO_THRESHOLD
-
Fields inherited from class org.onosproject.net.config.basics.AllowedEntityConfig
ALLOWED
-
-
Constructor Summary
Constructors Constructor Description BasicRegionConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasicRegionConfig
addPeerLocMapping(java.lang.String peerId, java.lang.String locType, java.lang.Double latOrY, java.lang.Double longOrX)
Adds a peer location mapping to this region.java.util.List<DeviceId>
devices()
Returns the identities of the devices in this region.BasicRegionConfig
devices(java.util.Set<DeviceId> devices)
Sets the devices of this region.java.util.List<LayoutLocation>
getMappings()
Returns the list of layout location mappings for where peer region nodes should be placed on the layout when viewing this region.boolean
isValid()
Indicates whether or not the backing JSON node contains valid data.java.lang.String
toString()
Region.Type
type()
Returns the region type.BasicRegionConfig
type(Region.Type type)
Sets the region type.-
Methods inherited from class org.onosproject.net.config.basics.BasicElementConfig
geoCoordsSet, gridCoordsSet, gridX, gridX, gridY, gridY, latitude, latitude, locType, locType, longitude, longitude, name, name, owner, owner, rackAddress, rackAddress, roles, roles, uiType, uiType
-
Methods inherited from class org.onosproject.net.config.basics.AllowedEntityConfig
isAllowed, isAllowed
-
Methods inherited from class org.onosproject.net.config.Config
apply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject
-
-
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from class:Config
Indicates whether or not the backing JSON node contains valid data.Default implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.
- Overrides:
isValid
in classBasicElementConfig<RegionId>
- Returns:
- true if the data is valid; false otherwise
-
type
public Region.Type type()
Returns the region type.- Returns:
- the region type
-
type
public BasicRegionConfig type(Region.Type type)
Sets the region type.- Parameters:
type
- the region type, or null to unset- Returns:
- the config of the region
-
devices
public java.util.List<DeviceId> devices()
Returns the identities of the devices in this region.- Returns:
- list of device identifiers
-
devices
public BasicRegionConfig devices(java.util.Set<DeviceId> devices)
Sets the devices of this region.- Parameters:
devices
- the device identifiers, or null to unset- Returns:
- the config of the region
-
addPeerLocMapping
public BasicRegionConfig addPeerLocMapping(java.lang.String peerId, java.lang.String locType, java.lang.Double latOrY, java.lang.Double longOrX)
Adds a peer location mapping to this region.- Parameters:
peerId
- the region ID of the peerlocType
- the type of location (geo/grid)latOrY
- geo latitude / grid y-coordlongOrX
- geo longitude / grid x-coord- Returns:
- self
-
getMappings
public java.util.List<LayoutLocation> getMappings()
Returns the list of layout location mappings for where peer region nodes should be placed on the layout when viewing this region.- Returns:
- list of peer node locations
-
-