Make sure attributes are parsed in order of their increasing type
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / AttributeParser.java
index 1f5abc610789bad02641f497cac40ae58327d72e..d0971085f905e38981de587cb93196e3967be54c 100644 (file)
@@ -8,8 +8,17 @@
 package org.opendaylight.protocol.bgp.parser.spi;
 
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.update.PathAttributesBuilder;
+import org.opendaylight.protocol.bgp.parser.BGPParsingException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.update.PathAttributesBuilder;
 
+/**
+ * Common interface for attribute parser implementation.
+ */
 public interface AttributeParser {
-       public void parseAttribute(final byte[] bytes, PathAttributesBuilder builder) throws BGPDocumentedException;
+       /**
+        * @param body encoded attribute body
+        * @param builder Path attributes builder. Guaranteed to contain all valid attributes whose type
+        *                is numerically lower than this attribute's type.
+        */
+       void parseAttribute(final byte[] body, PathAttributesBuilder builder) throws BGPDocumentedException, BGPParsingException;
 }