public final class BasicHostConfig extends BasicElementConfig<HostId>
Config.FieldPresence
GRID_X, GRID_Y, LATITUDE, LOC_TYPE, LOC_TYPE_GEO, LOC_TYPE_GRID, LOC_TYPE_NONE, LONGITUDE, NAME, OWNER, RACK_ADDRESS, ROLES, UI_TYPE, ZERO_THRESHOLD
ALLOWED
Constructor and Description |
---|
BasicHostConfig() |
Modifier and Type | Method and Description |
---|---|
VlanId |
innerVlan() |
Set<IpAddress> |
ipAddresses()
Returns IP addresses of the host.
|
boolean |
isValid()
Indicates whether or not the backing JSON node contains valid data.
|
Set<HostLocation> |
locations()
Returns the location of the host.
|
String |
name()
Returns friendly label for the element.
|
EthType |
outerTpid() |
BasicHostConfig |
setInnerVlan(VlanId vlanId) |
BasicHostConfig |
setIps(Set<IpAddress> ipAddresses)
Sets the IP addresses of the host.
|
BasicHostConfig |
setLocations(Set<HostLocation> locations)
Sets the location of the host.
|
BasicHostConfig |
setOuterTpid(EthType tpid) |
geoCoordsSet, gridCoordsSet, gridX, gridX, gridY, gridY, latitude, latitude, locType, locType, longitude, longitude, name, owner, owner, rackAddress, rackAddress, roles, roles, uiType, uiType
isAllowed, isAllowed
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, toString
public boolean isValid()
Config
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.
isValid
in class BasicElementConfig<HostId>
public String name()
BasicElementConfig
name
in class BasicElementConfig<HostId>
public Set<HostLocation> locations()
IllegalArgumentException
- if locations are set but empty or not
specified with correct formatpublic BasicHostConfig setLocations(Set<HostLocation> locations)
locations
- location of the host or null to unsetpublic Set<IpAddress> ipAddresses()
IllegalArgumentException
- if not specified with correct formatpublic BasicHostConfig setIps(Set<IpAddress> ipAddresses)
ipAddresses
- IP addresses of the host or null to unsetpublic VlanId innerVlan()
public BasicHostConfig setInnerVlan(VlanId vlanId)
public EthType outerTpid()
public BasicHostConfig setOuterTpid(EthType tpid)