Class ReachAttributeParser
- java.lang.Object
-
- org.opendaylight.protocol.bgp.parser.spi.AbstractAttributeParser
-
- org.opendaylight.protocol.bgp.parser.impl.message.update.ReachAttributeParser
-
- All Implemented Interfaces:
AttributeParser
,AttributeSerializer
- Direct Known Subclasses:
MPReachAttributeParser
,MPUnreachAttributeParser
public abstract class ReachAttributeParser extends AbstractAttributeParser implements AttributeSerializer
Abstract base class for reachability attribute parsers,MPReachAttributeParser
andMPUnreachAttributeParser
. These attributes share their RFC7606 handling in that failure to parse them cannot lead to a treat-as-withdraw handling of the message. Individual parser may need access toRevisedErrorHandling
for AFI/SAFI-specific parsing.
-
-
Constructor Summary
Constructors Constructor Description ReachAttributeParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
ignoreDuplicates(RevisedErrorHandling errorHandling)
Determine whether a duplicate attribute should be ignored orBGPError.MALFORMED_ATTR_LIST
should be raised.abstract void
parseAttribute(io.netty.buffer.ByteBuf buffer, AttributesBuilder builder, RevisedErrorHandling errorHandling, PeerSpecificParserConstraint constraint)
Parses attribute from ByteBuf buffer with the specifiedRevisedErrorHandling
.-
Methods inherited from class org.opendaylight.protocol.bgp.parser.spi.AbstractAttributeParser
parseAttribute
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer
serializeAttribute
-
-
-
-
Method Detail
-
ignoreDuplicates
public boolean ignoreDuplicates(RevisedErrorHandling errorHandling)
Description copied from interface:AttributeParser
Determine whether a duplicate attribute should be ignored orBGPError.MALFORMED_ATTR_LIST
should be raised. This is useful for MP_REACH/MP_UNREACH attributes, which need to emit a Notification under RFC7606 rules.- Specified by:
ignoreDuplicates
in interfaceAttributeParser
- Parameters:
errorHandling
- Revised error handling type- Returns:
- True if the duplicate attribute should be ignored, false if a BGPError should be raised.
-
parseAttribute
public abstract void parseAttribute(io.netty.buffer.ByteBuf buffer, AttributesBuilder builder, RevisedErrorHandling errorHandling, PeerSpecificParserConstraint constraint) throws BGPDocumentedException
Description copied from interface:AttributeParser
Parses attribute from ByteBuf buffer with the specifiedRevisedErrorHandling
. Default implementation ignores error handling and defers toAttributeParser.parseAttribute(ByteBuf, AttributesBuilder, PeerSpecificParserConstraint)
.- Specified by:
parseAttribute
in interfaceAttributeParser
- Specified by:
parseAttribute
in classAbstractAttributeParser
- Parameters:
buffer
- Encoded attribute body in ByteBuf.builder
- Path attributes builder. Guaranteed to contain all valid attributes whose type is numerically lower than this attribute's type.errorHandling
- RFC7606 error handling typeconstraint
- Peer specific constraints, may be null- Throws:
BGPDocumentedException
- when an irrecoverable error occurred which has aBGPError
assigned
-
-