Class BasicLinkConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<S>
-
- org.onosproject.net.config.basics.AllowedEntityConfig<LinkKey>
-
- org.onosproject.net.config.basics.BasicLinkConfig
-
public final class BasicLinkConfig extends AllowedEntityConfig<LinkKey>
Basic configuration for network infrastructure link.
-
-
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 String
AVAILABILITY
static String
BANDWIDTH
static String
CONFIG_KEY
Configuration key forDeviceInjectionConfig
.static String
DELAY
static String
FLAPPING
static String
IS_BIDIRECTIONAL
static String
IS_DURABLE
static String
IS_METERED
static String
JITTER
static String
LATENCY
static String
LOSS
static String
METERED_USAGE
static String
METRIC
static String
TIER
static String
TYPE
-
Fields inherited from class org.onosproject.net.config.basics.AllowedEntityConfig
ALLOWED
-
-
Constructor Summary
Constructors Constructor Description BasicLinkConfig()
Create aBasicLinkConfig
instance.BasicLinkConfig(LinkKey linkKey)
Create aBasicLinkConfig
for specified Device.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
availability()
Returns link availability in terms of percentage.BasicLinkConfig
availability(Double availability)
Sets the link availability.long
bandwidth()
Returns link bandwidth in terms of Mbps.BasicLinkConfig
bandwidth(Long bandwidth)
Sets the link bandwidth.double
delay()
Returns link delay in terms of seconds.BasicLinkConfig
delay(Double delay)
Sets the link delay.double
flapping()
Returns link flapping in terms of percentage.BasicLinkConfig
flapping(Double flapping)
Sets the link flapping.boolean
isBidirectional()
Returns if link is bidirectional in the network model or not.BasicLinkConfig
isBidirectional(Boolean isBidirectional)
Sets durability for this link.Boolean
isDurable()
Returns if link is durable in the network model or not.BasicLinkConfig
isDurable(Boolean isDurable)
Sets durability for this link.Boolean
isMetered()
Returns if link is metered in the network model or not.BasicLinkConfig
isMetered(Boolean isMetered)
Sets metered flag for this link.boolean
isTypeConfigured()
Returns if the link type is configured.boolean
isValid()
Indicates whether or not the backing JSON node contains valid data.double
jitter()
Returns link jitter in terms of seconds.BasicLinkConfig
jitter(Double jitter)
Sets the link jitter.Duration
latency()
Returns link latency in terms of nanos.BasicLinkConfig
latency(Duration latency)
Sets the link latency.double
loss()
Returns link loss in terms of Percentage.BasicLinkConfig
loss(Double loss)
Sets the link loss.double
meteredUsage()
Returns metered link usage in terms of percentage.BasicLinkConfig
meteredUsage(Double meteredUsage)
Sets the metered link usage.double
metric()
Returns link metric value for use byMetricLinkWeight
function.BasicLinkConfig
metric(Double metric)
Sets the link metric for use byMetricLinkWeight
function.long
tier()
Returns link tier.BasicLinkConfig
tier(Long tier)
Sets the link tier.Link.Type
type()
Returns the link type.BasicLinkConfig
type(Link.Type type)
Sets the link type.-
Methods inherited from class org.onosproject.net.config.basics.AllowedEntityConfig
isAllowed, isAllowed
-
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
-
CONFIG_KEY
public static final String CONFIG_KEY
Configuration key forDeviceInjectionConfig
.- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
METRIC
public static final String METRIC
- See Also:
- Constant Field Values
-
LATENCY
public static final String LATENCY
- See Also:
- Constant Field Values
-
BANDWIDTH
public static final String BANDWIDTH
- See Also:
- Constant Field Values
-
JITTER
public static final String JITTER
- See Also:
- Constant Field Values
-
DELAY
public static final String DELAY
- See Also:
- Constant Field Values
-
LOSS
public static final String LOSS
- See Also:
- Constant Field Values
-
AVAILABILITY
public static final String AVAILABILITY
- See Also:
- Constant Field Values
-
TIER
public static final String TIER
- See Also:
- Constant Field Values
-
METERED_USAGE
public static final String METERED_USAGE
- See Also:
- Constant Field Values
-
FLAPPING
public static final String FLAPPING
- See Also:
- Constant Field Values
-
IS_DURABLE
public static final String IS_DURABLE
- See Also:
- Constant Field Values
-
IS_BIDIRECTIONAL
public static final String IS_BIDIRECTIONAL
- See Also:
- Constant Field Values
-
IS_METERED
public static final String IS_METERED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BasicLinkConfig
public BasicLinkConfig(LinkKey linkKey)
Create aBasicLinkConfig
for specified Device.Note: created instance is not bound to NetworkConfigService, cannot use
Config.apply()
. Must be passed to the service using NetworkConfigService#applyConfig- Parameters:
linkKey
- subject of this Config
-
BasicLinkConfig
public BasicLinkConfig()
Create aBasicLinkConfig
instance.Note: created instance needs to be initialized by #init(..) before using.
-
-
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.
-
isTypeConfigured
public boolean isTypeConfigured()
Returns if the link type is configured.- Returns:
- true if config contains link type
-
type
public Link.Type type()
Returns the link type.- Returns:
- link type override
-
type
public BasicLinkConfig type(Link.Type type)
Sets the link type.- Parameters:
type
- link type override- Returns:
- self
-
metric
public double metric()
Returns link metric value for use byMetricLinkWeight
function.- Returns:
- link metric; -1 if not set
-
metric
public BasicLinkConfig metric(Double metric)
Sets the link metric for use byMetricLinkWeight
function.- Parameters:
metric
- new metric; null to clear- Returns:
- self
-
latency
public Duration latency()
Returns link latency in terms of nanos.- Returns:
- link latency; -1 if not set
-
latency
public BasicLinkConfig latency(Duration latency)
Sets the link latency.- Parameters:
latency
- new latency; null to clear- Returns:
- self
-
bandwidth
public long bandwidth()
Returns link bandwidth in terms of Mbps.- Returns:
- link bandwidth; -1 if not set
-
bandwidth
public BasicLinkConfig bandwidth(Long bandwidth)
Sets the link bandwidth.- Parameters:
bandwidth
- new bandwidth; null to clear- Returns:
- self
-
isDurable
public Boolean isDurable()
Returns if link is durable in the network model or not.- Returns:
- true for durable, false otherwise
-
isDurable
public BasicLinkConfig isDurable(Boolean isDurable)
Sets durability for this link.- Parameters:
isDurable
- true for durable, false otherwise- Returns:
- this BasicLinkConfig
-
isBidirectional
public boolean isBidirectional()
Returns if link is bidirectional in the network model or not.- Returns:
- true for bidirectional, false otherwise
-
isBidirectional
public BasicLinkConfig isBidirectional(Boolean isBidirectional)
Sets durability for this link.- Parameters:
isBidirectional
- true for directional, false otherwise- Returns:
- this BasicLinkConfig
-
jitter
public double jitter()
Returns link jitter in terms of seconds.- Returns:
- link jitter valuer; -1 if not set
-
jitter
public BasicLinkConfig jitter(Double jitter)
Sets the link jitter.- Parameters:
jitter
- new jitter value; null to clear- Returns:
- self
-
delay
public double delay()
Returns link delay in terms of seconds.- Returns:
- link delay value; -1 if not set
-
delay
public BasicLinkConfig delay(Double delay)
Sets the link delay.- Parameters:
delay
- new delay value; null to clear- Returns:
- self
-
loss
public double loss()
Returns link loss in terms of Percentage.- Returns:
- link loss value; -1 if not set
-
loss
public BasicLinkConfig loss(Double loss)
Sets the link loss.- Parameters:
loss
- new loss value; null to clear- Returns:
- self
-
availability
public double availability()
Returns link availability in terms of percentage.- Returns:
- link availability value; -1 if not set
-
availability
public BasicLinkConfig availability(Double availability)
Sets the link availability.- Parameters:
availability
- new availability value; null to clear- Returns:
- self
-
flapping
public double flapping()
Returns link flapping in terms of percentage.- Returns:
- link flapping value; -1 if not set
-
flapping
public BasicLinkConfig flapping(Double flapping)
Sets the link flapping.- Parameters:
flapping
- new flapping value; null to clear- Returns:
- self
-
isMetered
public Boolean isMetered()
Returns if link is metered in the network model or not.- Returns:
- true for metered, false otherwise
-
isMetered
public BasicLinkConfig isMetered(Boolean isMetered)
Sets metered flag for this link.- Parameters:
isMetered
- true for metered, false otherwise- Returns:
- this BasicLinkConfig
-
tier
public long tier()
Returns link tier.- Returns:
- link tier value; -1 if not set
-
tier
public BasicLinkConfig tier(Long tier)
Sets the link tier.- Parameters:
tier
- new link tier value; null to clear- Returns:
- self
-
meteredUsage
public double meteredUsage()
Returns metered link usage in terms of percentage.- Returns:
- metered link usage value; -1 if not set
-
meteredUsage
public BasicLinkConfig meteredUsage(Double meteredUsage)
Sets the metered link usage.- Parameters:
meteredUsage
- new metered usage value; null to clear- Returns:
- self
-
-