use of org.opendaylight.yangtools.concepts.Registration in project bgpcep by opendaylight.
the class BGPActivator method start.
@Override
public List<Registration> start(final BGPExtensionProviderContext context) {
final List<Registration> regs = new ArrayList<>();
final SimpleTunnelIdentifierRegistry tunnelIdentifierReg = SimpleTunnelIdentifierRegistry.getInstance();
final RsvpTeP2MpLspParser rsvpTeP2MpLspParser = new RsvpTeP2MpLspParser();
regs.add(tunnelIdentifierReg.registerParser(rsvpTeP2MpLspParser));
regs.add(tunnelIdentifierReg.registerSerializer(rsvpTeP2MpLspParser));
final MldpP2mpLspParser mldpP2mpLspParser = new MldpP2mpLspParser(context.getAddressFamilyRegistry());
regs.add(tunnelIdentifierReg.registerParser(mldpP2mpLspParser));
regs.add(tunnelIdentifierReg.registerSerializer(mldpP2mpLspParser));
final PimSsmTreeParser pimSsmTreeParser = new PimSsmTreeParser();
regs.add(tunnelIdentifierReg.registerParser(pimSsmTreeParser));
regs.add(tunnelIdentifierReg.registerSerializer(pimSsmTreeParser));
final PimSmTreeParser pimSmTreeParser = new PimSmTreeParser();
regs.add(tunnelIdentifierReg.registerParser(pimSmTreeParser));
regs.add(tunnelIdentifierReg.registerSerializer(pimSmTreeParser));
final BidirPimTreeParser bidirPimTreeParser = new BidirPimTreeParser();
regs.add(tunnelIdentifierReg.registerParser(bidirPimTreeParser));
regs.add(tunnelIdentifierReg.registerSerializer(bidirPimTreeParser));
final IngressReplicationParser ingressReplicationParser = new IngressReplicationParser();
regs.add(tunnelIdentifierReg.registerParser(ingressReplicationParser));
regs.add(tunnelIdentifierReg.registerSerializer(ingressReplicationParser));
final MldpMp2mpLspParser mldpMp2mpLspParser = new MldpMp2mpLspParser();
regs.add(tunnelIdentifierReg.registerParser(mldpMp2mpLspParser));
regs.add(tunnelIdentifierReg.registerSerializer(mldpMp2mpLspParser));
regs.add(context.registerSubsequentAddressFamily(McastVpnSubsequentAddressFamily.class, MVPN_SAFI));
final MvpnIpv4NlriHandler mvpnIpv4NlriHandler = new MvpnIpv4NlriHandler();
final Ipv4NextHopParserSerializer ipv4NextHopParser = new Ipv4NextHopParserSerializer();
regs.add(context.registerNlriParser(Ipv4AddressFamily.class, McastVpnSubsequentAddressFamily.class, mvpnIpv4NlriHandler, ipv4NextHopParser, Ipv4NextHopCase.class));
regs.add(context.registerNlriSerializer(MvpnRoutesIpv4.class, mvpnIpv4NlriHandler));
final MvpnIpv6NlriHandler mvpnIpv6NlriHandler = new MvpnIpv6NlriHandler();
final Ipv6NextHopParserSerializer ipv6NextHopParser = new Ipv6NextHopParserSerializer();
regs.add(context.registerNlriParser(Ipv6AddressFamily.class, McastVpnSubsequentAddressFamily.class, mvpnIpv6NlriHandler, ipv6NextHopParser, Ipv6NextHopCase.class));
regs.add(context.registerNlriSerializer(MvpnRoutesIpv6.class, mvpnIpv6NlriHandler));
final PEDistinguisherLabelsAttributeHandler peDistHandler = new PEDistinguisherLabelsAttributeHandler();
regs.add(context.registerAttributeParser(peDistHandler.getType(), peDistHandler));
regs.add(context.registerAttributeSerializer(peDistHandler.getClazz(), peDistHandler));
final PMSITunnelAttributeHandler pmsiParser = new PMSITunnelAttributeHandler();
regs.add(context.registerAttributeParser(pmsiParser.getType(), pmsiParser));
regs.add(context.registerAttributeSerializer(pmsiParser.getClazz(), pmsiParser));
return regs;
}
use of org.opendaylight.yangtools.concepts.Registration in project bgpcep by opendaylight.
the class BGPActivator method start.
@Override
public List<Registration> start(final BGPExtensionProviderContext context) {
final List<Registration> regs = new ArrayList<>();
regs.add(context.registerAddressFamily(LinkstateAddressFamily.class, LINKSTATE_AFI));
regs.add(context.registerSubsequentAddressFamily(LinkstateSubsequentAddressFamily.class, LINKSTATE_SAFI));
final NextHopParserSerializer linkstateNextHopParser = new NextHopParserSerializer() {
};
final LinkstateNlriParser parser = new LinkstateNlriParser();
regs.add(context.registerNlriParser(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class, parser, linkstateNextHopParser, Ipv4NextHopCase.class, Ipv6NextHopCase.class));
regs.add(context.registerNlriSerializer(LinkstateRoutes.class, parser));
regs.add(context.registerAttributeSerializer(Attributes1.class, new LinkstateAttributeParser(this.ianaLinkstateAttributeType, this.rsvpTeObjectRegistry)));
final LinkstateAttributeParser linkstateAttributeParser = new LinkstateAttributeParser(this.ianaLinkstateAttributeType, this.rsvpTeObjectRegistry);
regs.add(context.registerAttributeParser(linkstateAttributeParser.getType(), linkstateAttributeParser));
return regs;
}
use of org.opendaylight.yangtools.concepts.Registration in project bgpcep by opendaylight.
the class SyncOptimizationsActivator method start.
@Override
public List<Registration> start(final PCEPExtensionProviderContext context) {
final List<Registration> regs = new ArrayList<>();
final TlvRegistry tlvReg = context.getTlvHandlerRegistry();
final VendorInformationTlvRegistry viTlvReg = context.getVendorInformationTlvRegistry();
regs.add(context.registerObjectParser(new SyncOptimizationsLspObjectParser(tlvReg, viTlvReg)));
regs.add(context.registerObjectSerializer(Lsp.class, new SyncOptimizationsLspObjectParser(tlvReg, viTlvReg)));
regs.add(context.registerObjectParser(new SyncOptimizationsOpenObjectParser(tlvReg, viTlvReg)));
regs.add(context.registerObjectSerializer(Open.class, new SyncOptimizationsOpenObjectParser(tlvReg, viTlvReg)));
regs.add(context.registerTlvParser(LspDbVersionTlvParser.TYPE, new LspDbVersionTlvParser()));
regs.add(context.registerTlvSerializer(LspDbVersion.class, new LspDbVersionTlvParser()));
regs.add(context.registerTlvParser(SpeakerEntityIdTlvParser.TYPE, new SpeakerEntityIdTlvParser()));
regs.add(context.registerTlvSerializer(SpeakerEntityId.class, new SpeakerEntityIdTlvParser()));
regs.add(context.registerTlvParser(SyncOptimizationsCapabilityTlvParser.TYPE, new SyncOptimizationsCapabilityTlvParser()));
regs.add(context.registerTlvSerializer(Stateful.class, new SyncOptimizationsCapabilityTlvParser()));
return regs;
}
use of org.opendaylight.yangtools.concepts.Registration in project bgpcep by opendaylight.
the class HandlerRegistryTest method testHandlerRegistry.
@Test
public void testHandlerRegistry() {
final HandlerRegistry<Object, String, String> registry = new HandlerRegistry<>();
final Registration parserReg = registry.registerParser(TYPE, PARSER);
final Registration serializerReg = registry.registerSerializer(Object.class, SERIALIZER);
assertNotNull(parserReg);
assertNotNull(serializerReg);
assertEquals(SERIALIZER, registry.getSerializer(Object.class));
assertEquals(SERIALIZER, registry.getAllSerializers().iterator().next());
assertEquals(PARSER, registry.getParser(TYPE));
assertNull(registry.getParser(0));
assertNull(registry.getSerializer(String.class));
parserReg.close();
serializerReg.close();
serializerReg.close();
assertNull(registry.getParser(TYPE));
assertNull(registry.getSerializer(Object.class));
}
use of org.opendaylight.yangtools.concepts.Registration in project bgpcep by opendaylight.
the class MultiRegistryTest method testMultiRegistry.
@Test
public void testMultiRegistry() {
final MultiRegistry<Object, Integer> registry = new MultiRegistry<>();
final String first = "first";
final String second = "second";
final String third = "third";
final Registration a = registry.register(first, 1);
registry.register(second, 2);
registry.register(third, 3);
assertEquals(Integer.valueOf(1), registry.get("first"));
assertEquals(Integer.valueOf(2), registry.get("second"));
assertEquals(Integer.valueOf(3), registry.get("third"));
registry.register(second, 22);
assertEquals(Integer.valueOf(22), registry.get("second"));
registry.register('c', 5);
assertEquals(Integer.valueOf(5), registry.get('c'));
a.close();
assertNull(registry.get("first"));
}
Aggregations