BUG-2982 : moved path-attributes container to grouping
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / AttributeParser.java
index 71b7ac6f1271001d5626550ceecd4cedd314fc59..3704c9acc19ff5c08b09132ee394db75e70f728b 100644 (file)
@@ -7,10 +7,21 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi;
 
+import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.update.PathAttributesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.AttributesBuilder;
 
+/**
+ * Common interface for attribute parser implementation.
+ */
 public interface AttributeParser {
-       void parseAttribute(final byte[] bytes, PathAttributesBuilder builder) throws BGPDocumentedException, BGPParsingException;
+    /**
+     * Parses attribute from ByteBuf buffer
+     *
+     * @param buffer encoded attribute body in Bytebuf
+     * @param builder Path attributes builder. Guaranteed to contain all valid attributes whose type is numerically
+     *        lower than this attribute's type.
+     */
+    void parseAttribute(final ByteBuf buffer, AttributesBuilder builder) throws BGPDocumentedException, BGPParsingException;
 }