2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.protocol.pcep.impl;
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;
17 public class TestVendorInformationActivator extends AbstractPCEPExtensionProviderActivator {
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));
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));