Search in sources :

Example 1 with ApplicationRibId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibId in project bgpcep by opendaylight.

the class AppPeerBenchmark method start.

public void start() {
    LOG.debug("Instantiating App Peer Benchmark : {}", this.appRibId);
    final ApplicationRib appRib = new ApplicationRibBuilder().setId(new ApplicationRibId(new ApplicationRibId(this.appRibId))).setTables(EMPTY_TABLES).build();
    final WriteTransaction wTx = this.txChain.newWriteOnlyTransaction();
    wTx.put(LogicalDatastoreType.CONFIGURATION, this.appIID, appRib);
    wTx.commit().addCallback(new FutureCallback<CommitInfo>() {

        @Override
        public void onSuccess(final CommitInfo result) {
            LOG.info("Empty Structure created for Application Peer Benchmark {}", AppPeerBenchmark.this.appRibId);
        }

        @Override
        public void onFailure(final Throwable throwable) {
            LOG.error("Failed to create Empty Structure for Application Peer Benchmark {}", AppPeerBenchmark.this.appRibId, throwable);
        }
    }, MoreExecutors.directExecutor());
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) ApplicationRibBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibBuilder) ApplicationRib(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRib) ApplicationRibId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibId) CommitInfo(org.opendaylight.mdsal.common.api.CommitInfo)

Example 2 with ApplicationRibId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibId in project bgpcep by opendaylight.

the class PeerTest method testAppPeer.

@Test
public void testAppPeer() {
    final Ipv4Prefix first = new Ipv4Prefix("127.0.0.2/32");
    final Ipv4Prefix second = new Ipv4Prefix("127.0.0.1/32");
    final Ipv4Prefix third = new Ipv4Prefix("127.0.0.3/32");
    this.peer = new ApplicationPeer(this.tableRegistry, new ApplicationRibId(this.neighborAddress.getIpv4AddressNoZone().getValue()), this.neighborAddress.getIpv4AddressNoZone(), getRib());
    this.peer.instantiateServiceInstance(null, null);
    final YangInstanceIdentifier base = getRib().getYangRibId().node(LocRib.QNAME).node(Tables.QNAME).node(RibSupportUtils.toYangTablesKey(KEY));
    this.peer.onDataTreeChanged(ipv4Input(base, ModificationType.WRITE, first, second, third));
    assertEquals(3, this.routes.size());
    this.peer.onDataTreeChanged(ipv4Input(base, ModificationType.DELETE, third));
    assertEquals(2, this.routes.size());
}
Also used : ApplicationRibId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibId) Ipv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) Test(org.junit.Test)

Aggregations

ApplicationRibId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibId)2 Test (org.junit.Test)1 WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)1 CommitInfo (org.opendaylight.mdsal.common.api.CommitInfo)1 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)1 ApplicationRib (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRib)1 ApplicationRibBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRibBuilder)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1