package org.opendaylight.netvirt.elan.internal;
import com.google.common.util.concurrent.ListenableFuture;
-import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class InterfaceRemoveWorkerOnElan implements Callable<List<ListenableFuture<Void>>> {
+public class InterfaceRemoveWorkerOnElan implements Callable<List<? extends ListenableFuture<?>>> {
private static final Logger LOG = LoggerFactory.getLogger(InterfaceRemoveWorkerOnElan.class);
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
- public List<ListenableFuture<Void>> call() throws Exception {
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ public List<ListenableFuture<Void>> call() {
try {
- futures.addAll(dataChangeListener.removeElanInterface(elanInfo, interfaceName, interfaceInfo));
+ return dataChangeListener.removeElanInterface(elanInfo, interfaceName, interfaceInfo);
} catch (RuntimeException e) {
- LOG.error("Error while processing key {} for elan interface {} and elan {}",
- key, interfaceName, elanInfo, e);
- ElanUtils.addToListenableFutureIfTxException(e, futures);
+ return ElanUtils.returnFailedListenableFutureIfTransactionCommitFailedExceptionCauseOrElseThrow(e);
}
- return futures;
}
}