- @Override
- public synchronized void updateTables(final Peer peer, final Update message) {
- final AdjRIBsTransactionImpl trans = new AdjRIBsTransactionImpl(this.ribOuts, this.comparator, this.chain.newWriteOnlyTransaction());
-
- if (!EOR.equals(message)) {
- final WithdrawnRoutes wr = message.getWithdrawnRoutes();
- if (wr != null) {
- final AdjRIBsIn<?, ?> ari = this.tables.get(IPV4_UNICAST_TABLE);
- if (ari != null) {
- /*
- * create MPUnreach for the routes to be handled in the same way as linkstate routes
- */
- final List<Ipv4Prefixes> prefixes = new ArrayList<>();
- for (final Ipv4Prefix p : wr.getWithdrawnRoutes()) {
- prefixes.add(new Ipv4PrefixesBuilder().setPrefix(p).build());
- }
- ari.removeRoutes(
- trans,
- peer,
- new MpUnreachNlriBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setWithdrawnRoutes(
- new WithdrawnRoutesBuilder().setDestinationType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.path.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv4CaseBuilder().setDestinationIpv4(
- new DestinationIpv4Builder().setIpv4Prefixes(prefixes).build()).build()).build()).build());
- } else {
- LOG.debug("Not removing objects from unhandled IPv4 Unicast");
- }
- }
-
- final PathAttributes attrs = message.getPathAttributes();
- if (attrs != null) {
- final PathAttributes2 mpu = attrs.getAugmentation(PathAttributes2.class);
- if (mpu != null) {
- final MpUnreachNlri nlri = mpu.getMpUnreachNlri();
- final AdjRIBsIn<?, ?> ari = this.tables.get(new TablesKey(nlri.getAfi(), nlri.getSafi()));
- // EOR messages do not contain withdrawn routes
- if (nlri.getWithdrawnRoutes() != null) {
- if (ari != null) {
- ari.removeRoutes(trans, peer, nlri);
- } else {
- LOG.debug("Not removing objects from unhandled NLRI {}", nlri);
- }
- } else {
- ari.markUptodate(trans, peer);
- }
- }
- }
+ private void startLocRib(final TablesKey key, final PolicyDatabase pd) {
+ LOG.debug("Creating LocRib table for {}", key);
+ // create locRibWriter for each table
+ final DOMDataWriteTransaction tx = this.domChain.newWriteOnlyTransaction();