Get rid of JSR305 annotations
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / AttributeRegistry.java
index 31efdef59ea616765e09a0d4df4da9063655281f..ed9fbeca4ca79a6ed4b83343eed8171d7e4ded62 100644 (file)
@@ -7,12 +7,36 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi;
 
+import io.netty.buffer.ByteBuf;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.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.rev130919.update.PathAttributes;
-import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
 
+/**
+ * Attribute serializer/deserializer registry, exposing the capability to parse BGP attributes as a whole.
+ */
+@NonNullByDefault
 public interface AttributeRegistry {
-       public PathAttributes parseAttributes(final byte[] bytes) throws BGPDocumentedException, BGPParsingException;
-       public byte[] serializeAttribute(DataObject attribute);
+    /**
+     * Parse BGP Attribute from buffer.
+     *
+     * @param buffer Input buffer.
+     * @param constraints Peer specific constraint.
+     * @return Decoded BGP Attribute.
+     * @throws BGPDocumentedException when an unrecoverable error occurs, which is documented via {@link BGPError}
+     * @throws BGPParsingException when a general unrecoverable parsing error occurs
+     */
+    ParsedAttributes parseAttributes(ByteBuf buffer, @Nullable PeerSpecificParserConstraint constraints)
+            throws BGPDocumentedException, BGPParsingException;
+
+    /**
+     * Serialize BGP Attribute to buffer.
+     *
+     * @param attribute Input BGP Attribute.
+     * @param byteAggregator Output buffer.
+     */
+    void serializeAttribute(Attributes attribute, ByteBuf byteAggregator);
 }