Fix most bgp-parser-spi checkstyle violations
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / MessageRegistry.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.protocol.bgp.parser.BGPParsingException;
15 import org.opendaylight.yangtools.yang.binding.Notification;
16
17 /**
18  * BGP Message codec registry, provides services to encode/decode messages.
19  */
20 public interface MessageRegistry {
21     /**
22      * Decode input buffer to BGP Message.
23      * @param bytes Input buffer with encoded message.
24      * @param constraint Peer specific constraint.
25      * @return Parsed BGP message.
26      */
27     @Nonnull Notification parseMessage(@Nonnull ByteBuf bytes, @Nullable PeerSpecificParserConstraint constraint)
28             throws BGPDocumentedException, BGPParsingException;
29
30     /**
31      * Encode input BGP Message to output buffer.
32      * @param message Input BGP Message to be serialized.
33      * @param buffer Output buffer where message is to be written.
34      */
35     void serializeMessage(@Nonnull Notification message, @Nonnull ByteBuf buffer);
36 }