+ InstanceIdentifier<LearntVpnVipToPort> id = buildLearntVpnVipToPortIdentifier(vpnName, prefix);
+ MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
+ LOG.info("removeMipAdjAndLearntIp: Delete learned ARP for fixedIp: {}, vpn {} removed from"
+ + "VpnPortipToPort DS", prefix, vpnName);
+ } catch (Exception e) {
+ LOG.error("removeMipAdjAndLearntIp: Exception Deleting learned Ip: {} interface {} vpn {} from "
+ + "LearntVpnPortipToPort DS", prefix, vpnInterface, vpnName, e);
+ } finally {
+ lock.unlock();
+ }
+ VpnUtil.removeVpnPortFixedIpToPort(dataBroker, vpnName, prefix, null);
+ }
+
+ public void removeMipAdjacency(String vpnName, String vpnInterface, String prefix,
+ TypedWriteTransaction<Configuration> writeConfigTxn) {
+ String ip = VpnUtil.getIpPrefix(prefix);
+ LOG.trace("Removing {} adjacency from Old VPN Interface {} ", ip, vpnInterface);
+ InstanceIdentifier<VpnInterface> vpnIfId = VpnUtil.getVpnInterfaceIdentifier(vpnInterface);
+ InstanceIdentifier<Adjacencies> path = vpnIfId.augmentation(Adjacencies.class);
+ //TODO: Remove synchronized?
+
+ Optional<Adjacencies> adjacencies = read(LogicalDatastoreType.OPERATIONAL, path);
+ if (adjacencies.isPresent()) {
+ InstanceIdentifier<Adjacency> adjacencyIdentifier = getAdjacencyIdentifier(vpnInterface, prefix);
+ writeConfigTxn.delete(adjacencyIdentifier);
+ LOG.error("removeMipAdjacency: Successfully Deleted Adjacency {} from interface {} vpn {}", ip,
+ vpnInterface, vpnName);