/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2015 - 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
package org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md;
import java.util.Collection;
-
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance;
public class HwvtepPhysicalLocatorRemoveCommand extends AbstractTransactionCommand {
- public HwvtepPhysicalLocatorRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
+ public HwvtepPhysicalLocatorRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates,
+ DatabaseSchema dbSchema) {
super(key, updates, dbSchema);
}
public void execute(ReadWriteTransaction transaction) {
Collection<PhysicalLocator> deletedPLRows =
TyperUtils.extractRowsRemoved(PhysicalLocator.class, getUpdates(), getDbSchema()).values();
- for (PhysicalLocator pLoc : deletedPLRows) {
+ for (PhysicalLocator locator : deletedPLRows) {
final InstanceIdentifier<Node> connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier();
final InstanceIdentifier<TerminationPoint> nodePath = HwvtepSouthboundMapper
- .createInstanceIdentifier(connectionIId, pLoc);
+ .createInstanceIdentifier(connectionIId, locator);
transaction.delete(LogicalDatastoreType.OPERATIONAL, nodePath);
- getOvsdbConnectionInstance().getDeviceInfo().removePhysicalLocator(pLoc.getUuid());
+ getOvsdbConnectionInstance().getDeviceInfo().clearDeviceOperData(TerminationPoint.class, nodePath);
+
//TODO: Check if any cleanup is required
}
}
-
}