YANG revision dates mass-update
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / extended / community / ExtendedCommunityRegistry.java
1 /*
2  * Copyright (c) 2015 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.extended.community;
9
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
12 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.ExtendedCommunities;
14
15 /**
16  * The Extended Communities registry.
17  */
18 public interface ExtendedCommunityRegistry {
19     /**
20      * Parses the Extended Community.
21      *
22      * @param buffer ByteBuf
23      * @return Decoded ExtendedCommunity or null if the parser for such Extended Community type/sub-type is not present.
24      */
25     ExtendedCommunities parseExtendedCommunity(ByteBuf buffer) throws BGPDocumentedException, BGPParsingException;
26
27     /**
28      * Serializes the Extended Community.
29      *
30      * @param extendedCommunity ExtendedCommunity to be encoded.
31      * @param byteAggregator ByteBuf, where the Extended Community is serialized, if a serialized is not present for
32      *                       such Extended Community type, no bytes are written into output buffer.
33      */
34     void serializeExtendedCommunity(ExtendedCommunities extendedCommunity, ByteBuf byteAggregator);
35 }