public final class BasicLinkConfig extends AllowedEntityConfig<LinkKey>
Config.FieldPresence| Modifier and Type | Field and Description | 
|---|---|
static String | 
BANDWIDTH  | 
static String | 
CONFIG_KEY
Configuration key for  
DeviceInjectionConfig. | 
static String | 
IS_BIDIRECTIONAL  | 
static String | 
IS_DURABLE  | 
static String | 
LATENCY  | 
static String | 
METRIC  | 
static String | 
TYPE  | 
ALLOWED| Constructor and Description | 
|---|
BasicLinkConfig()
Create a  
BasicLinkConfig instance. | 
BasicLinkConfig(LinkKey linkKey)
Create a  
BasicLinkConfig for specified Device. | 
| Modifier and Type | Method and Description | 
|---|---|
long | 
bandwidth()
Returns link bandwidth in terms of Mbps. 
 | 
BasicLinkConfig | 
bandwidth(Long bandwidth)
Sets the link bandwidth. 
 | 
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 | 
isTypeConfigured()
Returns if the link type is configured. 
 | 
boolean | 
isValid()
Indicates whether or not the backing JSON node contains valid data. 
 | 
Duration | 
latency()
Returns link latency in terms of nanos. 
 | 
BasicLinkConfig | 
latency(Duration latency)
Sets the link latency. 
 | 
double | 
metric()
Returns link metric value for use by
  
MetricLinkWeight function. | 
BasicLinkConfig | 
metric(Double metric)
Sets the link metric for use by
  
MetricLinkWeight function. | 
Link.Type | 
type()
Returns the link type. 
 | 
BasicLinkConfig | 
type(Link.Type type)
Sets the link type. 
 | 
isAllowed, isAllowedapply, 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, toStringpublic static final String CONFIG_KEY
DeviceInjectionConfig.public static final String TYPE
public static final String METRIC
public static final String LATENCY
public static final String BANDWIDTH
public static final String IS_DURABLE
public static final String IS_BIDIRECTIONAL
public BasicLinkConfig(LinkKey linkKey)
BasicLinkConfig for specified Device.
 
 Note: created instance is not bound to NetworkConfigService,
 cannot use Config.apply(). Must be passed to the service
 using NetworkConfigService#applyConfig
linkKey - subject of this Configpublic BasicLinkConfig()
BasicLinkConfig instance.
 Note: created instance needs to be initialized by #init(..) before using.
public 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 boolean isTypeConfigured()
public Link.Type type()
public BasicLinkConfig type(Link.Type type)
type - link type overridepublic double metric()
MetricLinkWeight function.public BasicLinkConfig metric(Double metric)
MetricLinkWeight function.metric - new metric; null to clearpublic Duration latency()
public BasicLinkConfig latency(Duration latency)
latency - new latency; null to clearpublic long bandwidth()
public BasicLinkConfig bandwidth(Long bandwidth)
bandwidth - new bandwidth; null to clearpublic Boolean isDurable()
public BasicLinkConfig isDurable(Boolean isDurable)
isDurable - true for durable, false otherwisepublic boolean isBidirectional()
public BasicLinkConfig isBidirectional(Boolean isBidirectional)
isBidirectional - true for directional, false otherwise