import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.vpnservice.interfacemgr.IfmUtil;
import org.opendaylight.vpnservice.interfacemgr.commons.InterfaceMetaUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.interfacemgr.meta.rev151007.bridge.ref.info.BridgeRefEntry;
OvsdbBridgeAugmentation bridgeOld, DataBroker dataBroker) {
List<ListenableFuture<Void>> futures = new ArrayList<>();
WriteTransaction t = dataBroker.newWriteOnlyTransaction();;
+ BigInteger dpnId = IfmUtil.getDpnId(bridgeOld.getDatapathId());
- String dpId = bridgeOld.getDatapathId().getValue().replaceAll("[^\\d.]", "");
- if (dpId == null) {
+ if (dpnId == null) {
LOG.warn("Got Null DPID for Bridge: {}", bridgeOld);
return futures;
}
-
- dpId = dpId.replaceAll("[^\\d.]", "");
- BigInteger ovsdbDpId = new BigInteger(dpId,16);
- BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(ovsdbDpId);
+ BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(dpnId);
InstanceIdentifier<BridgeRefEntry> bridgeEntryId =
InterfaceMetaUtils.getBridgeRefEntryIdentifier(bridgeRefEntryKey);
t.delete(LogicalDatastoreType.OPERATIONAL, bridgeEntryId);