X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=bgp%2Fparser-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fbgp%2Fparser%2Fspi%2FAttributeRegistry.java;h=ed9fbeca4ca79a6ed4b83343eed8171d7e4ded62;hb=03ffd2711bebbfa4ff57311ddac82ae665982512;hp=ee99c1e120bf4fc8332d7b6e0a2143ecbfdb2333;hpb=2072c47aca26c89985fac7a5d09937d93a9fb14b;p=bgpcep.git diff --git a/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AttributeRegistry.java b/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AttributeRegistry.java index ee99c1e120..ed9fbeca4c 100644 --- a/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AttributeRegistry.java +++ b/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AttributeRegistry.java @@ -8,32 +8,35 @@ package org.opendaylight.protocol.bgp.parser.spi; import io.netty.buffer.ByteBuf; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +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.rev171207.path.attributes.Attributes; -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 { /** * Parse BGP Attribute from buffer. + * * @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) + 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(@Nonnull DataObject attribute, @Nonnull ByteBuf byteAggregator); + void serializeAttribute(Attributes attribute, ByteBuf byteAggregator); }