Allow AttributeRegistry to signal treat-as-withdraw
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / AttributeRegistry.java
index 4dc857cd191582e18f21a3e9aa809d3ccc474f8a..f67f945d5e50393a08802d01ddd5a429040baa80 100644 (file)
@@ -11,6 +11,7 @@ import io.netty.buffer.ByteBuf;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
+import org.opendaylight.protocol.bgp.parser.BGPError;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
 
@@ -23,11 +24,11 @@ public interface AttributeRegistry {
      * @param buffer Input buffer.
      * @param constraints Peer specific constraint.
      * @return Decoded BGP Attribute.
-     * @throws BGPDocumentedException
-     * @throws BGPParsingException
+     * @throws BGPDocumentedException when an unrecoverable error occurs, which is documented via {@link BGPError}
+     * @throws BGPParsingException when a general unrecoverable parsing error occurs
      */
-    @Nonnull Attributes parseAttributes(@Nonnull ByteBuf buffer, @Nullable PeerSpecificParserConstraint constraints)
-            throws BGPDocumentedException, BGPParsingException;
+    @Nonnull ParsedAttributes parseAttributes(@Nonnull ByteBuf buffer,
+            @Nullable PeerSpecificParserConstraint constraints) throws BGPDocumentedException, BGPParsingException;
 
     /**
      * Serialize BGP Attribute to buffer.