Fix most bgp-parser-spi checkstyle violations
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / MessageParser.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.BGPDocumentedException;
14 import org.opendaylight.yangtools.yang.binding.Notification;
15
16 /**
17  * Common interface for message parser implementation.
18  */
19 public interface MessageParser {
20     /**
21      * Parse BGP Message from buffer, potentially applying peer-specific constraints. Implementations are free
22      *
23      * @param body Encoded BGP message in ByteBuf.
24      * @param messageLength Length of the BGP message.
25      * @param constraint Peer specific constraints, implementations may ignore them.
26      * @return Parsed BGP Message body.
27      */
28     @Nonnull Notification parseMessageBody(@Nonnull ByteBuf body, int messageLength,
29             @Nullable PeerSpecificParserConstraint constraint) throws BGPDocumentedException;
30 }