Remove deprecated methods
[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
19  * to encode/decode messages.
20  */
21 public interface MessageRegistry {
22     /**
23      * Decode input buffer to BGP Message.
24      * @param bytes Input buffer with encoded message.
25      * @param constraint Peer specific constraint.
26      * @return Parsed BGP message.
27      * @throws BGPDocumentedException
28      * @throws BGPParsingException
29      */
30     @Nonnull Notification parseMessage(@Nonnull ByteBuf bytes, @Nullable PeerSpecificParserConstraint constraint)
31             throws BGPDocumentedException, BGPParsingException;
32
33     /**
34      * Encode input BGP Message to output buffer.
35      * @param message Input BGP Message to be serialized.
36      * @param buffer Output buffer where message is to be written.
37      */
38     void serializeMessage(@Nonnull Notification message, @Nonnull ByteBuf buffer);
39
40 }