use of org.opendaylight.mdsal.binding.api.WriteTransaction in project netvirt by opendaylight.
the class InterVpnLinkTestCatalog method populateIvpnLinks.
public static void populateIvpnLinks(DataBroker broker2, List<InterVpnLinkDataComposite> ivpnLinks) throws ExecutionException, InterruptedException {
for (InterVpnLinkDataComposite ivpnLink : ivpnLinks) {
WriteTransaction writeTx1 = broker2.newWriteOnlyTransaction();
writeTx1.merge(LogicalDatastoreType.CONFIGURATION, InterVpnLinkUtil.getInterVpnLinkPath(ivpnLink.getInterVpnLinkName()), ivpnLink.getInterVpnLinkConfig());
writeTx1.commit().get();
WriteTransaction writeTx2 = broker2.newWriteOnlyTransaction();
writeTx2.merge(LogicalDatastoreType.OPERATIONAL, InterVpnLinkUtil.getInterVpnLinkStateIid(ivpnLink.getInterVpnLinkName()), ivpnLink.getInterVpnLinkState());
writeTx2.commit().get();
}
}
use of org.opendaylight.mdsal.binding.api.WriteTransaction in project netvirt by opendaylight.
the class PolicyRouteGroupProgrammer method programPolicyClassifierGroups.
public void programPolicyClassifierGroups(String policyClassifier, List<BigInteger> localDpIds, List<BigInteger> remoteDpIds, int addOrRemove) {
if (remoteDpIds == null || remoteDpIds.isEmpty()) {
LOG.debug("No remote DPNs found for policy classifier {}", policyClassifier);
return;
}
coordinator.enqueueJob(policyClassifier, () -> {
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
remoteDpIds.forEach(remoteDpId -> programPolicyClassifierGroups(policyClassifier, localDpIds, remoteDpId, tx, addOrRemove));
return Collections.singletonList(tx.submit());
});
}
use of org.opendaylight.mdsal.binding.api.WriteTransaction in project netvirt by opendaylight.
the class PolicyRouteGroupProgrammer method programPolicyClassifierGroupBuckets.
public void programPolicyClassifierGroupBuckets(String policyClassifier, List<TunnelInterface> tunnelInterfaces, BigInteger dpId, int bucketId, int addOrRemove) {
coordinator.enqueueJob(policyClassifier, () -> {
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
programPolicyClassifierGroupBuckets(policyClassifier, tunnelInterfaces, dpId, bucketId, addOrRemove, tx);
return Collections.singletonList(tx.submit());
});
}
use of org.opendaylight.mdsal.binding.api.WriteTransaction in project netvirt by opendaylight.
the class PolicyRouteGroupProgrammer method programPolicyClassifierGroupBuckets.
public void programPolicyClassifierGroupBuckets(String policyClassifier, List<String> underlayNetworks, int addOrRemove) {
if (underlayNetworks == null) {
return;
}
coordinator.enqueueJob(policyClassifier, () -> {
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
for (int idx = 0; idx < underlayNetworks.size(); idx++) {
final int bucketId = idx;
String underlayNetwork = underlayNetworks.get(idx);
List<DpnToInterface> dpnToInterfaceList = policyServiceUtil.getUnderlayNetworkDpnToInterfaces(underlayNetwork);
dpnToInterfaceList.forEach(dpnToInterface -> {
BigInteger dpId = dpnToInterface.getDpId();
List<TunnelInterface> tunnelInterfaces = dpnToInterface.getTunnelInterface();
programPolicyClassifierGroupBuckets(policyClassifier, tunnelInterfaces, dpId, bucketId, addOrRemove, tx);
});
}
return Collections.singletonList(tx.submit());
});
}
use of org.opendaylight.mdsal.binding.api.WriteTransaction in project netvirt by opendaylight.
the class PolicyRouteFlowProgrammer method addPolicyClassifierGroup.
private void addPolicyClassifierGroup(String policyClassifierName, BigInteger localDpId, BigInteger remoteDpId, int addOrRemove, long groupId) {
coordinator.enqueueJob(policyClassifierName, () -> {
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
policyFlowUtil.updateGroupToTx(localDpId, groupId, PolicyIdManager.getPolicyClassifierGroupKey(policyClassifierName, remoteDpId), GroupTypes.GroupFf, addOrRemove, tx);
return Collections.singletonList(tx.submit());
});
}
Aggregations