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();
}
}
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();
}
}
Aggregations