Add new revision for pcep types model
[bgpcep.git] / pcep / impl / src / test / java / org / opendaylight / protocol / pcep / impl / TestVendorInformationActivator.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.protocol.pcep.impl;
10
11 import com.google.common.collect.Lists;
12 import java.util.List;
13 import org.opendaylight.protocol.pcep.impl.TestVendorInformationTlvParser.TestEnterpriseSpecificInformation;
14 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
15 import org.opendaylight.protocol.pcep.spi.pojo.AbstractPCEPExtensionProviderActivator;
16
17 public class TestVendorInformationActivator extends AbstractPCEPExtensionProviderActivator {
18
19     @Override
20     protected List<AutoCloseable> startImpl(PCEPExtensionProviderContext context) {
21         final List<AutoCloseable> regs = Lists.newArrayList();
22         final TestVendorInformationTlvParser parser = new TestVendorInformationTlvParser();
23         regs.add(context.registerVendorInformationTlvParser(parser.getEnterpriseNumber(), parser));
24         regs.add(context.registerVendorInformationTlvSerializer(TestEnterpriseSpecificInformation.class, parser));
25
26         // Vendor-information object registration
27         final TestVendorInformationObjectParser objParser = new TestVendorInformationObjectParser();
28         regs.add(context.registerVendorInformationObjectParser(parser.getEnterpriseNumber(), objParser));
29         regs.add(context.registerVendorInformationObjectSerializer(TestEnterpriseSpecificInformation.class, objParser));
30         return regs;
31     }
32
33 }