public class ProtectionConfig extends BaseConfig<DeviceId>
Contains equivalent of ProtectedTransportEndpointDescription
.
Config.FieldPresence
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_KEY
"protection" : a netcfg ConfigKey for
ProtectionConfig . |
Constructor and Description |
---|
ProtectionConfig()
Create a
ProtectionConfig . |
ProtectionConfig(DeviceId did)
Create a
ProtectionConfig for specified Device. |
Modifier and Type | Method and Description |
---|---|
ProtectedTransportEndpointDescription |
asDescription()
Returns equivalent of this Config as
ProtectedTransportEndpointDescription . |
java.lang.String |
fingerprint()
Returns fingerprint to identify this protected transport entity.
|
ProtectionConfig |
fingerprint(java.lang.String fingerprint)
Sets the fingerprint to identify this protected transport entity.
|
boolean |
isValid()
Indicates whether or not the backing JSON node contains valid data.
|
java.util.List<TransportEndpointDescription> |
paths()
Returns List of underlying transport entity endpoints in priority order.
|
ProtectionConfig |
paths(java.util.List<TransportEndpointDescription> paths)
Sets the List of underlying transport entity endpoints in priority order.
|
DeviceId |
peer()
Returns DeviceId of remote peer of this endpoint.
|
ProtectionConfig |
peer(DeviceId peer)
Sets the DeviceId of remote peer of this endpoint.
|
java.lang.String |
toString() |
codec, decode, getService, mapper
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
decode, encode
public static final java.lang.String CONFIG_KEY
ProtectionConfig
.public ProtectionConfig()
ProtectionConfig
.
Note: created instance needs to be initialized by #init(..) before using.
public ProtectionConfig(DeviceId did)
ProtectionConfig
for specified Device.
Note: created instance is not bound to NetworkConfigService,
cannot use Config.apply()
. Must be passed to the service
using NetworkConfigService#applyConfig
did
- DeviceIdpublic boolean isValid()
Config
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.
public java.util.List<TransportEndpointDescription> paths()
public ProtectionConfig paths(java.util.List<TransportEndpointDescription> paths)
paths
- the transport entity endpoint descriptionspublic DeviceId peer()
public ProtectionConfig peer(DeviceId peer)
peer
- DeviceIdpublic java.lang.String fingerprint()
public ProtectionConfig fingerprint(java.lang.String fingerprint)
fingerprint
- the fingerprintpublic ProtectedTransportEndpointDescription asDescription()
ProtectedTransportEndpointDescription
.