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.java.lang.String
driver()
Returns the device driver name.BasicDeviceConfig
driver(java.lang.String driverName)
Sets the driver name.java.lang.String
hwVersion()
Returns the device hardware version.BasicDeviceConfig
hwVersion(java.lang.String hwVersion)
Sets the device hardware version.boolean
isValid()
Indicates whether or not the backing JSON node contains valid data.java.lang.String
managementAddress()
Returns the device management address (e.g, "ip:port" or full URI string).BasicDeviceConfig
managementAddress(java.lang.String managementAddress)
Sets the device management ip (ip:port).java.lang.String
manufacturer()
Returns the device manufacturer.BasicDeviceConfig
manufacturer(java.lang.String manufacturerName)
Sets the device manufacturer.java.lang.String
pipeconf()
Returns the device pipeconf.BasicDeviceConfig
pipeconf(java.lang.String pipeconf)
Sets the device pipeconf.java.lang.String
serial()
Returns the device serial number.BasicDeviceConfig
serial(java.lang.String serial)
Sets the device serial number.java.lang.String
swVersion()
Returns the device software version.BasicDeviceConfig
swVersion(java.lang.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 java.lang.String driver()
Returns the device driver name.- Returns:
- driver name or null if not set
-
driver
public BasicDeviceConfig driver(java.lang.String driverName)
Sets the driver name.- Parameters:
driverName
- new driver name; null to clear- Returns:
- self
-
manufacturer
public java.lang.String manufacturer()
Returns the device manufacturer.- Returns:
- manufacturer or null if not set
-
manufacturer
public BasicDeviceConfig manufacturer(java.lang.String manufacturerName)
Sets the device manufacturer.- Parameters:
manufacturerName
- new manufacturer; null to clear- Returns:
- self
-
hwVersion
public java.lang.String hwVersion()
Returns the device hardware version.- Returns:
- hardware version or null if not set
-
hwVersion
public BasicDeviceConfig hwVersion(java.lang.String hwVersion)
Sets the device hardware version.- Parameters:
hwVersion
- new hardware version; null to clear- Returns:
- self
-
swVersion
public java.lang.String swVersion()
Returns the device software version.- Returns:
- software version or null if not set
-
swVersion
public BasicDeviceConfig swVersion(java.lang.String swVersion)
Sets the device software version.- Parameters:
swVersion
- new software version; null to clear- Returns:
- self
-
serial
public java.lang.String serial()
Returns the device serial number.- Returns:
- serial number or null if not set
-
serial
public BasicDeviceConfig serial(java.lang.String serial)
Sets the device serial number.- Parameters:
serial
- new serial number; null to clear- Returns:
- self
-
managementAddress
public java.lang.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 java.lang.String pipeconf()
Returns the device pipeconf.- Returns:
- device pipeconf or null if not set
-
managementAddress
public BasicDeviceConfig managementAddress(java.lang.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(java.lang.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
-
-