X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=mdsalutil%2Fmdsalutil-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Fmdsalutil%2Finternal%2FMDSALManager.java;h=05accb360841696586d5ffb090c1a0c93ce768db;hb=refs%2Fchanges%2F61%2F29461%2F3;hp=5ca603cab20c0536699c4986291dc60a3b3bb7c0;hpb=f488b0d2307f0a46e5ad3cd138351309606e1d00;p=vpnservice.git diff --git a/mdsalutil/mdsalutil-impl/src/main/java/org/opendaylight/vpnservice/mdsalutil/internal/MDSALManager.java b/mdsalutil/mdsalutil-impl/src/main/java/org/opendaylight/vpnservice/mdsalutil/internal/MDSALManager.java index 5ca603ca..05accb36 100644 --- a/mdsalutil/mdsalutil-impl/src/main/java/org/opendaylight/vpnservice/mdsalutil/internal/MDSALManager.java +++ b/mdsalutil/mdsalutil-impl/src/main/java/org/opendaylight/vpnservice/mdsalutil/internal/MDSALManager.java @@ -128,6 +128,18 @@ public class MDSALManager implements AutoCloseable { } } + public CheckedFuture installFlow(BigInteger dpId, Flow flow) { + FlowKey flowKey = new FlowKey( new FlowId(flow.getId()) ); + Node nodeDpn = buildDpnNode(dpId); + InstanceIdentifier flowInstanceId = InstanceIdentifier.builder(Nodes.class) + .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) + .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class,flowKey).build(); + + WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); + modification.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, true); + return modification.submit(); + } + public void installGroup(GroupEntity groupEntity) { try { Group group = groupEntity.getGroupBuilder().build(); @@ -181,7 +193,7 @@ public class MDSALManager implements AutoCloseable { WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); - modification.delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId ); + modification.delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId); CheckedFuture submitFuture = modification.submit(); @@ -210,6 +222,18 @@ public class MDSALManager implements AutoCloseable { } } + public CheckedFuture removeFlowNew(FlowEntity flowEntity) { + s_logger.debug("Remove flow {}",flowEntity); + Node nodeDpn = buildDpnNode(flowEntity.getDpnId()); + FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId())); + InstanceIdentifier flowInstanceId = InstanceIdentifier.builder(Nodes.class) + .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) + .child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build(); + WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); + modification.delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId ); + return modification.submit(); + } + public void removeGroup(GroupEntity groupEntity) { try { Node nodeDpn = buildDpnNode(groupEntity.getDpnId());