Search in sources :

Example 1 with ObjectRegistry

use of org.opendaylight.protocol.pcep.spi.ObjectRegistry in project bgpcep by opendaylight.

the class BaseParserExtensionActivator method startImpl.

@Override
protected List<AutoCloseable> startImpl(final PCEPExtensionProviderContext context) {
    final List<AutoCloseable> regs = new ArrayList<>();
    registerLabelParsers(regs, context);
    final LabelRegistry labelReg = context.getLabelHandlerRegistry();
    registerEROParsers(regs, context, labelReg);
    registerRROParsers(regs, context, labelReg);
    registerXROParsers(regs, context);
    registerTlvParsers(regs, context);
    registerObjectParsers(regs, context);
    final ObjectRegistry objReg = context.getObjectHandlerRegistry();
    final PCEPOpenMessageParser openParser = new PCEPOpenMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPOpenMessageParser.TYPE, openParser));
    regs.add(context.registerMessageSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Open.class, openParser));
    final PCEPKeepAliveMessageParser kaParser = new PCEPKeepAliveMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPKeepAliveMessageParser.TYPE, kaParser));
    regs.add(context.registerMessageSerializer(Keepalive.class, kaParser));
    final PCEPRequestMessageParser reqParser = new PCEPRequestMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPRequestMessageParser.TYPE, reqParser));
    regs.add(context.registerMessageSerializer(Pcreq.class, reqParser));
    final PCEPReplyMessageParser repParser = new PCEPReplyMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPReplyMessageParser.TYPE, repParser));
    regs.add(context.registerMessageSerializer(Pcrep.class, repParser));
    final PCEPNotificationMessageParser notParser = new PCEPNotificationMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPNotificationMessageParser.TYPE, notParser));
    regs.add(context.registerMessageSerializer(Pcntf.class, notParser));
    final PCEPErrorMessageParser errParser = new PCEPErrorMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPErrorMessageParser.TYPE, errParser));
    regs.add(context.registerMessageSerializer(Pcerr.class, errParser));
    final PCEPCloseMessageParser closeParser = new PCEPCloseMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPCloseMessageParser.TYPE, closeParser));
    regs.add(context.registerMessageSerializer(Close.class, closeParser));
    final PCEPMonitoringReplyMessageParser monRepParser = new PCEPMonitoringReplyMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPMonitoringReplyMessageParser.TYPE, monRepParser));
    regs.add(context.registerMessageSerializer(Pcmonrep.class, monRepParser));
    final PCEPMonitoringRequestMessageParser monReqParser = new PCEPMonitoringRequestMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPMonitoringRequestMessageParser.TYPE, monReqParser));
    regs.add(context.registerMessageSerializer(Pcmonreq.class, monReqParser));
    final PCEPStartTLSMessageParser startTLSParser = new PCEPStartTLSMessageParser(objReg);
    regs.add(context.registerMessageParser(PCEPStartTLSMessageParser.TYPE, startTLSParser));
    regs.add(context.registerMessageSerializer(Starttls.class, startTLSParser));
    return regs;
}
Also used : ArrayList(java.util.ArrayList) PCEPMonitoringReplyMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPMonitoringReplyMessageParser) PCEPMonitoringRequestMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPMonitoringRequestMessageParser) Open(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open) PCEPCloseMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPCloseMessageParser) Pcmonreq(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcmonreq) Pcmonrep(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcmonrep) PCEPNotificationMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPNotificationMessageParser) PCEPRequestMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPRequestMessageParser) LabelRegistry(org.opendaylight.protocol.pcep.spi.LabelRegistry) Pcerr(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr) Keepalive(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Keepalive) PCEPKeepAliveMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPKeepAliveMessageParser) PCEPStartTLSMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPStartTLSMessageParser) Starttls(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Starttls) PCEPReplyMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPReplyMessageParser) PCEPOpenMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPOpenMessageParser) PCEPErrorMessageParser(org.opendaylight.protocol.pcep.parser.message.PCEPErrorMessageParser) Close(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Close) CClose(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.object.CClose) Pcntf(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcntf) Pcrep(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcrep) Pcreq(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcreq) ObjectRegistry(org.opendaylight.protocol.pcep.spi.ObjectRegistry)

Example 2 with ObjectRegistry

use of org.opendaylight.protocol.pcep.spi.ObjectRegistry in project bgpcep by opendaylight.

the class StatefulActivator method startImpl.

