Class ProtectionConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<S>
-
- org.onosproject.net.config.BaseConfig<DeviceId>
-
- org.onosproject.net.behaviour.protection.ProtectionConfig
-
- All Implemented Interfaces:
CodecContext
public class ProtectionConfig extends BaseConfig<DeviceId>
Config object for protection end-point.Contains equivalent of
ProtectedTransportEndpointDescription
.
-
-
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 java.lang.String
CONFIG_KEY
"protection" : a netcfg ConfigKey forProtectionConfig
.
-
Constructor Summary
Constructors Constructor Description ProtectionConfig()
Create aProtectionConfig
.ProtectionConfig(DeviceId did)
Create aProtectionConfig
for specified Device.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtectedTransportEndpointDescription
asDescription()
Returns equivalent of this Config asProtectedTransportEndpointDescription
.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()
-
Methods inherited from class org.onosproject.net.config.BaseConfig
codec, decode, getService, mapper
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.codec.CodecContext
decode, encode
-
-
-
-
Field Detail
-
CONFIG_KEY
public static final java.lang.String CONFIG_KEY
"protection" : a netcfg ConfigKey forProtectionConfig
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProtectionConfig
public ProtectionConfig()
Create aProtectionConfig
.Note: created instance needs to be initialized by #init(..) before using.
-
ProtectionConfig
public ProtectionConfig(DeviceId did)
Create aProtectionConfig
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:
did
- DeviceId
-
-
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.
-
paths
public java.util.List<TransportEndpointDescription> paths()
Returns List of underlying transport entity endpoints in priority order.- Returns:
- the transport entity endpoint descriptions
-
paths
public ProtectionConfig paths(java.util.List<TransportEndpointDescription> paths)
Sets the List of underlying transport entity endpoints in priority order.- Parameters:
paths
- the transport entity endpoint descriptions- Returns:
- self
-
peer
public DeviceId peer()
Returns DeviceId of remote peer of this endpoint.- Returns:
- the peer
-
peer
public ProtectionConfig peer(DeviceId peer)
Sets the DeviceId of remote peer of this endpoint.- Parameters:
peer
- DeviceId- Returns:
- self
-
fingerprint
public java.lang.String fingerprint()
Returns fingerprint to identify this protected transport entity.- Returns:
- the fingerprint
-
fingerprint
public ProtectionConfig fingerprint(java.lang.String fingerprint)
Sets the fingerprint to identify this protected transport entity.- Parameters:
fingerprint
- the fingerprint- Returns:
- self
-
asDescription
public ProtectedTransportEndpointDescription asDescription()
Returns equivalent of this Config asProtectedTransportEndpointDescription
.
-
-