Search in sources :

Example 1 with L3VpnComposite

use of org.opendaylight.netvirt.vpnmanager.intervpnlink.L3VpnTestCatalog.L3VpnComposite in project netvirt by opendaylight.

the class InterVpnLinkLocatorTest method cleanL3Vpns.

public void cleanL3Vpns(DataBroker broker, List<L3VpnComposite> vpns) throws TransactionCommitFailedException {
    for (L3VpnComposite vpn : vpns) {
        WriteTransaction writeTx1 = broker.newWriteOnlyTransaction();
        writeTx1.delete(LogicalDatastoreType.OPERATIONAL, VpnUtil.getVpnInstanceOpDataIdentifier(vpn.vpnOpData.getVrfId()));
        writeTx1.submit().checkedGet();
        WriteTransaction writeTx2 = broker.newWriteOnlyTransaction();
        writeTx2.delete(LogicalDatastoreType.CONFIGURATION, VpnOperDsUtils.getVpnInstanceToVpnIdIdentifier(vpn.vpnCfgData.getVpnInstanceName()));
        writeTx2.submit().checkedGet();
    }
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) L3VpnComposite(org.opendaylight.netvirt.vpnmanager.intervpnlink.L3VpnTestCatalog.L3VpnComposite)

Example 2 with L3VpnComposite

use of org.opendaylight.netvirt.vpnmanager.intervpnlink.L3VpnTestCatalog.L3VpnComposite in project netvirt by opendaylight.

the class InterVpnLinkLocatorTest method populateL3Vpns.

// ////////////
// Stubbing //
// ////////////
public void populateL3Vpns(DataBroker broker, List<L3VpnComposite> vpns) throws TransactionCommitFailedException {
    for (L3VpnComposite vpn : vpns) {
        VpnInstance vpnInstance = new VpnInstanceBuilder().setVpnId(vpn.vpnOpData.getVpnId()).setVpnInstanceName(vpn.vpnOpData.getVpnInstanceName()).setVrfId(vpn.vpnOpData.getVrfId()).build();
        WriteTransaction writeTx1 = broker.newWriteOnlyTransaction();
        writeTx1.merge(LogicalDatastoreType.CONFIGURATION, VpnOperDsUtils.getVpnInstanceToVpnIdIdentifier(vpn.vpnCfgData.getVpnInstanceName()), vpnInstance, true);
        writeTx1.submit().checkedGet();
        WriteTransaction writeTx2 = broker.newWriteOnlyTransaction();
        writeTx2.merge(LogicalDatastoreType.OPERATIONAL, VpnUtil.getVpnInstanceOpDataIdentifier(vpn.vpnOpData.getVrfId()), vpn.vpnOpData, true);
        writeTx2.submit().checkedGet();
    }
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) VpnInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstance) L3VpnComposite(org.opendaylight.netvirt.vpnmanager.intervpnlink.L3VpnTestCatalog.L3VpnComposite) VpnInstanceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstanceBuilder)

Aggregations

WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 L3VpnComposite (org.opendaylight.netvirt.vpnmanager.intervpnlink.L3VpnTestCatalog.L3VpnComposite)2 VpnInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstance)1 VpnInstanceBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstanceBuilder)1