Class AbstractAttributeParser

java.lang.Object
org.opendaylight.protocol.bgp.parser.spi.AbstractAttributeParser
All Implemented Interfaces:
AttributeParser

public abstract class AbstractAttributeParser extends Object implements AttributeParser
Abstract base class for AttributeParsers which are aware of RevisedErrorHandling. Inheriting from this class requires that parseAttribute(ByteBuf, AttributesBuilder, RevisedErrorHandling, PeerSpecificParserConstraint) is provided and the simplified parseAttribute(ByteBuf, AttributesBuilder, PeerSpecificParserConstraint) is implemented by this class.
Author:
Robert Varga
  • Constructor Details

    • AbstractAttributeParser

      public AbstractAttributeParser()
  • Method Details

    • parseAttribute

      public final void parseAttribute(io.netty.buffer.ByteBuf buffer, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder builder, PeerSpecificParserConstraint constraint) throws org.opendaylight.protocol.bgp.parser.BGPDocumentedException, org.opendaylight.protocol.bgp.parser.BGPParsingException
      Description copied from interface: AttributeParser
      Parses attribute from ByteBuf buffer.
      Specified by:
      parseAttribute in interface AttributeParser
      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

      public abstract void parseAttribute(io.netty.buffer.ByteBuf buffer, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder builder, RevisedErrorHandling errorHandling, PeerSpecificParserConstraint constraint) throws org.opendaylight.protocol.bgp.parser.BGPDocumentedException, org.opendaylight.protocol.bgp.parser.BGPParsingException, org.opendaylight.protocol.bgp.parser.BGPTreatAsWithdrawException
      Description copied from interface: AttributeParser
      Parses attribute from ByteBuf buffer with the specified RevisedErrorHandling. Default implementation ignores error handling and defers to AttributeParser.parseAttribute(ByteBuf, AttributesBuilder, PeerSpecificParserConstraint).
      Specified by:
      parseAttribute in interface AttributeParser
      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.