import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Singleton;
-
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase;
-import org.opendaylight.genius.utils.hwvtep.HwvtepHACache;
+import org.opendaylight.genius.utils.hwvtep.HwvtepNodeHACache;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.netvirt.elan.l2gw.ha.HwvtepHAUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
private static final Logger LOG = LoggerFactory.getLogger(ManagerListener.class);
private final DataBroker dataBroker;
+ private final HwvtepNodeHACache hwvtepNodeHACache;
@Inject
- public ManagerListener(DataBroker dataBroker) {
+ public ManagerListener(DataBroker dataBroker, HwvtepNodeHACache hwvtepNodeHACache) {
this.dataBroker = dataBroker;
+ this.hwvtepNodeHACache = hwvtepNodeHACache;
}
@PostConstruct
.filter(otherConfig -> otherConfig.getKey().getOtherConfigKey().contains(HwvtepHAUtil.HA_CHILDREN))
.flatMap(otherConfig -> Arrays.stream(otherConfig.getOtherConfigValue().split(",")))
.map(HwvtepHAUtil::convertToInstanceIdentifier)
- .forEach(childIid -> HwvtepHACache.getInstance().addChild(parent, childIid));
+ .forEach(childIid -> hwvtepNodeHACache.addChild(parent, childIid));
}
}