public class HostAnnotationConfig extends BaseConfig<HostId>
Config.FieldPresence| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_KEY
"annotations" : a netcfg ConfigKey for
HostAnnotationConfig. |
| Constructor and Description |
|---|
HostAnnotationConfig()
Create a detached
HostAnnotationConfig. |
HostAnnotationConfig(HostId hostId)
Create a detached
HostAnnotationConfig for specified host. |
| Modifier and Type | Method and Description |
|---|---|
HostAnnotationConfig |
annotation(String key)
Remove configuration about specified key.
|
HostAnnotationConfig |
annotation(String key,
String value)
Add configuration to set or remove annotation entry.
|
Map<String,String> |
annotations()
Returns annotations to add to a Host.
|
HostAnnotationConfig |
annotations(Map<String,String> replace)
Sets annotations to add to a Host.
|
boolean |
isValid()
Indicates whether or not the backing JSON node contains valid data.
|
codec, decode, getService, mapperapply, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdecode, encodepublic static final String CONFIG_KEY
HostAnnotationConfig.public HostAnnotationConfig()
HostAnnotationConfig.
Note: created instance needs to be initialized by #init(..) before using.
public HostAnnotationConfig(HostId hostId)
HostAnnotationConfig for specified host.
Note: created instance is not bound to NetworkConfigService,
thus cannot use Config.apply(). Must be passed to the service
using NetworkConfigService#applyConfig
hostId - Host idpublic boolean isValid()
ConfigDefault implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.
public Map<String,String> annotations()
public HostAnnotationConfig annotations(Map<String,String> replace)
replace - annotations to be added by this configuration.
null value represent key removal requestpublic HostAnnotationConfig annotation(String key, String value)
key - annotations keyvalue - annotations value. specifying null removes the entry.public HostAnnotationConfig annotation(String key)
key - annotations key