/*
- * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 - 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,
import java.util.Set;
import org.opendaylight.controller.md.sal.binding.api.ClusteredDataChangeListener;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataChangeListenerBase;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.utils.clustering.ClusteringUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
List<Devices> l2Devices = input.getDevices();
for (Devices l2Device : l2Devices) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Adding L2gateway device: {}", l2Device);
- }
+ LOG.trace("Adding L2gateway device: {}", l2Device);
addL2Device(l2Device, input);
}
}
List<Devices> l2Devices = input.getDevices();
for (Devices l2Device : l2Devices) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Removing L2gateway device: {}", l2Device);
- }
+ LOG.trace("Removing L2gateway device: {}", l2Device);
removeL2Device(l2Device, input);
}
}
@Override
protected void update(InstanceIdentifier<L2gateway> identifier, L2gateway original, L2gateway update) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Updating L2gateway : key: " + identifier + ", original value=" + original + ", update value="
- + update);
- }
+ LOG.trace("Updating L2gateway : key: {}, original value={}, update value={}", identifier, original, update);
}
private void addL2Device(Devices l2Device, L2gateway input) {
// Delete ITM tunnels if it's last Gateway deleted and device is connected
// Also, do not delete device from cache if it's connected
if (L2GatewayUtils.isLastL2GatewayBeingDeleted(l2GwDevice)) {
- if(l2GwDevice.isConnected()){
+ if (l2GwDevice.isConnected()) {
l2GwDevice.removeL2GatewayId(input.getUuid());
// Delete ITM tunnels
final String hwvtepId = l2GwDevice.getHwvtepNodeId();
// Cleaning up the config DS
NodeId nodeId = new NodeId(l2GwDevice.getHwvtepNodeId());
NodeId psNodeId = HwvtepSouthboundUtils.createManagedNodeId(nodeId, l2DeviceName);
- MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, HwvtepSouthboundUtils.createInstanceIdentifier(nodeId));
- MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, HwvtepSouthboundUtils.createInstanceIdentifier(psNodeId));
+ MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION,
+ HwvtepSouthboundUtils.createInstanceIdentifier(nodeId));
+ MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION,
+ HwvtepSouthboundUtils.createInstanceIdentifier(psNodeId));
}
} else {