Search in sources :

Example 1 with RIBSupportContextRegistry

use of org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry in project bgpcep by opendaylight.

the class ApplicationPeer method instantiateServiceInstance.

public synchronized void instantiateServiceInstance(final DOMDataTreeChangeService dataTreeChangeService, final DOMDataTreeIdentifier appPeerDOMId) {
    setActive(true);
    this.chain = this.rib.createPeerDOMChain(this);
    this.writerChain = this.rib.createPeerDOMChain(this);
    final Set<TablesKey> localTables = this.rib.getLocalTablesKeys();
    localTables.forEach(tablesKey -> {
        this.supportedTables.add(RibSupportUtils.toYangTablesKey(tablesKey));
    });
    setAdvertizedGracefulRestartTableTypes(Collections.emptyList());
    this.adjRibInWriter = AdjRibInWriter.create(this.rib.getYangRibId(), PeerRole.Internal, this.writerChain);
    final RIBSupportContextRegistry context = this.rib.getRibSupportContext();
    final RegisterAppPeerListener registerAppPeerListener = () -> {
        synchronized (this) {
            if (this.chain != null) {
                this.registration = dataTreeChangeService.registerDataTreeChangeListener(appPeerDOMId, this);
            }
        }
    };
    this.adjRibInWriter = this.adjRibInWriter.transform(this.peerId, context, localTables, Collections.emptyMap(), registerAppPeerListener);
    this.effectiveRibInWriter = EffectiveRibInWriter.create(this, this.rib, this.rib.createPeerChain(this), this.peerIId, localTables);
    this.bgpSessionState.registerMessagesCounter(this);
    this.trackerRegistration = this.rib.getPeerTracker().registerPeer(this);
}
Also used : TablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey) RIBSupportContextRegistry(org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry)

Aggregations

RIBSupportContextRegistry (org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry)1 TablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey)1