@Override
protected List<AutoCloseable> startImpl(final PCEPExtensionProviderContext context) {
    final List<AutoCloseable> regs = new ArrayList<>();
    final ObjectRegistry objReg = context.getObjectHandlerRegistry();
    regs.add(context.registerMessageParser(Stateful07PCUpdateRequestMessageParser.TYPE, new Stateful07PCUpdateRequestMessageParser(objReg)));
    regs.add(context.registerMessageSerializer(Pcupd.class, new Stateful07PCUpdateRequestMessageParser(objReg)));
    regs.add(context.registerMessageParser(Stateful07PCReportMessageParser.TYPE, new Stateful07PCReportMessageParser(objReg)));
    regs.add(context.registerMessageSerializer(Pcrpt.class, new Stateful07PCReportMessageParser(objReg)));
    regs.add(context.registerMessageParser(Stateful07ErrorMessageParser.TYPE, new Stateful07ErrorMessageParser(objReg)));
    regs.add(context.registerMessageSerializer(Pcerr.class, new Stateful07ErrorMessageParser(objReg)));
    final TlvRegistry tlvReg = context.getTlvHandlerRegistry();
    final VendorInformationTlvRegistry viTlvReg = context.getVendorInformationTlvRegistry();
    regs.add(context.registerObjectParser(Stateful07LspObjectParser.CLASS, Stateful07LspObjectParser.TYPE, new Stateful07LspObjectParser(tlvReg, viTlvReg)));
    regs.add(context.registerObjectSerializer(Lsp.class, new Stateful07LspObjectParser(tlvReg, viTlvReg)));
    regs.add(context.registerObjectParser(Stateful07SrpObjectParser.CLASS, Stateful07SrpObjectParser.TYPE, new Stateful07SrpObjectParser(tlvReg, viTlvReg)));
    regs.add(context.registerObjectSerializer(Srp.class, new Stateful07SrpObjectParser(tlvReg, viTlvReg)));
    regs.add(context.registerObjectParser(Stateful07OpenObjectParser.CLASS, Stateful07OpenObjectParser.TYPE, new Stateful07OpenObjectParser(tlvReg, viTlvReg)));
    regs.add(context.registerObjectSerializer(Open.class, new Stateful07OpenObjectParser(tlvReg, viTlvReg)));
    regs.add(context.registerTlvParser(Stateful07LSPIdentifierIpv4TlvParser.TYPE, new Stateful07LSPIdentifierIpv4TlvParser()));
    regs.add(context.registerTlvParser(Stateful07LSPIdentifierIpv6TlvParser.TYPE, new Stateful07LSPIdentifierIpv6TlvParser()));
    regs.add(context.registerTlvSerializer(LspIdentifiers.class, new Stateful07LSPIdentifierIpv4TlvParser()));
    regs.add(context.registerTlvParser(Stateful07LspUpdateErrorTlvParser.TYPE, new Stateful07LspUpdateErrorTlvParser()));
    regs.add(context.registerTlvSerializer(LspErrorCode.class, new Stateful07LspUpdateErrorTlvParser()));
    regs.add(context.registerTlvParser(Stateful07RSVPErrorSpecTlvParser.TYPE, new Stateful07RSVPErrorSpecTlvParser()));
    regs.add(context.registerTlvSerializer(RsvpErrorSpec.class, new Stateful07RSVPErrorSpecTlvParser()));
    regs.add(context.registerTlvParser(Stateful07StatefulCapabilityTlvParser.TYPE, new Stateful07StatefulCapabilityTlvParser()));
    regs.add(context.registerTlvSerializer(Stateful.class, new Stateful07StatefulCapabilityTlvParser()));
    regs.add(context.registerTlvParser(Stateful07LspSymbolicNameTlvParser.TYPE, new Stateful07LspSymbolicNameTlvParser()));
    regs.add(context.registerTlvSerializer(SymbolicPathName.class, new Stateful07LspSymbolicNameTlvParser()));
    regs.add(context.registerTlvParser(PathBindingTlvParser.TYPE, new PathBindingTlvParser()));
    regs.add(context.registerTlvSerializer(PathBinding.class, new PathBindingTlvParser()));
    return regs;
}
Also used : Stateful(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful) LspErrorCode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.error.code.tlv.LspErrorCode) ArrayList(java.util.ArrayList) PathBinding(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.path.binding.tlv.PathBinding) Open(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open) Srp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.Srp) Pcrpt(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt) VendorInformationTlvRegistry(org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry) SymbolicPathName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.symbolic.path.name.tlv.SymbolicPathName) Pcupd(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcupd) LspIdentifiers(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.identifiers.tlv.LspIdentifiers) Pcerr(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr) Lsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp) RsvpErrorSpec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.rsvp.error.spec.tlv.RsvpErrorSpec) VendorInformationTlvRegistry(org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry) TlvRegistry(org.opendaylight.protocol.pcep.spi.TlvRegistry) ObjectRegistry(org.opendaylight.protocol.pcep.spi.ObjectRegistry)

Aggregations

ArrayList (java.util.ArrayList)2 ObjectRegistry (org.opendaylight.protocol.pcep.spi.ObjectRegistry)2 Pcerr (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr)2 Open (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open)2 PCEPCloseMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPCloseMessageParser)1 PCEPErrorMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPErrorMessageParser)1 PCEPKeepAliveMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPKeepAliveMessageParser)1 PCEPMonitoringReplyMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPMonitoringReplyMessageParser)1 PCEPMonitoringRequestMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPMonitoringRequestMessageParser)1 PCEPNotificationMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPNotificationMessageParser)1 PCEPOpenMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPOpenMessageParser)1 PCEPReplyMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPReplyMessageParser)1 PCEPRequestMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPRequestMessageParser)1 PCEPStartTLSMessageParser (org.opendaylight.protocol.pcep.parser.message.PCEPStartTLSMessageParser)1 LabelRegistry (org.opendaylight.protocol.pcep.spi.LabelRegistry)1 TlvRegistry (org.opendaylight.protocol.pcep.spi.TlvRegistry)1 VendorInformationTlvRegistry (org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry)1 Pcrpt (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt)1 Pcupd (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcupd)1 LspErrorCode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.error.code.tlv.LspErrorCode)1