use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.SendReceive in project bgpcep by opendaylight.
the class AdjRibInWriter method transform.
AdjRibInWriter transform(final PeerId newPeerId, final YangInstanceIdentifier peerPath, final RIBSupportContextRegistry registry, final Set<TablesKey> tableTypes, final Map<TablesKey, SendReceive> addPathTablesType, @Nullable final RegisterAppPeerListener registerAppPeerListener) {
final DOMDataTreeWriteTransaction tx = this.chain.getDomChain().newWriteOnlyTransaction();
createEmptyPeerStructure(newPeerId, peerPath, tx);
final ImmutableMap<TablesKey, TableContext> tb = createNewTableInstances(peerPath, registry, tableTypes, addPathTablesType, tx);
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
public void onSuccess(final CommitInfo result) {
if (registerAppPeerListener != null) {
LOG.trace("Application Peer Listener registered");
registerAppPeerListener.register();
}
}
@Override
public void onFailure(final Throwable throwable) {
if (registerAppPeerListener != null) {
LOG.error("Failed to create Empty Structure, Application Peer Listener won't be registered", throwable);
} else {
LOG.error("Failed to create Empty Structure", throwable);
}
}
}, MoreExecutors.directExecutor());
return new AdjRibInWriter(this.ribPath, this.chain, this.role, tb);
}
Aggregations