Interface AttributeParser

  • All Known Implementing Classes:
    AbstractAttributeParser

    public interface AttributeParser
    Common interface for attribute parser implementation. Implementations should consider deriving from AbstractAttributeParser and provide an RFC7606-compliant interface.
    • Method Detail

      • parseAttribute

        void parseAttribute​(@NonNull io.netty.buffer.ByteBuf buffer,
                            @NonNull org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder builder,
                            @Nullable PeerSpecificParserConstraint constraint)
                     throws org.opendaylight.protocol.bgp.parser.BGPDocumentedException,
                            org.opendaylight.protocol.bgp.parser.BGPParsingException
        Parses attribute from ByteBuf buffer.
        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.
        constraint - Peer specific constraints, may be null
        Throws:
        org.opendaylight.protocol.bgp.parser.BGPDocumentedException - when an irrecoverable error occurred which has a BGPError assigned
        org.opendaylight.protocol.bgp.parser.BGPParsingException - when a general unspecified parsing error occurs.
      • parseAttribute

        default void parseAttribute​(@NonNull io.netty.buffer.ByteBuf buffer,
                                    @NonNull org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder builder,
                                    @NonNull RevisedErrorHandling errorHandling,
                                    @Nullable PeerSpecificParserConstraint constraint)
                             throws org.opendaylight.protocol.bgp.parser.BGPDocumentedException,
                                    org.opendaylight.protocol.bgp.parser.BGPParsingException,
                                    org.opendaylight.protocol.bgp.parser.BGPTreatAsWithdrawException
        Parses attribute from ByteBuf buffer with the specified RevisedErrorHandling. Default implementation ignores error handling and defers to parseAttribute(ByteBuf, AttributesBuilder, PeerSpecificParserConstraint).
        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 type
        constraint - Peer specific constraints, may be null
        Throws:
        org.opendaylight.protocol.bgp.parser.BGPDocumentedException - when an irrecoverable error occurred which has a BGPError assigned
        org.opendaylight.protocol.bgp.parser.BGPParsingException - when a general unspecified parsing error occurs.
        org.opendaylight.protocol.bgp.parser.BGPTreatAsWithdrawException - when parsing according to revised error handling indicates the message should be treated as withdraw.
      • ignoreDuplicates

        default boolean ignoreDuplicates​(@NonNull RevisedErrorHandling errorHandling)
        Determine whether a duplicate attribute should be ignored or BGPError.MALFORMED_ATTR_LIST should be raised. This is useful for MP_REACH/MP_UNREACH attributes, which need to emit a Notification under RFC7606 rules.
        Parameters:
        errorHandling - Revised error handling type
        Returns:
        True if the duplicate attribute should be ignored, false if a BGPError should be raised.