Class BasicDeviceConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<S>
-
- org.onosproject.net.config.basics.AllowedEntityConfig<S>
-
- org.onosproject.net.config.basics.BasicElementConfig<DeviceId>
-
- org.onosproject.net.config.basics.BasicDeviceConfig
-
public final class BasicDeviceConfig extends BasicElementConfig<DeviceId>
Basic configuration for network infrastructure devices.
-
-
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, 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 BasicDeviceConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeviceKeyId
deviceKeyId()
Returns the device key id.BasicDeviceConfig
deviceKeyId(DeviceKeyId deviceKeyId)
Sets the device key id.String
driver()
Returns the device driver name.BasicDeviceConfig
driver(String driverName)
Sets the driver name.String
hwVersion()
Returns the device hardware version.BasicDeviceConfig
hwVersion(String hwVersion)
Sets the device hardware version.boolean
isPurgeOnDisconnectionConfigured()
Returns if the device purgeOnDisconnection flag for this device has been explicitly configured.boolean
isValid()
Indicates whether or not the backing JSON node contains valid data.String
managementAddress()
Returns the device management address (e.g, "ip:port" or full URI string).BasicDeviceConfig
managementAddress(String managementAddress)
Sets the device management ip (ip:port).String
manufacturer()
Returns the device manufacturer.BasicDeviceConfig
manufacturer(String manufacturerName)
Sets the device manufacturer.String
pipeconf()
Returns the device pipeconf.BasicDeviceConfig
pipeconf(String pipeconf)
Sets the device pipeconf.boolean
purgeOnDisconnection()
Returns the device purgeOnDisconnection flag for this device.BasicDeviceConfig
purgeOnDisconnection(boolean purgeOnDisconnection)
Sets the purgeOnDisconnection flag for the device.String
serial()
Returns the device serial number.BasicDeviceConfig
serial(String serial)
Sets the device serial number.String
swVersion()
Returns the device software version.BasicDeviceConfig
swVersion(String swVersion)
Sets the device software version.Device.Type
type()
Returns the device type.BasicDeviceConfig
type(Device.Type type)
Sets the device 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, toString
-
-
-
-
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<DeviceId>
- Returns:
- true if the data is valid; false otherwise
-
type
public Device.Type type()
Returns the device type.- Returns:
- device type override
-
type
public BasicDeviceConfig type(Device.Type type)
Sets the device type.- Parameters:
type
- device type override- Returns:
- self
-
driver
public String driver()
Returns the device driver name.- Returns:
- driver name or null if not set
-
driver
public BasicDeviceConfig driver(String driverName)
Sets the driver name.- Parameters:
driverName
- new driver name; null to clear- Returns:
- self
-
manufacturer
public String manufacturer()
Returns the device manufacturer.- Returns:
- manufacturer or null if not set
-
manufacturer
public BasicDeviceConfig manufacturer(String manufacturerName)
Sets the device manufacturer.- Parameters:
manufacturerName
- new manufacturer; null to clear- Returns:
- self
-
hwVersion
public String hwVersion()
Returns the device hardware version.- Returns:
- hardware version or null if not set
-
hwVersion
public BasicDeviceConfig hwVersion(String hwVersion)
Sets the device hardware version.- Parameters:
hwVersion
- new hardware version; null to clear- Returns:
- self
-
swVersion
public String swVersion()
Returns the device software version.- Returns:
- software version or null if not set
-
swVersion
public BasicDeviceConfig swVersion(String swVersion)
Sets the device software version.- Parameters:
swVersion
- new software version; null to clear- Returns:
- self
-
serial
public String serial()
Returns the device serial number.- Returns:
- serial number or null if not set
-
serial
public BasicDeviceConfig serial(String serial)
Sets the device serial number.- Parameters:
serial
- new serial number; null to clear- Returns:
- self
-
managementAddress
public String managementAddress()
Returns the device management address (e.g, "ip:port" or full URI string).- Returns:
- device management address or null if not set
-
pipeconf
public String pipeconf()
Returns the device pipeconf.- Returns:
- device pipeconf or null if not set
-
managementAddress
public BasicDeviceConfig managementAddress(String managementAddress)
Sets the device management ip (ip:port).- Parameters:
managementAddress
- new device management address (ip:port); null to clear- Returns:
- self
-
pipeconf
public BasicDeviceConfig pipeconf(String pipeconf)
Sets the device pipeconf.- Parameters:
pipeconf
- new device pipeconf- Returns:
- self
-
deviceKeyId
public DeviceKeyId deviceKeyId()
Returns the device key id.- Returns:
- device key id or null if not set
-
deviceKeyId
public BasicDeviceConfig deviceKeyId(DeviceKeyId deviceKeyId)
Sets the device key id.- Parameters:
deviceKeyId
- the new device key id; null to clear- Returns:
- self
-
purgeOnDisconnection
public boolean purgeOnDisconnection()
Returns the device purgeOnDisconnection flag for this device.- Returns:
- device purgeOnDisconnection, false if not set.
-
purgeOnDisconnection
public BasicDeviceConfig purgeOnDisconnection(boolean purgeOnDisconnection)
Sets the purgeOnDisconnection flag for the device.- Parameters:
purgeOnDisconnection
- purges flows, groups, meters on disconnection.- Returns:
- self
-
isPurgeOnDisconnectionConfigured
public boolean isPurgeOnDisconnectionConfigured()
Returns if the device purgeOnDisconnection flag for this device has been explicitly configured.- Returns:
- device purgeOnDisconnection explicitly configured, false if not.
-
-