026e673957a99526b81da287ec558866a893c768
[bgpcep.git] / bgp / inet / src / main / java / org / opendaylight / protocol / bgp / inet / BGPActivator.java
1 /*
2  * Copyright (c) 2016 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.inet;
9
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
13 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.attributes.bgp.prefix.sid.bgp.prefix.sid.tlvs.bgp.prefix.sid.tlv.Ipv6SidTlv;
15
16 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
17
18     @Override
19     protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
20         final List<AutoCloseable> regs = new ArrayList<>(2);
21         final Ipv6BgpPrefixSidParser tlvHandler = new Ipv6BgpPrefixSidParser();
22         regs.add(context.registerBgpPrefixSidTlvParser(tlvHandler.getType(), tlvHandler));
23         regs.add(context.registerBgpPrefixSidTlvSerializer(Ipv6SidTlv.class, tlvHandler));
24         return regs;
25     }
26
27 }