import java.util.Optional;
import javax.inject.Inject;
import javax.inject.Singleton;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.genius.itm.itmdirecttunnels.workers.TunnelStateAddWorker;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.DpnEndpoints;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
*/
package org.opendaylight.genius.itm.cli;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.MoreExecutors;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.commons.lang3.StringUtils;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.RetryingManagedNewTransactionRunner;
import org.opendaylight.genius.itm.cache.UnprocessedTunnelsStateCache;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.RetryingManagedNewTransactionRunner;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
.setTunnelType(tunType)
.withKey(new TransportZoneKey(transportZoneName)).build();*/
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.CONFIGURATION,
- path, transportZones)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.put(path, transportZones)).get();
}
import java.util.List;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.api.IITMProvider;
import org.opendaylight.genius.itm.impl.ItmUtils;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.TransportZones;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeBase;
package org.opendaylight.genius.itm.confighelpers;
import static java.util.Collections.singletonList;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import com.google.common.util.concurrent.ListenableFuture;
import java.time.Duration;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.OfEndPointCache;
import org.opendaylight.genius.itm.cache.OvsBridgeRefEntryCache;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
monitorInterval = tunnelMonitoringConfig.getMonitorInterval();
}
- public List<ListenableFuture<Void>> buildAllTunnels(IMdsalApiManager mdsalManager, List<DPNTEPsInfo> cfgdDpnList,
- Collection<DPNTEPsInfo> meshedDpnList) {
+ public List<? extends ListenableFuture<?>> buildAllTunnels(IMdsalApiManager mdsalManager,
+ List<DPNTEPsInfo> cfgdDpnList,
+ Collection<DPNTEPsInfo> meshedDpnList) {
LOG.trace("Building tunnels with DPN List {} " , cfgdDpnList);
if (null == cfgdDpnList || cfgdDpnList.isEmpty()) {
LOG.error(" Build Tunnels was invoked with empty list");
}
@Override
- public List<ListenableFuture<Void>> call() {
+ public List<? extends ListenableFuture<?>> call() {
return singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
//The logical tunnel interface be created only when the first tunnel interface on each OVS is created
InternalTunnel tunnel = ItmUtils.ITM_CACHE.getInternalTunnel(logicTunnelGroupName);
package org.opendaylight.genius.itm.confighelpers;
import static java.util.Collections.singletonList;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collection;
import java.util.concurrent.ExecutionException;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.genius.cloudscaler.api.TombstonedNodeManager;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.cache.OfEndPointCache;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
}
@SuppressWarnings("checkstyle:IllegalCatch")
- public List<ListenableFuture<Void>> deleteTunnels(IMdsalApiManager mdsalManager,
+ public List<? extends ListenableFuture<?>> deleteTunnels(IMdsalApiManager mdsalManager,
Collection<DPNTEPsInfo> dpnTepsList, Collection<DPNTEPsInfo> meshedDpnList) {
LOG.trace("TEPs to be deleted {} " , dpnTepsList);
return Collections.singletonList(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
}
@Override
- public List<ListenableFuture<Void>> call() {
+ public List<? extends ListenableFuture<?>> call() {
Collection<InternalTunnel> tunnels = ItmUtils.ITM_CACHE.getAllInternalTunnel();
//The logical tunnel interface be removed only when the last tunnel interface on each OVS is deleted
}
}
if (emptyTunnelGroup && foundLogicGroupIface) {
- return singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
+ return singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: remove the logical tunnel group {} because a last tunnel"
+ " interface on srcDpnId {} dstDpnId {} is removed", logicTunnelName, srcDpnId, dstDpnId);
InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(logicTunnelName);
- tx.delete(LogicalDatastoreType.CONFIGURATION, trunkIdentifier);
+ tx.delete(trunkIdentifier);
ItmUtils.ITM_CACHE.removeInterface(logicTunnelName);
InstanceIdentifier<InternalTunnel> path = InstanceIdentifier.create(TunnelList.class)
.child(InternalTunnel.class,
new InternalTunnelKey(dstDpnId, srcDpnId, TunnelTypeLogicalGroup.class));
- tx.delete(LogicalDatastoreType.CONFIGURATION, path);
+ tx.delete(path);
ItmUtils.ITM_CACHE.removeInternalTunnel(logicTunnelName);
}));
} else if (!emptyTunnelGroup) {
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnelBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorInterval;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorIntervalBuilder;
import org.slf4j.LoggerFactory;
public class ItmMonitorIntervalWorker implements Callable<List<? extends ListenableFuture<?>>> {
-
private static final Logger LOG = LoggerFactory.getLogger(ItmMonitorIntervalWorker.class) ;
private final DataBroker dataBroker;
}
@Override
- public List<ListenableFuture<Void>> call() {
+ public List<? extends ListenableFuture<?>> call() {
LOG.debug("Invoking Tunnel Monitor Worker tzone = {} Interval= {}",tzone,interval);
return toggleTunnelMonitoring();
}
- private List<ListenableFuture<Void>> toggleTunnelMonitoring() {
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ private List<? extends ListenableFuture<?>> toggleTunnelMonitoring() {
+ List<ListenableFuture<?>> futures = new ArrayList<>();
List<String> tunnelList = ItmUtils.getInternalTunnelInterfaces(dataBroker);
LOG.debug("ItmMonitorIntervalWorker toggleTunnelMonitoring: List of tunnel interfaces: {}" , tunnelList);
InstanceIdentifier<TunnelMonitorInterval> iid = InstanceIdentifier.create(TunnelMonitorInterval.class);
return futures;
}
- private void toggle(String tunnelInterfaceName, TypedWriteTransaction tx) {
+ private void toggle(String tunnelInterfaceName, TypedWriteTransaction<?> tx) {
if (tunnelInterfaceName != null) {
LOG.debug("tunnel {} will have monitor interval {}", tunnelInterfaceName, interval);
tx.merge(ItmUtils.buildTunnelId(tunnelInterfaceName),
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnelBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelMonitoringTypeBase;
LOG.debug("TunnelMonitorToggleWorker with monitor protocol = {} ",monitorProtocol);
}
- @Override public List<ListenableFuture<Void>> call() {
+ @Override
+ public List<? extends ListenableFuture<?>> call() {
LOG.debug("ItmMonitorToggleWorker invoked with tzone = {} enabled {}",tzone,enabled);
return toggleTunnelMonitoring();
}
- private List<ListenableFuture<Void>> toggleTunnelMonitoring() {
+ private List<? extends ListenableFuture<?>> toggleTunnelMonitoring() {
List<String> tunnelList = ItmUtils.getInternalTunnelInterfaces(dataBroker);
LOG.debug("toggleTunnelMonitoring: TunnelList size {}", tunnelList.size());
InstanceIdentifier<TunnelMonitorParams> iid = InstanceIdentifier.create(TunnelMonitorParams.class);
TunnelMonitorParams monitorParams = new TunnelMonitorParamsBuilder()
.setEnabled(enabled).setMonitorProtocol(monitorProtocol).build();
LOG.debug("toggleTunnelMonitoring: Updating Operational DS");
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ List<ListenableFuture<?>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
tx -> tx.merge(iid, monitorParams)));
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
import java.util.List;
import java.util.Optional;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.cache.OvsBridgeRefEntryCache;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelMonitoringTypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorInterval;
}
@Override
- public List<ListenableFuture<Void>> call() {
+ public List<? extends ListenableFuture<?>> call() {
LOG.debug("ItmMonitorWorker invoked with tzone = {} enabled {}", tzone, enabled);
- List<ListenableFuture<Void>> futures = new ArrayList<>();
- return toggleTunnelMonitoring(futures);
+ return toggleTunnelMonitoring();
}
- private List<ListenableFuture<Void>> toggleTunnelMonitoring(List<ListenableFuture<Void>> futures) {
+ private List<? extends ListenableFuture<?>> toggleTunnelMonitoring() {
+ List<ListenableFuture<?>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
tx -> updateOperationalDS(tx)));
Collection<DpnsTeps> dpnsTepsCollection = dpnTepStateCache.getAllPresent();
LOG.debug("toggleTunnelMonitoring: DpnsTepsList size {}", dpnsTepsCollection.size());
if (dpnsTepsCollection.isEmpty()) {
LOG.info("There are no teps configured");
- }
- else {
+ } else {
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> {
for (DpnsTeps dpnTeps : dpnsTepsCollection) {
*/
package org.opendaylight.genius.itm.confighelpers;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.DcGatewayIpList;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
}
@Override
- public List<ListenableFuture<Void>> call() {
- List<ListenableFuture<Void>> futures = new ArrayList<>() ;
+ public List<? extends ListenableFuture<?>> call() {
+ List<ListenableFuture<?>> futures = new ArrayList<>() ;
this.meshedDpnList = ItmUtils.getDpnTEPsInfos(dataBroker);
LOG.debug("Invoking Internal Tunnel build method with Configured DpnList {} ; Meshed DpnList {} ",
cfgdDpnList, meshedDpnList);
*/
package org.opendaylight.genius.itm.confighelpers;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.Optional;
import java.util.concurrent.Callable;
import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.dpn.teps.info.TunnelEndPoints;
}
@Override
- public List<ListenableFuture<Void>> call() {
- List<ListenableFuture<Void>> futures = new ArrayList<>() ;
+ public List<? extends ListenableFuture<?>> call() {
+ List<ListenableFuture<?>> futures = new ArrayList<>() ;
this.meshedDpnList = dpnTEPsInfoCache.getAllPresent();
futures.addAll(itmInternalTunnelDeleteWorker.deleteTunnels(mdsalManager, delDpnList, meshedDpnList));
LOG.debug("Invoking Internal Tunnel delete method with DpnList to be deleted {} ; Meshed DpnList {} ",
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVteps;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsKey;
import org.slf4j.Logger;
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
LOG.trace("Add TEP into TepsNotHosted list task is picked from DataStoreJobCoordinator for execution.");
// Add TEP to TepsNotHosted list.
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Vteps;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.slf4j.Logger;
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
LOG.trace("Move TEP from TepsNotHosted list to NBI configured TZ task is picked from "
+ "DataStoreJobCoordinator for execution.");
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.slf4j.Logger;
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
LOG.trace("Remove TEP from TepsNotHosted list task is picked from DataStoreJobCoordinator for execution.");
// Remove TEP from TepsNotHosted list.
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.itm.confighelpers;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
-import static org.opendaylight.genius.infra.Datastore.OPERATIONAL;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL;
import com.google.common.util.concurrent.ListenableFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.Datastore.Operational;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedReadTransaction;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo.InterfaceAdminState;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.Datastore.Operational;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedReadTransaction;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.Tunnel;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.AdminStatus;
}
@Override
- public List<ListenableFuture<Void>> call() {
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ public List<? extends ListenableFuture<?>> call() {
+ List<ListenableFuture<?>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, confTx -> {
if (ifaceAction == MOD_GROUP_TUNNEL) {
updateTunnelAggregationGroup(confTx, parentEntry);
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.NotHostedTransportZones;
* @param txRunner ManagedTransactionRunner object
*/
- public static List<ListenableFuture<Void>> addTepReceivedFromOvsdb(String tepIp, String strDpnId, String tzName,
- boolean ofTunnel, DataBroker dataBroker,
- ManagedNewTransactionRunner txRunner)
- throws Exception {
+ public static List<? extends ListenableFuture<?>> addTepReceivedFromOvsdb(String tepIp, String strDpnId,
+ String tzName, boolean ofTunnel,
+ DataBroker dataBroker,
+ ManagedNewTransactionRunner txRunner)
+ throws Exception {
Uint64 dpnId = Uint64.ZERO;
if (strDpnId != null && !strDpnId.isEmpty()) {
}
}
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ List<ListenableFuture<?>> futures = new ArrayList<>();
final Uint64 id = dpnId;
final String name = tzName;
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
addVtepInITMConfigDS(vtepList, ipAdd, tzName, dpnId, ofTunnel, tx);
}
- private static List<ListenableFuture<Void>> addUnknownTzTepIntoTepsNotHostedAndReturnFutures(String tzName,
+ private static List<? extends ListenableFuture<?>> addUnknownTzTepIntoTepsNotHostedAndReturnFutures(String tzName,
IpAddress tepIpAddress, Uint64 id, boolean ofTunnel,
DataBroker dataBroker, ManagedNewTransactionRunner txRunner) {
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
LOG.trace("Add TEP task is picked from DataStoreJobCoordinator for execution.");
// add TEP received from southbound OVSDB into ITM config DS.
return OvsdbTepAddConfigHelper.addTepReceivedFromOvsdb(tepIp, strDpid, tzName, ofTunnel, dataBroker, txRunner);
import java.util.Map;
import java.util.Objects;
import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.NotHostedTransportZones;
* @param dataBroker data broker handle to perform operations on config/operational datastore
* @param txRunner ManagedNewTransactionRunner object
*/
-
- public static List<ListenableFuture<Void>> removeTepReceivedFromOvsdb(String tepIp, String strDpnId, String tzName,
- DataBroker dataBroker,
- ManagedNewTransactionRunner txRunner) {
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ public static List<? extends ListenableFuture<?>> removeTepReceivedFromOvsdb(String tepIp, String strDpnId,
+ String tzName, DataBroker dataBroker,
+ ManagedNewTransactionRunner txRunner) {
+ List<ListenableFuture<?>> futures = new ArrayList<>();
Uint64 dpnId = Uint64.ZERO;
LOG.trace("Remove TEP: TEP-IP: {}, TZ name: {}, DPID: {}", tepIp, tzName, strDpnId);
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
import java.util.concurrent.Callable;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
LOG.trace("Remove TEP task is picked from DataStoreJobCoordinator for execution.");
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.Tunnel;
private ItmUtils() {
}
- public static final FutureCallback<Void> DEFAULT_WRITE_CALLBACK = new FutureCallback<>() {
+ public static final FutureCallback<Object> DEFAULT_WRITE_CALLBACK = new FutureCallback<>() {
@Override
- public void onSuccess(Void result) {
+ public void onSuccess(Object result) {
LOG.debug("Success in Datastore write operation");
}
//ITM cleanup:portname and vlanId are removed, causes change in generated
//interface name: This has upgrade impact
+ @Deprecated
public static String getInterfaceName(final Uint64 datapathid, final String portName, final Integer vlanId) {
return datapathid + ":" + portName + ":" + vlanId;
}
if (transportZonesOptional.isPresent()) {
TransportZones tzones = transportZonesOptional.get();
for (TransportZone tzone : tzones.getTransportZone()) {
- List<Vteps> vtepList = new ArrayList<Vteps>(tzone.nonnullVteps().values());
+ List<Vteps> vtepList = new ArrayList<>(tzone.nonnullVteps().values());
if (vtepList != null && !vtepList.isEmpty()) {
for (Vteps vtep : vtepList) {
if (vtep.getDpnId().equals(dpid)) {
*/
package org.opendaylight.genius.itm.itmdirecttunnels.listeners;
+import static org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL;
+
import com.google.common.util.concurrent.ListenableFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collections;
import java.util.concurrent.Callable;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.cache.BfdStateCache;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.cache.TunnelStateCache;
import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore.Operational;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractClusteredSyncDataTreeChangeListener;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
&& stateTnl.get().getOperState() != tunnelState) {
LOG.debug("updating tunnel state for interface {} as {}", interfaceName,
stateTnl.get().getOperState());
- return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL,
tx -> updateOpState(tx, interfaceName, tunnelState)));
}
return Collections.emptyList();
* update operational state of interface based on events like tunnel
* monitoring
*/
- private static void updateOpState(WriteTransaction transaction, String interfaceName, TunnelOperStatus operStatus) {
+ private static void updateOpState(TypedWriteTransaction<@NonNull Operational> tx, String interfaceName,
+ TunnelOperStatus operStatus) {
StateTunnelListKey stateTnlKey = new StateTunnelListKey(interfaceName);
InstanceIdentifier<StateTunnelList> stateTnlII = ItmUtils.buildStateTunnelListId(stateTnlKey);
LOG.debug("updating tep interface state as {} for {}", operStatus.name(), interfaceName);
StateTunnelListBuilder stateTnlBuilder = new StateTunnelListBuilder().withKey(stateTnlKey);
stateTnlBuilder.setOperState(operStatus);
- transaction.mergeParentStructureMerge(LogicalDatastoreType.OPERATIONAL, stateTnlII, stateTnlBuilder.build());
+ tx.mergeParentStructureMerge(stateTnlII, stateTnlBuilder.build());
}
private class RendererTunnelStateUpdateWorker implements Callable<List<? extends ListenableFuture<?>>> {
*/
package org.opendaylight.genius.itm.itmdirecttunnels.listeners;
-import static org.opendaylight.genius.infra.Datastore.OPERATIONAL;
+import static org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL;
import com.google.common.util.concurrent.ListenableFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.genius.infra.Datastore.Operational;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.cache.TunnelStateCache;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore.Operational;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.serviceutils.tools.listener.AbstractClusteredSyncDataTreeChangeListener;
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "https://github.com/spotbugs/spotbugs/issues/811")
- private List<ListenableFuture<Void>> updateState(String interfaceName,
+ private List<? extends ListenableFuture<?>> updateState(String interfaceName,
FlowCapableNodeConnector flowCapableNodeConnectorNew,
FlowCapableNodeConnector flowCapableNodeConnectorOld) {
LOG.debug("Updating interface state for port: {}", interfaceName);
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "https://github.com/spotbugs/spotbugs/issues/811")
- private List<ListenableFuture<Void>> removeInterfaceStateConfiguration(NodeConnectorId nodeConnectorId,
- String interfaceName,
- FlowCapableNodeConnector
- flowCapableNodeConnector) {
+ private List<? extends ListenableFuture<?>> removeInterfaceStateConfiguration(NodeConnectorId nodeConnectorId,
+ String interfaceName,
+ FlowCapableNodeConnector
+ flowCapableNodeConnector) {
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ List<ListenableFuture<?>> futures = new ArrayList<>();
Uint64 dpId = DirectTunnelUtils.getDpnFromNodeConnectorId(nodeConnectorId);
// In a genuine port delete scenario, the reason will be there in the incoming event, for all remaining
// cases treat the event as DPN disconnect, if old and new ports are same. Else, this is a VM migration
}
@Override
- public List<ListenableFuture<Void>> call() {
+ public List<? extends ListenableFuture<?>> call() {
// If another renderer(for eg : OVS) needs to be supported, check can be performed here
// to call the respective helpers.
return updateState(interfaceName, fcNodeConnectorNew, fcNodeConnectorOld);
}
@Override
- public List<ListenableFuture<Void>> call() {
+ public List<? extends ListenableFuture<?>> call() {
// If another renderer(for eg : OVS) needs to be supported, check can be performed here
// to call the respective helpers.
return removeInterfaceStateConfiguration(nodeConnectorId, interfaceName, flowCapableNodeConnector);
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
// If another renderer(for eg : OVS) needs to be supported, check can be performed here
// to call the respective helpers.
EVENT_LOGGER.debug("ITM-TunnelInventoryState, Compute Re-connected, ADD received for {} ", tunnelName);
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "https://github.com/spotbugs/spotbugs/issues/811")
- private List<ListenableFuture<Void>> handleInterfaceStateOnReconnect(String interfaceName) {
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ private List<? extends ListenableFuture<?>> handleInterfaceStateOnReconnect(String interfaceName) {
+ List<ListenableFuture<?>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
DpnTepInterfaceInfo dpnTepInfo = dpnTepStateCache.getTunnelFromCache(interfaceName);
import java.util.concurrent.Callable;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.cache.OvsBridgeEntryCache;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.Datastore.Operational;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractClusteredSyncDataTreeChangeListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel;
*/
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "https://github.com/spotbugs/spotbugs/issues/811")
- private List<ListenableFuture<Void>> updateOvsBridgeRefEntry(InstanceIdentifier<OvsdbBridgeAugmentation> bridgeIid,
- OvsdbBridgeAugmentation bridgeNew,
- OvsdbBridgeAugmentation bridgeOld) {
+ private List<? extends ListenableFuture<?>> updateOvsBridgeRefEntry(
+ InstanceIdentifier<OvsdbBridgeAugmentation> bridgeIid,
+ OvsdbBridgeAugmentation bridgeNew, OvsdbBridgeAugmentation bridgeOld) {
- return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
- Uint64 dpnIdNew = directTunnelUtils.getDpnId(bridgeNew.getDatapathId());
- Uint64 dpnIdOld = directTunnelUtils.getDpnId(bridgeOld.getDatapathId());
+ return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
+ tx -> {
+ Uint64 dpnIdNew = directTunnelUtils.getDpnId(bridgeNew.getDatapathId());
+ Uint64 dpnIdOld = directTunnelUtils.getDpnId(bridgeOld.getDatapathId());
- LOG.debug("updating bridge references for bridge: {}, dpnNew: {}, dpnOld: {}", bridgeNew,
- dpnIdNew, dpnIdOld);
- //delete bridge reference entry for the old dpn in interface meta operational DS
- deleteOvsBridgeRefEntry(dpnIdOld, tx);
+ LOG.debug("updating bridge references for bridge: {}, dpnNew: {}, dpnOld: {}", bridgeNew,
+ dpnIdNew, dpnIdOld);
+ //delete bridge reference entry for the old dpn in interface meta operational DS
+ deleteOvsBridgeRefEntry(dpnIdOld, tx);
- // create bridge reference entry in interface meta operational DS
- createOvsBridgeRefEntry(dpnIdNew, bridgeIid, tx);
+ // create bridge reference entry in interface meta operational DS
+ createOvsBridgeRefEntry(dpnIdNew, bridgeIid, tx);
- // handle pre-provisioning of tunnels for the newly connected dpn
- Optional<OvsBridgeEntry> bridgeEntry = null;
- bridgeEntry = ovsBridgeEntryCache.get(dpnIdNew);
- if (bridgeEntry.isPresent()) {
- addAllPortsToBridge(bridgeEntry.get(), bridgeIid, bridgeNew);
- }
- }));
+ // handle pre-provisioning of tunnels for the newly connected dpn
+ Optional<OvsBridgeEntry> bridgeEntry = null;
+ bridgeEntry = ovsBridgeEntryCache.get(dpnIdNew);
+ if (bridgeEntry.isPresent()) {
+ addAllPortsToBridge(bridgeEntry.get(), bridgeIid, bridgeNew);
+ }
+ }));
}
- public List<ListenableFuture<Void>> removePortFromBridge(InstanceIdentifier<OvsdbBridgeAugmentation> bridgeIid,
- OvsdbBridgeAugmentation bridgeOld) {
+ public List<? extends ListenableFuture<?>> removePortFromBridge(
+ InstanceIdentifier<OvsdbBridgeAugmentation> bridgeIid, OvsdbBridgeAugmentation bridgeOld) {
Uint64 dpnId = directTunnelUtils.getDpnId(bridgeOld.getDatapathId());
if (dpnId == null) {
LOG.warn("Got Null DPID for Bridge: {}", bridgeOld);
return Collections.emptyList();
}
- return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
+ return List.of(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL, tx -> {
LOG.debug("removing bridge references for bridge: {}, dpn: {}", bridgeOld, dpnId);
EVENT_LOGGER.debug("ITM-TunnelTopologyState, REMOVE {} completed", bridgeOld.getBridgeName().getValue());
//delete bridge reference entry in interface meta operational DS
deleteOvsBridgeRefEntry(dpnId, tx);
-
+ }), txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION, tx -> {
// the bridge reference is copied to dpn-tunnel interfaces map, so that whenever a northbound delete
// happens when bridge is not connected, we need the bridge reference to clean up the topology config DS
addBridgeRefToBridgeTunnelEntry(dpnId, new OvsdbBridgeRef(bridgeIid), tx);
}));
}
- private void createOvsBridgeRefEntry(Uint64 dpnId, InstanceIdentifier<?> bridgeIid, WriteTransaction tx) {
- LOG.debug("Creating bridge ref entry for dpn: {} bridge: {}",
- dpnId, bridgeIid);
+ private void createOvsBridgeRefEntry(Uint64 dpnId, InstanceIdentifier<?> bridgeIid,
+ TypedWriteTransaction<@NonNull Operational> tx) {
+ LOG.debug("Creating bridge ref entry for dpn: {} bridge: {}", dpnId, bridgeIid);
OvsBridgeRefEntryKey bridgeRefEntryKey = new OvsBridgeRefEntryKey(dpnId);
InstanceIdentifier<OvsBridgeRefEntry> bridgeEntryId =
DirectTunnelUtils.getOvsBridgeRefEntryIdentifier(bridgeRefEntryKey);
OvsBridgeRefEntryBuilder tunnelDpnBridgeEntryBuilder =
new OvsBridgeRefEntryBuilder().withKey(bridgeRefEntryKey).setDpid(dpnId)
.setOvsBridgeReference(new OvsdbBridgeRef(bridgeIid));
- tx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, bridgeEntryId,
- tunnelDpnBridgeEntryBuilder.build());
+ tx.mergeParentStructurePut(bridgeEntryId, tunnelDpnBridgeEntryBuilder.build());
}
- private void deleteOvsBridgeRefEntry(Uint64 dpnId, WriteTransaction tx) {
- LOG.debug("Deleting bridge ref entry for dpn: {}",
- dpnId);
+ private void deleteOvsBridgeRefEntry(Uint64 dpnId, TypedWriteTransaction<@NonNull Operational> tx) {
+ LOG.debug("Deleting bridge ref entry for dpn: {}", dpnId);
OvsBridgeRefEntryKey bridgeRefEntryKey = new OvsBridgeRefEntryKey(dpnId);
InstanceIdentifier<OvsBridgeRefEntry> bridgeEntryId =
DirectTunnelUtils.getOvsBridgeRefEntryIdentifier(bridgeRefEntryKey);
- tx.delete(LogicalDatastoreType.OPERATIONAL, bridgeEntryId);
+ tx.delete(bridgeEntryId);
}
- private void addBridgeRefToBridgeTunnelEntry(Uint64 dpId, OvsdbBridgeRef ovsdbBridgeRef, WriteTransaction tx) {
+ private void addBridgeRefToBridgeTunnelEntry(Uint64 dpId, OvsdbBridgeRef ovsdbBridgeRef,
+ TypedWriteTransaction<@NonNull Configuration> tx) {
OvsBridgeEntryKey bridgeEntryKey = new OvsBridgeEntryKey(dpId);
InstanceIdentifier<OvsBridgeEntry> bridgeEntryInstanceIdentifier =
DirectTunnelUtils.getOvsBridgeEntryIdentifier(bridgeEntryKey);
OvsBridgeEntryBuilder bridgeEntryBuilder = new OvsBridgeEntryBuilder().withKey(bridgeEntryKey)
.setOvsBridgeReference(ovsdbBridgeRef);
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, bridgeEntryInstanceIdentifier,
- bridgeEntryBuilder.build());
+ tx.mergeParentStructureMerge(bridgeEntryInstanceIdentifier, bridgeEntryBuilder.build());
}
/*
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
// If another renderer(for eg : OVS) needs to be supported, check can be performed here
// to call the respective helpers.
if (bridgeNew.getDatapathId() == null) {
EVENT_LOGGER.debug("TunnelTopologyState, ADD bridge {} for {}", bridgeNew.getBridgeName(), dpnId);
// create bridge reference entry in interface meta operational DS
- return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
- createOvsBridgeRefEntry(dpnId, bridgeIid, tx);
- // handle pre-provisioning of tunnels for the newly connected dpn
- Optional<OvsBridgeEntry> bridgeEntry = ovsBridgeEntryCache.get(dpnId);
- if (!bridgeEntry.isPresent()) {
- LOG.debug("Bridge entry not found in config DS for dpn: {}", dpnId);
- } else {
- addAllPortsToBridge(bridgeEntry.get(), bridgeIid, bridgeNew);
- }
- }));
+ return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
+ tx -> {
+ createOvsBridgeRefEntry(dpnId, bridgeIid, tx);
+ // handle pre-provisioning of tunnels for the newly connected dpn
+ Optional<OvsBridgeEntry> bridgeEntry = ovsBridgeEntryCache.get(dpnId);
+ if (!bridgeEntry.isPresent()) {
+ LOG.debug("Bridge entry not found in config DS for dpn: {}", dpnId);
+ } else {
+ addAllPortsToBridge(bridgeEntry.get(), bridgeIid, bridgeNew);
+ }
+ }));
}
}
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
// If another renderer needs to be supported, check can be performed here
// to call the respective helpers.
return removePortFromBridge(instanceIdentifier, bridgeNew);
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
// If another renderer(for eg : OVS) needs to be supported, check can be performed here
// to call the respective helpers.
return updateOvsBridgeRefEntry(instanceIdentifier, bridgeNew, bridgeOld);
import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ITMBatchingUtils;
import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.infrautils.utils.concurrent.NamedLocks;
import org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ITMBatchingUtils;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.genius.itm.utils.DpnTepInterfaceInfo;
import org.opendaylight.genius.itm.utils.TunnelStateInfo;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.meta.rev171210.IfIndexesTunnelMap;
this.txRunner = txRunner;
}
- public List<ListenableFuture<Void>> addState(TunnelStateInfo tunnelStateInfo)
+ public List<? extends ListenableFuture<?>> addState(TunnelStateInfo tunnelStateInfo)
throws ExecutionException, InterruptedException, OperationFailedException {
// When this method is invoked, all parameters necessary should be available
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
// If another renderer(for eg : OVS) needs to be supported, check can be performed here
// to call the respective helpers.
return tunnelStateAddWorker.addState(tunnelStateInfo);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.itm.listeners;
import com.google.common.util.concurrent.FluentFuture;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.genius.cloudscaler.api.TombstonedNodeManager;
import org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.srm.RecoverableListener;
import org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.cache.OvsBridgeRefEntryCache;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractSyncDataTreeChangeListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorInterval;
import javax.inject.Singleton;
import javax.management.JMException;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.cache.UnprocessedTunnelsStateCache;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractSyncDataTreeChangeListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.TunnelOperStatus;
}
@Override
- public List<ListenableFuture<Void>> call() throws Exception {
+ public List<? extends ListenableFuture<?>> call() throws Exception {
// Process any unprocessed interface bfd updates
LOG.debug(" Tunnel events are processed out order for {} hence updating it from cache",
add.getTunnelInterfaceName());
*/
package org.opendaylight.genius.itm.recovery.impl;
-import static org.opendaylight.genius.infra.Datastore.OPERATIONAL;
+import static org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.ExecutionException;
import javax.inject.Inject;
import javax.inject.Singleton;
-import org.opendaylight.genius.infra.Datastore.Operational;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.cache.TunnelStateCache;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.genius.itm.itmdirecttunnels.renderer.ovs.utilities.DirectTunnelUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore.Operational;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.TunnelOperStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.tunnels_state.StateTunnelList;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.genius.cloudscaler.api.TombstonedNodeManager;
import org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.srm.ServiceRecoveryInterface;
import org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry;
*/
package org.opendaylight.genius.itm.recovery.impl;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
+
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import javax.inject.Singleton;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.itm.cache.DpnTepStateCache;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.serviceutils.srm.ServiceRecoveryInterface;
if (tz != null) {
LOG.trace("deleting transportzone instance {}", entityId);
jobCoordinator.enqueueJob(entityId, () -> Collections.singletonList(
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- tx -> tx.delete(LogicalDatastoreType.CONFIGURATION, tzII))), ITMConstants.JOB_MAX_RETRIES);
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.delete(tzII))),
+ ITMConstants.JOB_MAX_RETRIES);
AtomicInteger eventCallbackCount = new AtomicInteger(0);
if (!tunnelList.isEmpty()) {
tunnelList.forEach(tunnelInterface -> {
if (registeredEvents.intValue() == sizeOfTunnelList || sizeOfTunnelList == 0) {
LOG.trace("recreating transportzone instance {}", entityId);
jobCoordinator.enqueueJob(entityId, () -> Collections.singletonList(
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- tx -> tx.merge(LogicalDatastoreType.CONFIGURATION, tzII, tz))),
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.merge(tzII, tz))),
ITMConstants.JOB_MAX_RETRIES);
}
}
*/
package org.opendaylight.genius.itm.rpc;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import static org.opendaylight.serviceutils.tools.rpc.FutureRpcResults.fromListenableFuture;
import static org.opendaylight.yangtools.yang.common.RpcResultBuilder.failed;
import javax.inject.Singleton;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.genius.infra.RetryingManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.interfacemanager.interfaces.InterfaceManagerService;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
+import org.opendaylight.mdsal.binding.util.RetryingManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.serviceutils.tools.rpc.FutureRpcResults;
final Uint64 destDpnId = Uint64.valueOf(input.getDestinationNode());
LOG.debug("setBfdParamOnTunnel srcDpnId: {}, destDpnId: {}", srcDpnId, destDpnId);
final SettableFuture<RpcResult<SetBfdParamOnTunnelOutput>> result = SettableFuture.create();
- FluentFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
+ FluentFuture<?> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
enableBFD(tx, srcDpnId, destDpnId, input.isMonitoringEnabled(), input.getMonitoringInterval().toJava());
enableBFD(tx, destDpnId, srcDpnId, input.isMonitoringEnabled(), input.getMonitoringInterval().toJava());
});
- future.addCallback(new FutureCallback<Void>() {
+ future.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<SetBfdParamOnTunnelOutput>success().build());
}
//Ignore the Futures for now
final SettableFuture<RpcResult<RemoveExternalTunnelEndpointOutput>> result = SettableFuture.create();
Collection<DPNTEPsInfo> meshedDpnList = dpnTEPsInfoCache.getAllPresent();
- FluentFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ FluentFuture<?> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> {
ItmExternalTunnelDeleteWorker.deleteTunnels(meshedDpnList, input.getDestinationIp(),
input.getTunnelType(), tx);
tx.delete(extPath);
}
);
- future.addCallback(new FutureCallback<Void>() {
- @Override public void onSuccess(Void voidInstance) {
+ future.addCallback(new FutureCallback<Object>() {
+ @Override public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<RemoveExternalTunnelEndpointOutput>success().build());
}
//Ignore the Futures for now
final SettableFuture<RpcResult<RemoveExternalTunnelFromDpnsOutput>> result = SettableFuture.create();
List<DPNTEPsInfo> cfgDpnList = ItmUtils.getDpnTepListFromDpnId(dpnTEPsInfoCache, input.getDpnId());
- FluentFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ FluentFuture<?> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> ItmExternalTunnelDeleteWorker.deleteTunnels(cfgDpnList, input.getDestinationIp(),
input.getTunnelType(), tx));
- future.addCallback(new FutureCallback<Void>() {
+ future.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<RemoveExternalTunnelFromDpnsOutput>success().build());
}
BuildExternalTunnelFromDpnsInput input) {
//Ignore the Futures for now
final SettableFuture<RpcResult<BuildExternalTunnelFromDpnsOutput>> result = SettableFuture.create();
- FluentFuture<Void> extTunnelResultList =
+ FluentFuture<?> extTunnelResultList =
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> externalTunnelAddWorker.buildTunnelsFromDpnToExternalEndPoint(input.getDpnId(),
input.getDestinationIp(),input.getTunnelType(), tx));
- extTunnelResultList.addCallback(new FutureCallback<Void>() {
-
+ extTunnelResultList.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<BuildExternalTunnelFromDpnsOutput>success().build());
}
new DcGatewayIpBuilder().setIpAddress(input.getDestinationIp())
.setTunnnelType(input.getTunnelType()).build();
- FluentFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ FluentFuture<?> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> {
externalTunnelAddWorker.buildTunnelsToExternalEndPoint(meshedDpnList, input.getDestinationIp(),
input.getTunnelType(), tx);
tx.mergeParentStructurePut(extPath, dcGatewayIp);
}
);
- future.addCallback(new FutureCallback<Void>() {
- @Override public void onSuccess(Void voidInstance) {
+ future.addCallback(new FutureCallback<Object>() {
+ @Override public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<AddExternalTunnelEndpointOutput>success().build());
}
Uint64.fromLongBits(ITMConstants.COOKIE_ITM.longValue() + serviceId.toJava()), mkMatches,
input.getInstruction());
- ListenableFuture<Void> installFlowResult = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ ListenableFuture<?> installFlowResult = txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> mdsalManager.addFlow(tx, input.getDpnId(), terminatingServiceTableFlow));
- Futures.addCallback(installFlowResult, new FutureCallback<Void>() {
+ Futures.addCallback(installFlowResult, new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<CreateTerminatingServiceActionsOutput>success().build());
}
input.getDpnId(), input.getServiceId());
final SettableFuture<RpcResult<RemoveTerminatingServiceActionsOutput>> result = SettableFuture.create();
- ListenableFuture<Void> removeFlowResult = txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ ListenableFuture<?> removeFlowResult = txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
tx -> mdsalManager.removeFlow(tx, input.getDpnId(),
getFlowRef(NwConstants.INTERNAL_TUNNEL_TABLE, input.getServiceId()),
NwConstants.INTERNAL_TUNNEL_TABLE));
- Futures.addCallback(removeFlowResult, new FutureCallback<Void>() {
+ Futures.addCallback(removeFlowResult, new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<RemoveTerminatingServiceActionsOutput>success().build());
}
new TransportZoneKey(transportZone))
.child(DeviceVteps.class, deviceVtepKey)
.build();
- FluentFuture<Void> future =
+ FluentFuture<?> future =
retryingTxRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.delete(path));
- future.addCallback(new FutureCallback<Void>() {
- @Override public void onSuccess(Void voidInstance) {
+ future.addCallback(new FutureCallback<Object>() {
+ @Override public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<DeleteL2GwDeviceOutput>success().build());
}
DeviceVteps deviceVtep = new DeviceVtepsBuilder().withKey(deviceVtepKey).setIpAddress(hwIp)
.setNodeId(nodeId).setTopologyId(input.getTopologyId()).build();
//TO DO: add retry if it fails
- FluentFuture<Void> future = retryingTxRunner
+ FluentFuture<?> future = retryingTxRunner
.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> tx.mergeParentStructurePut(path, deviceVtep));
- future.addCallback(new FutureCallback<Void>() {
+ future.addCallback(new FutureCallback<Object>() {
- @Override public void onSuccess(Void voidInstance) {
+ @Override public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<AddL2GwDeviceOutput>success().build());
}
.setIpAddress(hwIp)
.setNodeId(nodeId.get(0)).setTopologyId(input.getTopologyId()).build();
LOG.trace("writing hWvtep{}", deviceVtep);
- FluentFuture<Void> future =
+ FluentFuture<?> future =
retryingTxRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> {
tx.mergeParentStructurePut(path, deviceVtep);
tx.mergeParentStructurePut(path2, deviceVtep2);
}
});
- future.addCallback(new FutureCallback<Void>() {
+ future.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<AddL2GwMlagDeviceOutput>success().build());
}
return result;
}
String transportZone = tzones.getTransportZone().get(0).getZoneName();
- FluentFuture<Void> future =
+ FluentFuture<?> future =
retryingTxRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> {
DeviceVtepsKey deviceVtepKey = new DeviceVtepsKey(hwIp, nodeId.get(0));
}
);
- future.addCallback(new FutureCallback<Void>() {
+ future.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Void voidInstance) {
+ public void onSuccess(Object voidInstance) {
result.set(RpcResultBuilder.<DeleteL2GwMlagDeviceOutput>success().build());
}
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.genius.itm.cache.UnprocessedNodeConnectorEndPointCache;
import org.opendaylight.genius.itm.confighelpers.HwVtep;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.itm.confighelpers.HwVtep;
import org.opendaylight.genius.itm.confighelpers.ItmExternalTunnelDeleteWorker;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.interfacemanager.interfaces.InterfaceManagerService;
import org.opendaylight.genius.itm.cache.DPNTEPsInfoCache;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorEventsWaiter;
import org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorTestModule;
import org.opendaylight.genius.datastoreutils.testutils.TestableDataTreeChangeListenerModule;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.genius.itm.rpc.ItmManagerRpcService;
import org.opendaylight.genius.itm.tests.xtend.ExpectedDeviceVtepsObjects;
import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
import org.opendaylight.infrautils.testutils.LogRule;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeMplsOverGre;
*/
package org.opendaylight.genius.itm.tests;
-import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
import static org.opendaylight.mdsal.binding.testutils.AssertDataObjects.assertEqualBeans;
+import static org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorEventsWaiter;
import org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorTestModule;
import org.opendaylight.genius.datastoreutils.testutils.TestableDataTreeChangeListenerModule;
-import org.opendaylight.genius.infra.RetryingManagedNewTransactionRunner;
import org.opendaylight.genius.itm.globals.ITMConstants;
import org.opendaylight.genius.itm.impl.ItmProvider;
import org.opendaylight.genius.itm.impl.ItmUtils;
import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
import org.opendaylight.infrautils.testutils.LogRule;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.util.RetryingManagedNewTransactionRunner;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
// write into config DS
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.merge(LogicalDatastoreType.CONFIGURATION,
- iid,itmConfigObj));
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.merge(iid, itmConfigObj));
coordinatorEventsWaiter.awaitEventsConsumption();
// read from config DS
//txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
// tx -> tx.put(iid, itmConfigObj, true));
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.merge(LogicalDatastoreType.CONFIGURATION,
- iid,itmConfigObj)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.merge(iid, itmConfigObj)).get();
coordinatorEventsWaiter.awaitEventsConsumption();
InstanceIdentifier<TransportZone> tzPath =
ItmUtils.getTZInstanceIdentifier(ITMConstants.DEFAULT_TRANSPORT_ZONE);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(TunnelTypeGre.class)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
InstanceIdentifier<TransportZone> tzPath =
ItmUtils.getTZInstanceIdentifier(ITMConstants.DEFAULT_TRANSPORT_ZONE);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(TunnelTypeVxlan.class)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
defTzTunnelType = ITMConstants.TUNNEL_TYPE_GRE;
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(TunnelTypeGre.class)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
InstanceIdentifier<TransportZone> tzPath =
ItmUtils.getTZInstanceIdentifier(ITMConstants.DEFAULT_TRANSPORT_ZONE);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(TunnelTypeGre.class)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
InstanceIdentifier<TransportZone> tzPath =
ItmUtils.getTZInstanceIdentifier(ITMConstants.DEFAULT_TRANSPORT_ZONE);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(TunnelTypeVxlan.class)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
IpPrefix subnetMaskObj = ItmUtils.getDummySubnet();
// add TEP into default-TZ
- ListenableFuture<Void> futures =
+ ListenableFuture<?> futures =
ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.DEF_TZ_TEP_IP,
ItmTestConstants.DEF_BR_DPID,
ITMConstants.DEFAULT_TRANSPORT_ZONE, false, dataBroker, txRunner);
// create TZA
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
// check TZ is created with correct TZ name
Assert.assertEquals(ItmTestConstants.TZ_NAME, dataBroker.newReadOnlyTransaction()
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get().getZoneName());
// add tep
- ListenableFuture<Void> futures = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NB_TZ_TEP_IP,
+ ListenableFuture<?> futures = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NB_TZ_TEP_IP,
ItmTestConstants.DEF_BR_DPID, ItmTestConstants.TZ_NAME, false, dataBroker, txRunner);
futures.get();
InstanceIdentifier<TransportZone> tzPath =
ItmUtils.getTZInstanceIdentifier(ITMConstants.DEFAULT_TRANSPORT_ZONE);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(ItmTestConstants.TUNNEL_TYPE_VXLAN)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
// create Transport-zone in advance
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
// add bridge into node
future = OvsdbTestUtil.addBridgeIntoNode(connInfo, ItmTestConstants.DEF_BR_NAME,
InstanceIdentifier<TransportZone> tzPath =
ItmUtils.getTZInstanceIdentifier(ITMConstants.DEFAULT_TRANSPORT_ZONE);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath,
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath,
new TransportZoneBuilder().setZoneName(ITMConstants.DEFAULT_TRANSPORT_ZONE)
.setTunnelType(ItmTestConstants.TUNNEL_TYPE_VXLAN)
.withKey(new TransportZoneKey(ITMConstants.DEFAULT_TRANSPORT_ZONE))
// create Transport-zone TZA
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
// iid for TZA configured from NB
InstanceIdentifier<TransportZone> tzaTzonePath = ItmTepAutoConfigTestUtil.getTzIid(
ItmTestConstants.TZ_NAME);
// create Transport-zone in advance
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
// add bridge into node
future = OvsdbTestUtil.addBridgeIntoNode(connInfo, ItmTestConstants.DEF_BR_NAME,
@Test
public void tepAddIntoTepsNotHostedListTest() throws Exception {
// add into not hosted list
- ListenableFuture<Void> future = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NOT_HOSTED_TZ_TEP_IP,
+ ListenableFuture<?> future = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NOT_HOSTED_TZ_TEP_IP,
ItmTestConstants.NOT_HOSTED_TZ_TEPDPN_ID, ItmTestConstants.NOT_HOSTED_TZ_NAME,
false, dataBroker, txRunner);
future.get();
@Test
public void tepDeleteFromTepsNotHostedListTest() throws Exception {
// add into not hosted list
- ListenableFuture<Void> future = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NOT_HOSTED_TZ_TEP_IP,
+ ListenableFuture<?> future = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NOT_HOSTED_TZ_TEP_IP,
ItmTestConstants.NOT_HOSTED_TZ_TEPDPN_ID, ItmTestConstants.NOT_HOSTED_TZ_NAME,
false, dataBroker, txRunner);
future.get();
@Test
public void tepMoveFromTepsNotHostedListToTzTest() throws Exception {
// add into not hosted list
- ListenableFuture<Void> future = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NOT_HOSTED_TZ_TEP_IP,
+ ListenableFuture<?> future = ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NOT_HOSTED_TZ_TEP_IP,
ItmTestConstants.NOT_HOSTED_TZ_TEPDPN_ID, ItmTestConstants.NOT_HOSTED_TZ_NAME,
false, dataBroker, txRunner);
future.get();
public void tzDeletedAndReaddedTest() throws Exception {
// create TZ
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
InstanceIdentifier<TransportZone> tzonePath = ItmTepAutoConfigTestUtil.getTzIid(
ItmTestConstants.TZ_NAME);
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get().getZoneName());
// add tep
- ListenableFuture<Void> futures =
+ ListenableFuture<?> futures =
ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NB_TZ_TEP_IP,
ItmTestConstants.DEF_BR_DPID, ItmTestConstants.TZ_NAME, false, dataBroker, txRunner);
futures.get();
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get());
// remove Transport Zone
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.delete(LogicalDatastoreType.CONFIGURATION,
- tzPath));
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.delete(tzPath));
// wait for TransportZoneListener to perform config DS update
// for TEP movement through transaction
.read(LogicalDatastoreType.OPERATIONAL, notHostedPath).get().get().getZoneName());
//readd the same tz
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
// wait for TransportZoneListener to perform config DS update
// for TEP movement through transaction
coordinatorEventsWaiter.awaitEventsConsumption();
public void tzDeletedAndReaddedWithSameVtepsTest() throws Exception {
// create TZ
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
coordinatorEventsWaiter.awaitEventsConsumption();
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get().getZoneName());
// add tep
- ListenableFuture<Void> futures =
+ ListenableFuture<?> futures =
ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NB_TZ_TEP_IP,
ItmTestConstants.DEF_BR_DPID, ItmTestConstants.TZ_NAME, false, dataBroker, txRunner);
futures.get();
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get());
// remove Transport Zone
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.delete(LogicalDatastoreType.CONFIGURATION,
- tzPath));
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.delete(tzPath));
// wait for TransportZoneListener to perform config DS update
// for TEP movement through transaction
.setTunnelType(ItmTestConstants.TUNNEL_TYPE_VXLAN).setVteps(vtepsList)
.withKey(new TransportZoneKey(ItmTestConstants.TZ_NAME)).build();
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, recreatedTransportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, recreatedTransportZone)).get();
// wait for TransportZoneListener to perform config DS update
// for TEP movement through transaction
public void tzReaddWithSameVtepsAndDiffDpnIDTest() throws Exception {
// create TZ
InstanceIdentifier<TransportZone> tzPath = ItmUtils.getTZInstanceIdentifier(ItmTestConstants.TZ_NAME);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, transportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, transportZone)).get();
InstanceIdentifier<TransportZone> tzonePath = ItmTepAutoConfigTestUtil.getTzIid(
ItmTestConstants.TZ_NAME);
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get().getZoneName());
// add tep
- ListenableFuture<Void> futures =
+ ListenableFuture<?> futures =
ItmTepAutoConfigTestUtil.addTep(ItmTestConstants.NB_TZ_TEP_IP,
ItmTestConstants.DEF_BR_DPID, ItmTestConstants.TZ_NAME, false, dataBroker, txRunner);
futures.get();
.read(LogicalDatastoreType.CONFIGURATION, tzonePath).get().get());
// remove Transport Zone
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.delete(LogicalDatastoreType.CONFIGURATION,
- tzPath));
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> tx.delete(tzPath));
// wait for TransportZoneListener to perform config DS update
// for TEP movement through transaction
.setTunnelType(ItmTestConstants.TUNNEL_TYPE_VXLAN).setVteps(vtepsList)
.withKey(new TransportZoneKey(ItmTestConstants.TZ_NAME)).build();
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- tx.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, tzPath, recreatedTransportZone)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ tx.mergeParentStructureMerge(tzPath, recreatedTransportZone)).get();
// wait for TransportZoneListener to perform config DS update
// for TEP movement through transaction
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.ListenableFuture;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.itm.confighelpers.OvsdbTepAddConfigHelper;
import org.opendaylight.genius.itm.confighelpers.OvsdbTepRemoveConfigHelper;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
}
/* transaction methods */
- public static ListenableFuture<Void> addTep(String tepIp, String strDpnId, String tzName, boolean ofTunnel,
+ public static ListenableFuture<?> addTep(String tepIp, String strDpnId, String tzName, boolean ofTunnel,
DataBroker dataBroker, ManagedNewTransactionRunner tx)
throws Exception {
return
OvsdbTepAddConfigHelper.addTepReceivedFromOvsdb(tepIp, strDpnId, tzName, ofTunnel, dataBroker, tx).get(0);
}
- public static ListenableFuture<Void> deleteTep(String tepIp, String strDpnId, String tzName,
+ public static ListenableFuture<?> deleteTep(String tepIp, String strDpnId, String tzName,
DataBroker dataBroker, ManagedNewTransactionRunner tx) {
return OvsdbTepRemoveConfigHelper.removeTepReceivedFromOvsdb(tepIp, strDpnId, tzName, dataBroker, tx).get(0);
}
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.mdsalutil.FlowEntity;
import org.opendaylight.genius.mdsalutil.GroupEntity;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
* @return
*/
@Deprecated
- FluentFuture<Void> installFlow(FlowEntity flowEntity);
+ FluentFuture<?> installFlow(FlowEntity flowEntity);
/**
* Adds a flow.
* @return
*/
@Deprecated
- FluentFuture<Void> installFlow(Uint64 dpId, Flow flowEntity);
+ FluentFuture<?> installFlow(Uint64 dpId, Flow flowEntity);
/**
* Adds a flow.
* @return
*/
@Deprecated
- FluentFuture<Void> installFlow(Uint64 dpId, FlowEntity flowEntity);
+ FluentFuture<?> installFlow(Uint64 dpId, FlowEntity flowEntity);
/**
* Adds the given flow.
* @return
*/
@Deprecated
- ListenableFuture<Void> removeFlow(Uint64 dpId, short tableId, FlowId flowId);
+ ListenableFuture<?> removeFlow(Uint64 dpId, short tableId, FlowId flowId);
/**
* Removes a flow.
* @return
*/
@Deprecated
- FluentFuture<Void> removeFlow(FlowEntity flowEntity);
+ FluentFuture<?> removeFlow(FlowEntity flowEntity);
/**
* Removes a flow.
* @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, Uint64, Flow)}.
*/
@Deprecated
- FluentFuture<Void> removeFlow(Uint64 dpId, Flow flowEntity);
+ FluentFuture<?> removeFlow(Uint64 dpId, Flow flowEntity);
/**
* Removes the given flow.
import java.util.Objects;
import org.junit.ComparisonFailure;
import org.mockito.Mockito;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.mdsalutil.FlowEntity;
import org.opendaylight.genius.mdsalutil.GroupEntity;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.mdsalutil.internal;
import static org.opendaylight.infrautils.utils.concurrent.Executors.newListeningSingleThreadExecutor;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
-import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.genius.infra.Datastore.Configuration;
-import org.opendaylight.genius.infra.RetryingManagedNewTransactionRunner;
-import org.opendaylight.genius.infra.TypedReadTransaction;
-import org.opendaylight.genius.infra.TypedReadWriteTransaction;
-import org.opendaylight.genius.infra.TypedWriteTransaction;
import org.opendaylight.genius.mdsalutil.FlowEntity;
import org.opendaylight.genius.mdsalutil.FlowInfoKey;
import org.opendaylight.genius.mdsalutil.GroupEntity;
import org.opendaylight.infrautils.utils.concurrent.NamedLocks;
import org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
+import org.opendaylight.mdsal.binding.util.RetryingManagedNewTransactionRunner;
+import org.opendaylight.mdsal.binding.util.TypedReadTransaction;
+import org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction;
+import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.OptimisticLockFailedException;
import org.opendaylight.serviceutils.tools.listener.AbstractClusteredAsyncDataTreeChangeListener;
}
@VisibleForTesting
- FluentFuture<Void> installFlowInternal(FlowEntity flowEntity) {
+ FluentFuture<?> installFlowInternal(FlowEntity flowEntity) {
return addCallBackForInstallFlowAndReturn(txRunner
.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> writeFlowEntityInternal(flowEntity, tx)));
}
- private FluentFuture<Void> installFlowInternal(Uint64 dpId, Flow flow) {
+ private FluentFuture<?> installFlowInternal(Uint64 dpId, Flow flow) {
return txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> writeFlowInternal(dpId, flow, tx));
}
}
@VisibleForTesting
- FluentFuture<Void> installGroupInternal(GroupEntity groupEntity) {
+ FluentFuture<?> installGroupInternal(GroupEntity groupEntity) {
return addCallBackForInstallGroupAndReturn(txRunner
.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> writeGroupEntityInternal(groupEntity, tx)));
}
@VisibleForTesting
- FluentFuture<Void> removeFlowInternal(FlowEntity flowEntity) {
+ FluentFuture<?> removeFlowInternal(FlowEntity flowEntity) {
return addCallBackForDeleteFlowAndReturn(txRunner
.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> deleteFlowEntityInternal(flowEntity, tx)));
deleteFlow(dpId, tableId, flowKey, tx);
}
- private void deleteFlow(Uint64 dpId, short tableId, FlowKey flowKey, WriteTransaction tx) {
- if (flowExists(dpId, tableId, flowKey)) {
- InstanceIdentifier<Flow> flowInstanceId = buildFlowInstanceIdentifier(dpId, tableId, flowKey);
- tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
- } else {
- LOG.debug("Flow {} does not exist for dpn {}", flowKey, dpId);
- }
- }
-
private void deleteFlow(Uint64 dpId, short tableId, FlowKey flowKey,
TypedWriteTransaction<Datastore.Configuration> tx) {
if (flowExists(dpId, tableId, flowKey)) {
}
}
- private FluentFuture<Void> removeFlowNewInternal(Uint64 dpnId, Flow flowEntity) {
+ private FluentFuture<?> removeFlowNewInternal(Uint64 dpnId, Flow flowEntity) {
LOG.debug("Remove flow {}", flowEntity);
return txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> {
}
@VisibleForTesting
- FluentFuture<Void> removeGroupInternal(Uint64 dpnId, long groupId) {
+ FluentFuture<?> removeGroupInternal(Uint64 dpnId, long groupId) {
return addCallBackForInstallGroupAndReturn(txRunner
.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> removeGroupInternal(dpnId, groupId, tx)));
}
@Override
- public FluentFuture<Void> installFlow(FlowEntity flowEntity) {
+ public FluentFuture<?> installFlow(FlowEntity flowEntity) {
return installFlowInternal(flowEntity);
}
@Override
- public FluentFuture<Void> installFlow(Uint64 dpId, Flow flowEntity) {
+ public FluentFuture<?> installFlow(Uint64 dpId, Flow flowEntity) {
return installFlowInternal(dpId, flowEntity);
}
@Override
- public FluentFuture<Void> installFlow(Uint64 dpId, FlowEntity flowEntity) {
+ public FluentFuture<?> installFlow(Uint64 dpId, FlowEntity flowEntity) {
return installFlowInternal(dpId, flowEntity.getFlowBuilder().build());
}
@Override
- public ListenableFuture<Void> removeFlow(Uint64 dpId, short tableId, FlowId flowId) {
- ListenableFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ public ListenableFuture<?> removeFlow(Uint64 dpId, short tableId, FlowId flowId) {
+ ListenableFuture<?> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> deleteFlow(dpId, tableId, new FlowKey(flowId), tx));
- Futures.addCallback(future, new FutureCallback<Void>() {
+ Futures.addCallback(future, new FutureCallback<Object>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final Object result) {
// Committed successfully
LOG.debug("Delete Flow -- Committed successfully");
}
}
@Override
- public FluentFuture<Void> removeFlow(Uint64 dpId, Flow flowEntity) {
+ public FluentFuture<?> removeFlow(Uint64 dpId, Flow flowEntity) {
return removeFlowNewInternal(dpId, flowEntity);
}
@Override
- public FluentFuture<Void> removeFlow(FlowEntity flowEntity) {
+ public FluentFuture<?> removeFlow(FlowEntity flowEntity) {
return removeFlowInternal(flowEntity);
}
return bucketInstanceId;
}
- private static FluentFuture<Void> addCallBackForDeleteFlowAndReturn(FluentFuture<Void> fluentFuture) {
+ private static FluentFuture<?> addCallBackForDeleteFlowAndReturn(FluentFuture<?> fluentFuture) {
return callBack(fluentFuture, "Delete Flow");
}
- private static FluentFuture<Void> addCallBackForInstallFlowAndReturn(FluentFuture<Void> fluentFuture) {
+ private static FluentFuture<?> addCallBackForInstallFlowAndReturn(FluentFuture<?> fluentFuture) {
return callBack(fluentFuture, "Install Flow");
}
- private static FluentFuture<Void> addCallBackForInstallGroupAndReturn(FluentFuture<Void> fluentFuture) {
+ private static FluentFuture<?> addCallBackForInstallGroupAndReturn(FluentFuture<?> fluentFuture) {
return callBack(fluentFuture, "Install Group");
}
// Generic for handling callbacks
- private static FluentFuture<Void> callBack(FluentFuture<Void> fluentFuture, String log) {
- fluentFuture.addCallback(new FutureCallback<Void>() {
+ private static FluentFuture<?> callBack(FluentFuture<?> fluentFuture, String log) {
+ fluentFuture.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final Object result) {
// Committed successfully
LOG.debug("{} -- Committedsuccessfully ", log);
}
import org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar;
import org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar.NextAction;
import org.opendaylight.genius.datastoreutils.listeners.internal.DataTreeEventCallbackRegistrarImpl;
-import org.opendaylight.genius.infra.RetryingManagedNewTransactionRunner;
import org.opendaylight.infrautils.testutils.LogCaptureRule;
import org.opendaylight.infrautils.testutils.LogRule;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest;
+import org.opendaylight.mdsal.binding.util.Datastore;
+import org.opendaylight.mdsal.binding.util.RetryingManagedNewTransactionRunner;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
ArgumentCaptor<Runnable> timerTask = ArgumentCaptor.forClass(Runnable.class);
verify(mockScheduler).schedule(timerTask.capture(), eq(timeout.toMillis()), eq(TimeUnit.MILLISECONDS));
- new RetryingManagedNewTransactionRunner(db, 1).callWithNewWriteOnlyTransactionAndSubmit(
- tx -> tx.mergeParentStructurePut(OPERATIONAL, FOO_PATH, FOO_DATA));
+ new RetryingManagedNewTransactionRunner(db, 1).callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
+ tx -> tx.mergeParentStructurePut(FOO_PATH, FOO_DATA));
// Wait for the change notification callback to be invoked.
return null;
}).when(mockListener).onDataTreeChanged(anyCollection());
- new RetryingManagedNewTransactionRunner(db, 1).callWithNewWriteOnlyTransactionAndSubmit(
- tx -> tx.mergeParentStructurePut(OPERATIONAL, FOO_PATH, FOO_DATA));
+ new RetryingManagedNewTransactionRunner(db, 1).callWithNewWriteOnlyTransactionAndSubmit(Datastore.OPERATIONAL,
+ tx -> tx.mergeParentStructurePut(FOO_PATH, FOO_DATA));
await().untilTrue(onDataTreeChangeDone);
assertThat(updated.get()).isFalse();