Class InterfaceConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<ConnectPoint>
-
- org.onosproject.net.config.basics.InterfaceConfig
-
@Beta public class InterfaceConfig extends Config<ConnectPoint>
Configuration for interfaces.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.config.Config
Config.FieldPresence
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description InterfaceConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
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
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
IPS
public static final java.lang.String IPS
- See Also:
- Constant Field Values
-
MAC
public static final java.lang.String MAC
- See Also:
- Constant Field Values
-
VLAN
public static final java.lang.String VLAN
- See Also:
- Constant Field Values
-
VLAN_UNTAGGED
public static final java.lang.String VLAN_UNTAGGED
- See Also:
- Constant Field Values
-
VLAN_TAGGED
public static final java.lang.String VLAN_TAGGED
- See Also:
- Constant Field Values
-
VLAN_NATIVE
public static final java.lang.String VLAN_NATIVE
- See Also:
- Constant Field Values
-
-
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 classConfig<ConnectPoint>
- Returns:
- true if the data is valid; false otherwise
-
getInterfaces
public java.util.Set<Interface> getInterfaces() throws ConfigException
Retrieves all interfaces configured on this port.- Returns:
- set of interfaces
- Throws:
ConfigException
- if there is any error in the JSON config
-
addInterface
public void addInterface(Interface intf)
Adds an interface to the config.- Parameters:
intf
- interface to add
-
removeInterface
public void removeInterface(java.lang.String name)
Removes an interface from the config.- Parameters:
name
- name of the interface to remove
-
-