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 StringAVAILABILITYstatic StringBANDWIDTHstatic StringCONFIG_KEYConfiguration key forDeviceInjectionConfig.static StringDELAYstatic StringFLAPPINGstatic StringIS_BIDIRECTIONALstatic StringIS_DURABLEstatic StringIS_METEREDstatic StringJITTERstatic StringLATENCYstatic StringLOSSstatic StringMETERED_USAGEstatic StringMETRICstatic StringTIERstatic StringTYPE-
Fields inherited from class org.onosproject.net.config.basics.AllowedEntityConfig
ALLOWED
-
-
Constructor Summary
Constructors Constructor Description BasicLinkConfig()Create aBasicLinkConfiginstance.BasicLinkConfig(LinkKey linkKey)Create aBasicLinkConfigfor specified Device.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleavailability()Returns link availability in terms of percentage.BasicLinkConfigavailability(Double availability)Sets the link availability.longbandwidth()Returns link bandwidth in terms of Mbps.BasicLinkConfigbandwidth(Long bandwidth)Sets the link bandwidth.doubledelay()Returns link delay in terms of seconds.BasicLinkConfigdelay(Double delay)Sets the link delay.doubleflapping()Returns link flapping in terms of percentage.BasicLinkConfigflapping(Double flapping)Sets the link flapping.booleanisBidirectional()Returns if link is bidirectional in the network model or not.BasicLinkConfigisBidirectional(Boolean isBidirectional)Sets durability for this link.BooleanisDurable()Returns if link is durable in the network model or not.BasicLinkConfigisDurable(Boolean isDurable)Sets durability for this link.BooleanisMetered()Returns if link is metered in the network model or not.BasicLinkConfigisMetered(Boolean isMetered)Sets metered flag for this link.booleanisTypeConfigured()Returns if the link type is configured.booleanisValid()Indicates whether or not the backing JSON node contains valid data.doublejitter()Returns link jitter in terms of seconds.BasicLinkConfigjitter(Double jitter)Sets the link jitter.Durationlatency()Returns link latency in terms of nanos.BasicLinkConfiglatency(Duration latency)Sets the link latency.doubleloss()Returns link loss in terms of Percentage.BasicLinkConfigloss(Double loss)Sets the link loss.doublemeteredUsage()Returns metered link usage in terms of percentage.BasicLinkConfigmeteredUsage(Double meteredUsage)Sets the metered link usage.doublemetric()Returns link metric value for use byMetricLinkWeightfunction.BasicLinkConfigmetric(Double metric)Sets the link metric for use byMetricLinkWeightfunction.longtier()Returns link tier.BasicLinkConfigtier(Long tier)Sets the link tier.Link.Typetype()Returns the link type.BasicLinkConfigtype(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 aBasicLinkConfigfor 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 aBasicLinkConfiginstance.Note: created instance needs to be initialized by #init(..) before using.
-
-
Method Detail
-
isValid
public 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.
-
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 byMetricLinkWeightfunction.- Returns:
- link metric; -1 if not set
-
metric
public BasicLinkConfig metric(Double metric)
Sets the link metric for use byMetricLinkWeightfunction.- 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
-
-