public final class BasicLinkConfig extends AllowedEntityConfig<LinkKey>
Config.FieldPresence| Modifier and Type | Field and Description |
|---|---|
static String |
BANDWIDTH |
static String |
IS_DURABLE |
static String |
LATENCY |
static String |
METRIC |
static String |
TYPE |
ALLOWED| Constructor and Description |
|---|
BasicLinkConfig() |
| Modifier and Type | Method and Description |
|---|---|
long |
bandwidth()
Returns link bandwidth in terms of Mbps.
|
BasicLinkConfig |
bandwidth(Long bandwidth)
Sets the link bandwidth.
|
Boolean |
isDurable()
Returns if link is durable in the network model or not.
|
BasicLinkConfig |
isDurable(Boolean isDurable)
Sets durability for this link.
|
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, 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, key, node, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subjectpublic 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 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 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 otherwise