Class HostAnnotationConfig
- java.lang.Object
- 
- org.onosproject.net.config.Config<S>
- 
- org.onosproject.net.config.BaseConfig<HostId>
- 
- org.onosproject.net.config.basics.HostAnnotationConfig
 
 
 
- 
- All Implemented Interfaces:
- CodecContext
 
 public class HostAnnotationConfig extends BaseConfig<HostId> Configuration to add extra annotations to a host 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 forHostAnnotationConfig.
 - 
Constructor SummaryConstructors Constructor Description HostAnnotationConfig()Create a detachedHostAnnotationConfig.HostAnnotationConfig(HostId hostId)Create a detachedHostAnnotationConfigfor specified host.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HostAnnotationConfigannotation(java.lang.String key)Remove configuration about specified key.HostAnnotationConfigannotation(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 Host.HostAnnotationConfigannotations(java.util.Map<java.lang.String,java.lang.String> replace)Sets annotations to add to a Host.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 forHostAnnotationConfig.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
HostAnnotationConfigpublic HostAnnotationConfig() Create a detachedHostAnnotationConfig.Note: created instance needs to be initialized by #init(..) before using. 
 - 
HostAnnotationConfigpublic HostAnnotationConfig(HostId hostId) Create a detachedHostAnnotationConfigfor specified host.Note: created instance is not bound to NetworkConfigService, thus cannot use Config.apply(). Must be passed to the service using NetworkConfigService#applyConfig- Parameters:
- hostId- Host 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 Host.- Returns:
- annotations as a map. null value represent key removal request
 
 - 
annotationspublic HostAnnotationConfig annotations(java.util.Map<java.lang.String,java.lang.String> replace) Sets annotations to add to a Host.- Parameters:
- replace- annotations to be added by this configuration. null value represent key removal request
- Returns:
- self
 
 - 
annotationpublic HostAnnotationConfig 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 HostAnnotationConfig annotation(java.lang.String key) Remove configuration about specified key.- Parameters:
- key- annotations key
- Returns:
- self
 
 
- 
 
-