Fix most bgp-parser-spi checkstyle violations
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / NlriRegistry.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.bgp.parser.spi;
9
10 import io.netty.buffer.ByteBuf;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlri;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpUnreachNlri;
16
17 /**
18  * The codec registry for BGP NLRI, offers services for NLRI encoding/decoding.
19  */
20 public interface NlriRegistry {
21     /**
22      * Decode MP REACH NLRI Attribute.
23      *
24      * @param buffer Input buffer.
25      * @param constraint Peer specific constraint.
26      * @return Parsed reach NLRI.
27      */
28     @Nonnull MpReachNlri parseMpReach(@Nonnull ByteBuf buffer, @Nullable PeerSpecificParserConstraint constraint)
29             throws BGPParsingException;
30
31     /**
32      * Decode MP REACH NLRI Attribute.
33      *
34      * @param buffer Input buffer.
35      * @param constraint Peer specific constraint.
36      * @return Parsed unreach NLRI.
37      */
38     @Nonnull MpUnreachNlri parseMpUnreach(@Nonnull ByteBuf buffer, @Nullable PeerSpecificParserConstraint constraint)
39             throws BGPParsingException;
40
41     /**
42      * Encode BGP MP REACH NLRI Attribute.
43      *
44      * @param mpReachNlri Input reach NLRI.
45      * @param byteAggregator Output buffer.
46      */
47     void serializeMpReach(@Nonnull MpReachNlri mpReachNlri, @Nonnull ByteBuf byteAggregator);
48
49     /**
50      * Encode BGP MP UNREACH NLRI Attribute.
51      *
52      * @param mpUnreachNlri Input unreach NLRI.
53      * @param byteAggregator Output buffer.
54      */
55     void serializeMpUnReach(@Nonnull MpUnreachNlri mpUnreachNlri, @Nonnull ByteBuf byteAggregator);
56
57     /**
58      * Get all available NLRI encoders.
59      *
60      * @return Iterable of NLRI serializers.
61      */
62     Iterable<NlriSerializer> getSerializers();
63 }