* 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.openflowplugin.impl.statistics;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import java.util.Objects;
+import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainClosedException;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.binding.api.TransactionChainClosedException;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
// TODO: in case the result value is null then multipart data probably got processed
// TODO: on the fly. This contract should by clearly stated and enforced.
// TODO: Now simple true value is returned
- if (Objects.nonNull(rpcResult.getResult()) && !rpcResult.getResult().isEmpty()) {
+ if (rpcResult.getResult() != null && !rpcResult.getResult().isEmpty()) {
final List<DataContainer> allMultipartData = rpcResult.getResult().stream()
.map(reply -> MultipartReplyTranslatorUtil
.translate(reply, deviceInfo, convertorExecutor, null))
}
final ListenableFuture<Optional<FlowCapableNode>> future;
- try (ReadOnlyTransaction readTx = txFacade.getReadTransaction()) {
+ try (ReadTransaction readTx = txFacade.getReadTransaction()) {
future = readTx.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);
}
try {
Futures.transform(Futures.catchingAsync(future, Throwable.class, Futures::immediateFailedFuture,
- MoreExecutors.directExecutor()), (Function<Optional<FlowCapableNode>, Void>) flowCapNodeOpt -> {
+ MoreExecutors.directExecutor()), flowCapNodeOpt -> {
// we have to read actual tables with all information before we set empty Flow list,
// merge is expensive and not applicable for lists
if (flowCapNodeOpt != null && flowCapNodeOpt.isPresent()) {