Class DeviceAnnotationConfig
- java.lang.Object
- 
- org.onosproject.net.config.Config<S>
- 
- org.onosproject.net.config.BaseConfig<DeviceId>
- 
- org.onosproject.net.config.basics.DeviceAnnotationConfig
 
 
 
- 
- All Implemented Interfaces:
- CodecContext
 
 public class DeviceAnnotationConfig extends BaseConfig<DeviceId> Configuration to add extra annotations to a device via netcfg subsystem.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.onosproject.net.config.ConfigConfig.FieldPresence
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringCONFIG_KEY"annotations" : a netcfg ConfigKey forDeviceAnnotationConfig.
 - 
Constructor SummaryConstructors Constructor Description DeviceAnnotationConfig()Create a detachedDeviceAnnotationConfig.DeviceAnnotationConfig(DeviceId deviceId)Create a detachedDeviceAnnotationConfigfor specified device.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description DeviceAnnotationConfigannotation(java.lang.String key)Remove configuration about specified key.DeviceAnnotationConfigannotation(java.lang.String key, java.lang.String value)Add configuration to set or remove annotation entry.java.util.Map<java.lang.String,java.lang.String>annotations()Returns annotations to add to a Device.DeviceAnnotationConfigannotations(java.util.Map<java.lang.String,java.lang.String> replace)Sets annotations to add to a Device.booleanisValid()Indicates whether or not the backing JSON node contains valid data.- 
Methods inherited from class org.onosproject.net.config.BaseConfigcodec, decode, getService, mapper
 - 
Methods inherited from class org.onosproject.net.config.Configapply, 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
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.onosproject.codec.CodecContextdecode, encode
 
- 
 
- 
- 
- 
Field Detail- 
CONFIG_KEYpublic static final java.lang.String CONFIG_KEY "annotations" : a netcfg ConfigKey forDeviceAnnotationConfig.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
DeviceAnnotationConfigpublic DeviceAnnotationConfig() Create a detachedDeviceAnnotationConfig.Note: created instance needs to be initialized by #init(..) before using. 
 - 
DeviceAnnotationConfigpublic DeviceAnnotationConfig(DeviceId deviceId) Create a detachedDeviceAnnotationConfigfor specified device.Note: created instance is not bound to NetworkConfigService, thus cannot use Config.apply(). Must be passed to the service using NetworkConfigService#applyConfig- Parameters:
- deviceId- Device id
 
 
- 
 - 
Method Detail- 
isValidpublic boolean isValid() Description copied from class:ConfigIndicates 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. 
 - 
annotationspublic java.util.Map<java.lang.String,java.lang.String> annotations() Returns annotations to add to a Device.- Returns:
- annotations as a map. null value represent key removal request
 
 - 
annotationspublic DeviceAnnotationConfig annotations(java.util.Map<java.lang.String,java.lang.String> replace) Sets annotations to add to a Device.- Parameters:
- replace- annotations to be added by this configuration. null value represent key removal request
- Returns:
- self
 
 - 
annotationpublic DeviceAnnotationConfig annotation(java.lang.String key, java.lang.String value) Add configuration to set or remove annotation entry.- Parameters:
- key- annotations key
- value- annotations value. specifying null removes the entry.
- Returns:
- self
 
 - 
annotationpublic DeviceAnnotationConfig annotation(java.lang.String key) Remove configuration about specified key.- Parameters:
- key- annotations key
- Returns:
- self
 
 
- 
 
-