package org.opendaylight.openflowplugin.applications.frsync.impl;
-import com.google.common.base.Function;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
this.reconciliationRegistry = reconciliationRegistry;
}
+ @Override
public ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
final SyncupEntry syncupEntry) {
ListenableFuture<Boolean> syncupResult = delegate.syncup(flowcapableNodePath,syncupEntry);
- return Futures.transform(syncupResult, new Function<Boolean, Boolean>() {
- @Override
- public Boolean apply(Boolean result) {
- if (result) {
- reconciliationRegistry.unregisterIfRegistered(nodeId);
- } else {
- reconciliationRegistry.register(nodeId);
- }
- return result;
+ return Futures.transform(syncupResult, result -> {
+ if (result) {
+ reconciliationRegistry.unregisterIfRegistered(nodeId);
+ } else {
+ reconciliationRegistry.register(nodeId);
}
+
+ return result;
}, MoreExecutors.directExecutor());
}
}