@Beta public class InterfaceConfig extends Config<ConnectPoint>
Config.FieldPresence
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IPS |
static java.lang.String |
MAC |
static java.lang.String |
NAME |
static java.lang.String |
VLAN |
static java.lang.String |
VLAN_NATIVE |
static java.lang.String |
VLAN_TAGGED |
static java.lang.String |
VLAN_UNTAGGED |
Constructor and Description |
---|
InterfaceConfig() |
Modifier and Type | Method and Description |
---|---|
void |
addInterface(Interface intf)
Adds an interface to the config.
|
java.util.Set<Interface> |
getInterfaces()
Retrieves all interfaces configured on this port.
|
boolean |
isValid()
Indicates whether or not the backing JSON node contains valid data.
|
void |
removeInterface(java.lang.String name)
Removes an interface from the 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
public static final java.lang.String NAME
public static final java.lang.String IPS
public static final java.lang.String MAC
public static final java.lang.String VLAN
public static final java.lang.String VLAN_UNTAGGED
public static final java.lang.String VLAN_TAGGED
public static final java.lang.String VLAN_NATIVE
public boolean isValid()
Config
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.
isValid
in class Config<ConnectPoint>
public java.util.Set<Interface> getInterfaces() throws ConfigException
ConfigException
- if there is any error in the JSON configpublic void addInterface(Interface intf)
intf
- interface to addpublic void removeInterface(java.lang.String name)
name
- name of the interface to remove