Merge "fix diagstatus NPE on showSvcStatus CLI"
authorAnil Vishnoi <vishnoianil@gmail.com>
Fri, 25 May 2018 05:58:37 +0000 (05:58 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 25 May 2018 05:58:37 +0000 (05:58 +0000)
82 files changed:
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/SalBulkFlowServiceImpl.java
applications/bulk-o-matic/src/test/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/SalBulkFlowServiceImplTest.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowNodeReconciliationImpl.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ReconciliationServiceImpl.java
applications/forwardingrules-manager/src/test/java/test/mock/util/SalBundleServiceMock.java
applications/forwardingrules-manager/src/test/java/test/mock/util/SalFlowServiceMock.java
applications/forwardingrules-manager/src/test/java/test/mock/util/SalGroupServiceMock.java
applications/forwardingrules-manager/src/test/java/test/mock/util/SalMeterServiceMock.java
applications/forwardingrules-manager/src/test/java/test/mock/util/SalTableServiceMock.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtil.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImplTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtilTest.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/LLDPSpeaker.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/OperationalStatusChangeService.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/AdminReconciliationServiceImpl.java
extension/test-extension/src/main/java/org/opendaylight/openflowplugin/extension/test/Test.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/AbstractConnectionAdapter.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/AbstractConnectionAdapterStatistics.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/AbstractRpcListener.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SimpleRpcListener.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SimpleRpcListenerTest.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerAggregateFlowMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerTableMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/FlowCapableTransactionServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/NodeConfigServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/PacketProcessingServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalAsyncConfigServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalBundleServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalExperimenterMessageServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalExperimenterMpMessageServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlatBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowsBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMetersBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalPortServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalTableServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerAggregateFlowMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerExperimenterMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerSetAsyncConfigService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightGroupStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightMeterStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightPortStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightQueueStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/OpendaylightFlowStatisticsServiceDelegateImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/OpendaylightDirectStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/BarrierUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/FlowUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/GroupUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/MeterUtil.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/listener/SystemNotificationsListenerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/role/RoleContextImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalAsyncConfigServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalBundleServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowsBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalMetersBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/BarrierUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/GroupUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java
samples/sample-bundles/src/main/java/org/opendaylight/openflowplugin/samples/sample/bundles/Activator.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java

index ba92da80126f712747c00d4657f8ac8f6ce84aaa..8a6a629e21aa5eb7d59d5d4f8df27fe81ac949c3 100644 (file)
@@ -34,16 +34,28 @@ import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.AddFlowsDsInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.AddFlowsDsOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.AddFlowsRpcInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.AddFlowsRpcOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.BulkFlowBaseContentGrouping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddMultipleInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddMultipleOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddTestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddTestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowTestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowTestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.ReadFlowTestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.ReadFlowTestOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RegisterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RegisterInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RegisterOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsDsInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsDsOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsRpcInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsRpcOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.SalBulkFlowService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.TableTestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.TableTestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.bulk.flow.ds.list.grouping.BulkFlowDsItem;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
@@ -82,11 +94,11 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
         this.flowService = Preconditions.checkNotNull(flowService);
         this.dataBroker = Preconditions.checkNotNull(dataBroker);
 
-        JdkFutures.addErrorLogging(register(), LOG, "register");
+        JdkFutures.addErrorLogging(register(new RegisterInputBuilder().build()), LOG, "register");
     }
 
     @Override
-    public Future<RpcResult<Void>> addFlowsDs(AddFlowsDsInput input) {
+    public ListenableFuture<RpcResult<AddFlowsDsOutput>> addFlowsDs(AddFlowsDsInput input) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         boolean createParentsNextTime = MoreObjects.firstNonNull(input.isAlwaysCreateParents(), Boolean.FALSE);
         boolean createParents = true;
@@ -99,7 +111,13 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
             createParents = createParentsNextTime;
         }
         ListenableFuture<Void> submitFuture = writeTransaction.submit();
-        return handleResultFuture(Futures.allAsList(submitFuture));
+        return Futures.transform(handleResultFuture(Futures.allAsList(submitFuture)), voidRpcResult -> {
+            if (voidRpcResult.isSuccessful()) {
+                return RpcResultBuilder.<AddFlowsDsOutput>success().build();
+            } else {
+                return RpcResultBuilder.<AddFlowsDsOutput>failed().build();
+            }
+        },MoreExecutors.directExecutor());
     }
 
     private InstanceIdentifier<Flow> getFlowInstanceIdentifier(BulkFlowDsItem bulkFlow) {
@@ -110,12 +128,18 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public Future<RpcResult<Void>> removeFlowsDs(RemoveFlowsDsInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowsDsOutput>> removeFlowsDs(RemoveFlowsDsInput input) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         for (BulkFlowDsItem bulkFlow : input.getBulkFlowDsItem()) {
             writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, getFlowInstanceIdentifier(bulkFlow));
         }
-        return handleResultFuture(Futures.allAsList(writeTransaction.submit()));
+        return Futures.transform(handleResultFuture(Futures.allAsList(writeTransaction.submit())), voidRpcResult -> {
+            if (voidRpcResult.isSuccessful()) {
+                return RpcResultBuilder.<RemoveFlowsDsOutput>success().build();
+            } else {
+                return RpcResultBuilder.<RemoveFlowsDsOutput>failed().build();
+            }
+        }, MoreExecutors.directExecutor());
     }
 
     private <T> ListenableFuture<RpcResult<Void>> handleResultFuture(ListenableFuture<List<T>> submitFuture) {
@@ -138,7 +162,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public Future<RpcResult<Void>> addFlowsRpc(AddFlowsRpcInput input) {
+    public ListenableFuture<RpcResult<AddFlowsRpcOutput>> addFlowsRpc(AddFlowsRpcInput input) {
         List<ListenableFuture<RpcResult<AddFlowOutput>>> bulkResults = new ArrayList<>();
 
         for (BulkFlowBaseContentGrouping bulkFlow : input.getBulkFlowItem()) {
@@ -150,33 +174,39 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
             Future<RpcResult<AddFlowOutput>> rpcAddFlowResult = flowService.addFlow(flowInputBuilder.build());
             bulkResults.add(JdkFutureAdapters.listenInPoolThread(rpcAddFlowResult));
         }
-        return handleResultFuture(Futures.allAsList(bulkResults));
+        return Futures.transform(handleResultFuture(Futures.allAsList(bulkResults)), voidRpcResult -> {
+            if (voidRpcResult.isSuccessful()) {
+                return RpcResultBuilder.<AddFlowsRpcOutput>success().build();
+            } else {
+                return RpcResultBuilder.<AddFlowsRpcOutput>failed().build();
+            }
+        },MoreExecutors.directExecutor());
     }
 
     @Override
-    public Future<RpcResult<Void>> readFlowTest(ReadFlowTestInput input) {
+    public ListenableFuture<RpcResult<ReadFlowTestOutput>> readFlowTest(ReadFlowTestInput input) {
         FlowReader flowReader = FlowReader.getNewInstance(dataBroker, input.getDpnCount().intValue(),
                 input.getFlowsPerDpn().intValue(), input.isVerbose(), input.isIsConfigDs(),
                 input.getStartTableId().shortValue(), input.getEndTableId().shortValue());
         flowCounterBeanImpl.setReader(flowReader);
         fjService.execute(flowReader);
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<ReadFlowTestOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 
     @Override
-    public Future<RpcResult<Void>> flowRpcAddTest(FlowRpcAddTestInput input) {
+    public ListenableFuture<RpcResult<FlowRpcAddTestOutput>> flowRpcAddTest(FlowRpcAddTestInput input) {
         FlowWriterDirectOFRpc flowAddRpcTestImpl = new FlowWriterDirectOFRpc(dataBroker, flowService, fjService);
         flowAddRpcTestImpl.rpcFlowAdd(input.getDpnId(), input.getFlowCount().intValue(),
                 input.getRpcBatchSize().intValue());
 
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<FlowRpcAddTestOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 
     @Override
-    public Future<RpcResult<Void>> register() {
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+    public ListenableFuture<RpcResult<RegisterOutput>> register(RegisterInput input) {
+        RpcResultBuilder<RegisterOutput> rpcResultBuilder = RpcResultBuilder.success();
         try {
             MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
             String pathToMBean = String.format("%s:type=%s", FlowCounter.class.getPackage().getName(),
@@ -192,7 +222,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public Future<RpcResult<Void>> removeFlowsRpc(RemoveFlowsRpcInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowsRpcOutput>> removeFlowsRpc(RemoveFlowsRpcInput input) {
         List<ListenableFuture<RpcResult<RemoveFlowOutput>>> bulkResults = new ArrayList<>();
 
         for (BulkFlowBaseContentGrouping bulkFlow : input.getBulkFlowItem()) {
@@ -204,11 +234,17 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
             Future<RpcResult<RemoveFlowOutput>> rpcAddFlowResult = flowService.removeFlow(flowInputBuilder.build());
             bulkResults.add(JdkFutureAdapters.listenInPoolThread(rpcAddFlowResult));
         }
-        return handleResultFuture(Futures.allAsList(bulkResults));
+        return Futures.transform(handleResultFuture(Futures.allAsList(bulkResults)), voidRpcResult -> {
+            if (voidRpcResult.isSuccessful()) {
+                return RpcResultBuilder.<RemoveFlowsRpcOutput>success().build();
+            } else {
+                return RpcResultBuilder.<RemoveFlowsRpcOutput>failed().build();
+            }
+        }, MoreExecutors.directExecutor());
     }
 
     @Override
-    public Future<RpcResult<Void>> flowTest(FlowTestInput input) {
+    public ListenableFuture<RpcResult<FlowTestOutput>> flowTest(FlowTestInput input) {
         if (input.isTxChain()) {
             FlowWriterTxChain flowTester = new FlowWriterTxChain(dataBroker, fjService);
             flowCounterBeanImpl.setWriter(flowTester);
@@ -222,7 +258,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
                         input.getBatchSize().intValue(), input.getStartTableId().shortValue(),
                         input.getEndTableId().shortValue());
             }
-            RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+            RpcResultBuilder<FlowTestOutput> rpcResultBuilder = RpcResultBuilder.success();
             return Futures.immediateFuture(rpcResultBuilder.build());
         }
         if (input.isSeq()) {
@@ -252,12 +288,12 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
                         input.getEndTableId().shortValue());
             }
         }
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<FlowTestOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 
     @Override
-    public Future<RpcResult<Void>> tableTest(final TableTestInput input) {
+    public ListenableFuture<RpcResult<TableTestOutput>> tableTest(final TableTestInput input) {
         final TableWriter writer = new TableWriter(dataBroker, fjService);
         flowCounterBeanImpl.setWriter(writer);
         switch (input.getOperation()) {
@@ -270,18 +306,18 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
                         input.getEndTableId().shortValue());
                 break;
             default:
-                RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.failed();
+                RpcResultBuilder<TableTestOutput> rpcResultBuilder = RpcResultBuilder.failed();
                 return Futures.immediateFuture(rpcResultBuilder.build());
         }
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<TableTestOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 
     @Override
-    public Future<RpcResult<Void>> flowRpcAddMultiple(FlowRpcAddMultipleInput input) {
+    public ListenableFuture<RpcResult<FlowRpcAddMultipleOutput>> flowRpcAddMultiple(FlowRpcAddMultipleInput input) {
         FlowWriterDirectOFRpc flowTesterRPC = new FlowWriterDirectOFRpc(dataBroker, flowService, fjService);
         flowTesterRPC.rpcFlowAddAll(input.getFlowCount().intValue(), input.getRpcBatchSize().intValue());
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<FlowRpcAddMultipleOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 }
index 116df5f200d363cb7bf197cdff776dca866991d7..f1491ed29c469a56904766d06d01335a064d8e6e 100644 (file)
@@ -14,9 +14,9 @@ import static org.mockito.Mockito.when;
 
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,10 +39,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddMultipleInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddTestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddTestInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowRpcAddTestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowTestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.FlowTestInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.ReadFlowTestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.ReadFlowTestInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.ReadFlowTestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsDsInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsDsInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.RemoveFlowsRpcInput;
@@ -181,7 +183,8 @@ public class SalBulkFlowServiceImplTest {
                 .setStartTableId(1L).setEndTableId(2L).setIsConfigDs(false).setFlowsPerDpn(1L).setVerbose(true);
 
         final ReadFlowTestInput readFlowTestInput = readFlowTestInputBuilder.build();
-        final Future<RpcResult<Void>> resultFuture = salBulkFlowService.readFlowTest(readFlowTestInput);
+        final ListenableFuture<RpcResult<ReadFlowTestOutput>> resultFuture
+                = salBulkFlowService.readFlowTest(readFlowTestInput);
 
         Assert.assertTrue(resultFuture.get().isSuccessful());
     }
@@ -196,7 +199,8 @@ public class SalBulkFlowServiceImplTest {
                 .setDpnId("1").setRpcBatchSize(1L);
 
         final FlowRpcAddTestInput flowRpcAddTestInput = flowRpcAddTestInputBuilder.build();
-        final Future<RpcResult<Void>> resultFuture = salBulkFlowService.flowRpcAddTest(flowRpcAddTestInput);
+        final ListenableFuture<RpcResult<FlowRpcAddTestOutput>> resultFuture
+                = salBulkFlowService.flowRpcAddTest(flowRpcAddTestInput);
 
         Assert.assertTrue(resultFuture.get().isSuccessful());
     }
index db56eb8e1e662b717d66c2f32658187edc9911c2..c55e4b3bf16c5e581fe6e16262d4a3e102597553 100644 (file)
@@ -29,7 +29,6 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicLong;
@@ -74,8 +73,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.Messages;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.MessagesBuilder;
@@ -206,9 +207,10 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
                         .setNode(nodeRef).setBundleId(bundleIdValue).setFlags(BUNDLE_FLAGS)
                         .setMessages(createMessages(nodeRef, flowNode)).build();
 
-                Future<RpcResult<Void>> openBundle = salBundleService.controlBundle(openBundleInput);
+                ListenableFuture<RpcResult<ControlBundleOutput>> openBundle
+                        = salBundleService.controlBundle(openBundleInput);
 
-                ListenableFuture<RpcResult<Void>> addBundleMessagesFuture = Futures
+                ListenableFuture<RpcResult<AddBundleMessagesOutput>> addBundleMessagesFuture = Futures
                         .transformAsync(JdkFutureAdapters.listenInPoolThread(openBundle), rpcResult -> {
                             if (rpcResult.isSuccessful()) {
                                 return JdkFutureAdapters
@@ -216,14 +218,14 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
                             }
                             return Futures.immediateFuture(null);
                         }, MoreExecutors.directExecutor());
-                ListenableFuture<RpcResult<Void>> commitBundleFuture = Futures.transformAsync(addBundleMessagesFuture,
-                    rpcResult -> {
-                        if (rpcResult.isSuccessful()) {
-                            return JdkFutureAdapters
-                                    .listenInPoolThread(salBundleService.controlBundle(commitBundleInput));
-                        }
-                        return Futures.immediateFuture(null);
-                    }, MoreExecutors.directExecutor());
+                ListenableFuture<RpcResult<ControlBundleOutput>> commitBundleFuture
+                        = Futures.transformAsync(addBundleMessagesFuture, rpcResult -> {
+                            if (rpcResult.isSuccessful()) {
+                                return JdkFutureAdapters
+                                        .listenInPoolThread(salBundleService.controlBundle(commitBundleInput));
+                            }
+                            return Futures.immediateFuture(null);
+                        }, MoreExecutors.directExecutor());
 
                 /* Bundles not supported for meters */
                 List<Meter> meters = flowNode.get().getMeter() != null ? flowNode.get().getMeter()
index e8f8285104b81b4482804297a440728ab22bd2d6..e7f1dd2507de3d928003dbe4ad78b2302a009f6f 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
-import java.util.concurrent.Future;
 import javax.annotation.Nullable;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -47,7 +46,7 @@ public class ReconciliationServiceImpl implements ReconciliationService {
     }
 
     @Override
-    public Future<RpcResult<ReconcileNodeOutput>> reconcileNode(ReconcileNodeInput input) {
+    public ListenableFuture<RpcResult<ReconcileNodeOutput>> reconcileNode(ReconcileNodeInput input) {
         LOG.debug("Triggering reconciliation for node: {}", input.getNodeId().toString());
         Node nodeDpn = buildNode(input.getNodeId().longValue());
         InstanceIdentifier<FlowCapableNode> connectedNode = InstanceIdentifier.builder(Nodes.class)
index 66013b1b811862b048dc93e67ff0078110852ad9..0ca527a702bf33f23851b5b39060b7a73095bed5 100644 (file)
@@ -8,11 +8,13 @@
 
 package test.mock.util;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
@@ -23,13 +25,13 @@ public class SalBundleServiceMock implements SalBundleService {
     private final List<AddBundleMessagesInput>  addBundleMessagesInput = new ArrayList<>();
 
     @Override
-    public Future<RpcResult<java.lang.Void>> controlBundle(ControlBundleInput input) {
+    public ListenableFuture<RpcResult<ControlBundleOutput>> controlBundle(ControlBundleInput input) {
         getControlBundleInput().add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<java.lang.Void>> addBundleMessages(AddBundleMessagesInput input) {
+    public ListenableFuture<RpcResult<AddBundleMessagesOutput>> addBundleMessages(AddBundleMessagesInput input) {
         getAddBundleMessagesInput().add(input);
         return null;
     }
index 63062df3dc9887317a7c23528b9daad7a98b2615..a53e2f863d4a8582b6f778e80b89d086bd999368 100644 (file)
@@ -7,9 +7,9 @@
  */
 package test.mock.util;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
@@ -25,19 +25,19 @@ public class SalFlowServiceMock implements SalFlowService {
     private final List<UpdateFlowInput> updateFlowCalls = new ArrayList<>();
 
     @Override
-    public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
+    public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
         addFlowCalls.add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
         removeFlowCalls.add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
+    public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
         updateFlowCalls.add(input);
         return null;
     }
index 958285d511293e85415ac425477fa0e931afc3ad..759bee629337d67f725a6af88bc28fe68f36735c 100644 (file)
@@ -7,9 +7,9 @@
  */
 package test.mock.util;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
@@ -25,19 +25,19 @@ public class SalGroupServiceMock implements SalGroupService {
     private final List<UpdateGroupInput> updateGroupCalls = new ArrayList<>();
 
     @Override
-    public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
+    public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
         addGroupCalls.add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<RemoveGroupOutput>> removeGroup(RemoveGroupInput input) {
+    public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(RemoveGroupInput input) {
         removeGroupCalls.add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<UpdateGroupOutput>> updateGroup(UpdateGroupInput input) {
+    public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(UpdateGroupInput input) {
         updateGroupCalls.add(input);
         return null;
     }
index 42dd31231433d72cdf77b0b8b7afdc355bf42c90..2134d1d0e4c82cafc21d8c0fee16faec0bc80b21 100644 (file)
@@ -7,9 +7,9 @@
  */
 package test.mock.util;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
@@ -25,19 +25,19 @@ public class SalMeterServiceMock implements SalMeterService {
     private final List<UpdateMeterInput> updateMeterCalls = new ArrayList<>();
 
     @Override
-    public Future<RpcResult<AddMeterOutput>> addMeter(AddMeterInput input) {
+    public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(AddMeterInput input) {
         addMeterCalls.add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<RemoveMeterOutput>> removeMeter(RemoveMeterInput input) {
+    public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(RemoveMeterInput input) {
         removeMeterCalls.add(input);
         return null;
     }
 
     @Override
-    public Future<RpcResult<UpdateMeterOutput>> updateMeter(UpdateMeterInput input) {
+    public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(UpdateMeterInput input) {
         updateMeterCalls.add(input);
         return null;
     }
index ced07fc235ff5dd5d94a057f87a69ea8a7f66668..13b9ad2b26f640f5bc8d725b67ad4c75b99a8378 100644 (file)
@@ -7,9 +7,9 @@
  */
 package test.mock.util;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
@@ -23,7 +23,7 @@ public class SalTableServiceMock implements SalTableService {
     }
 
     @Override
-    public Future<RpcResult<UpdateTableOutput>> updateTable(UpdateTableInput input) {
+    public ListenableFuture<RpcResult<UpdateTableOutput>> updateTable(UpdateTableInput input) {
         updateTableInput.add(input);
         return null;
     }
index ab0ad75f2d45a1f6f4de91970409d75e703d3f5d..cb695b691a2aa1d5a9dc6408d3bcd5fe20742ac5 100644 (file)
@@ -13,7 +13,8 @@ import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 import com.google.common.util.concurrent.AsyncFunction;
-import com.google.common.util.concurrent.JdkFutureAdapters;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -33,6 +34,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.ta
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -129,7 +131,16 @@ public final class ReconcileUtil {
             final SendBarrierInput barrierInput = new SendBarrierInputBuilder()
                     .setNode(new NodeRef(nodeIdent))
                     .build();
-            return JdkFutureAdapters.listenInPoolThread(flowCapableTransactionService.sendBarrier(barrierInput));
+            ListenableFuture<RpcResult<SendBarrierOutput>> result
+                    = flowCapableTransactionService.sendBarrier(barrierInput);
+
+            return Futures.transformAsync(result, input1 -> {
+                if (input1.isSuccessful()) {
+                    return Futures.<RpcResult<Void>>immediateFuture(RpcResultBuilder.<Void>success().build());
+                } else {
+                    return Futures.<RpcResult<Void>>immediateFailedFuture(null);
+                }
+            });
         };
     }
 
index 99cef391dfdddbec01b753eca5157a5d0874986d..346cb9e0fceb86ea316db3718c92819ab331a8e7 100644 (file)
@@ -43,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Remo
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutputBuilder;
@@ -175,7 +176,7 @@ public class SyncPlanPushStrategyIncrementalImplTest {
     @Before
     public void setUp() throws Exception {
         Mockito.when(flowCapableTxService.sendBarrier(Matchers.<SendBarrierInput>any()))
-                .thenReturn(RpcResultBuilder.success((Void) null).buildFuture());
+                .thenReturn(RpcResultBuilder.success((SendBarrierOutput) null).buildFuture());
 
         Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).add(
                 Matchers.<InstanceIdentifier<Group>>any(), Matchers.<Group>any(),
index eb605bdc7c68669eab7bd71fefc3a32c422cd467..dae539f259b534bf67a2269708985e6ac77abe2c 100644 (file)
@@ -40,6 +40,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder;
@@ -80,7 +81,7 @@ public class ReconcileUtilTest {
                 Futures.transformAsync(testRabbit, ReconcileUtil.chainBarrierFlush(NODE_IDENT, flowCapableService),
                         MoreExecutors.directExecutor());
         Mockito.when(flowCapableService.sendBarrier(barrierInputCaptor.capture()))
-                .thenReturn(RpcResultBuilder.<Void>success().buildFuture());
+                .thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
 
         Mockito.verify(flowCapableService, Mockito.never()).sendBarrier(Matchers.<SendBarrierInput>any());
         Assert.assertFalse(vehicle.isDone());
index bd5dc5d92d80fe06a691a9ab2c11e027a8aed00a..d27b137d3d40e5a2cb8cc644d0a08b2e2eccbf90 100644 (file)
@@ -36,6 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.OperStatus;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -187,7 +188,7 @@ public class LLDPSpeaker implements NodeConnectorEventsObserver, Runnable, AutoC
         LOG.debug("Port {} added to LLDPSpeaker.nodeConnectorMap", nodeConnectorId.getValue());
 
         // Transmit packet for first time immediately
-        final Future<RpcResult<Void>> resultFuture = packetProcessingService.transmitPacket(packet);
+        final Future<RpcResult<TransmitPacketOutput>> resultFuture = packetProcessingService.transmitPacket(packet);
         JdkFutures.addErrorLogging(resultFuture, LOG, "transmitPacket");
     }
 
index e7fa642b26dc19e9a58fabaf7830790d54707d90..bfb8ae728490455d859d907771c160a5ed1e3e4f 100644 (file)
@@ -9,14 +9,18 @@
 package org.opendaylight.openflowplugin.applications.lldpspeaker;
 
 import com.google.common.util.concurrent.Futures;
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.ChangeOperationalStatusInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.ChangeOperationalStatusOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.GetLldpFloodIntervalInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.GetLldpFloodIntervalOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.GetLldpFloodIntervalOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.GetOperationalStatusInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.GetOperationalStatusOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.GetOperationalStatusOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.LldpSpeakerService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.SetLldpFloodIntervalInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.SetLldpFloodIntervalOutput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
@@ -29,14 +33,17 @@ public class OperationalStatusChangeService implements LldpSpeakerService {
     }
 
     @Override
-    public Future<RpcResult<Void>> changeOperationalStatus(final ChangeOperationalStatusInput input) {
+    public ListenableFuture<RpcResult<ChangeOperationalStatusOutput>> changeOperationalStatus(final
+                                                                                          ChangeOperationalStatusInput
+                                                                                           input) {
         speakerInstance.setOperationalStatus(input.getOperationalStatus());
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<ChangeOperationalStatusOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 
     @Override
-    public Future<RpcResult<GetOperationalStatusOutput>> getOperationalStatus() {
+    public ListenableFuture<RpcResult<GetOperationalStatusOutput>> getOperationalStatus(
+            GetOperationalStatusInput input) {
         RpcResultBuilder<GetOperationalStatusOutput> rpcResultBuilder = RpcResultBuilder.success();
         GetOperationalStatusOutputBuilder getOperationalStatusOutputBuilder = new GetOperationalStatusOutputBuilder();
         getOperationalStatusOutputBuilder.setOperationalStatus(speakerInstance.getOperationalStatus());
@@ -45,14 +52,16 @@ public class OperationalStatusChangeService implements LldpSpeakerService {
     }
 
     @Override
-    public Future<RpcResult<Void>> setLldpFloodInterval(final SetLldpFloodIntervalInput input) {
+    public ListenableFuture<RpcResult<SetLldpFloodIntervalOutput>> setLldpFloodInterval(final SetLldpFloodIntervalInput
+                                                                                               input) {
         speakerInstance.setLldpFloodInterval(input.getInterval());
-        RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.success();
+        RpcResultBuilder<SetLldpFloodIntervalOutput> rpcResultBuilder = RpcResultBuilder.success();
         return Futures.immediateFuture(rpcResultBuilder.build());
     }
 
     @Override
-    public Future<RpcResult<GetLldpFloodIntervalOutput>> getLldpFloodInterval() {
+    public ListenableFuture<RpcResult<GetLldpFloodIntervalOutput>> getLldpFloodInterval(
+            GetLldpFloodIntervalInput intput) {
         RpcResultBuilder<GetLldpFloodIntervalOutput> rpcResultBuilder = RpcResultBuilder.success();
         GetLldpFloodIntervalOutputBuilder getLldpFloodIntervalOutputBuilder = new GetLldpFloodIntervalOutputBuilder();
         getLldpFloodIntervalOutputBuilder.setInterval(speakerInstance.getLldpFloodInterval());
index 4692fc3ae6114e3830b8fc0a3b78eb3e54fa076d..932a9d71858217e1961b2629284ba24ee437953b 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.openflowplugin.applications.southboundcli;
 
 import com.google.common.base.Optional;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.math.BigInteger;
 import java.time.LocalDateTime;
@@ -65,7 +66,7 @@ public class AdminReconciliationServiceImpl implements AdminReconciliationServic
 
 
     @Override
-    public Future<RpcResult<ReconcileOutput>> reconcile(ReconcileInput input) {
+    public ListenableFuture<RpcResult<ReconcileOutput>> reconcile(ReconcileInput input) {
         boolean reconcileAllNodes = input.isReconcileAllNodes();
         List<BigInteger> inputNodes = input.getNodes();
         if (inputNodes == null) {
@@ -119,7 +120,7 @@ public class AdminReconciliationServiceImpl implements AdminReconciliationServic
         return result;
     }
 
-    private Future<RpcResult<ReconcileOutput>> buildErrorResponse(String msg) {
+    private ListenableFuture<RpcResult<ReconcileOutput>> buildErrorResponse(String msg) {
         SettableFuture<RpcResult<ReconcileOutput>> result = SettableFuture.create();
         LOG.error(msg);
         RpcError error = RpcResultBuilder.newError(RpcError.ErrorType.PROTOCOL, "reconcile", msg);
index 14b06f08a305e4265bc18204503b0e3ea5cbcc63..3be3103914b392ff75081bfd5fedcd01918ffad7 100644 (file)
@@ -8,10 +8,10 @@
 package org.opendaylight.openflowplugin.extension.test;
 
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;
@@ -48,6 +48,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestFlowOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestService;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -67,7 +68,7 @@ public class Test implements TestService {
 
 
     @Override
-    public Future<RpcResult<Void>> testFlow(TestFlowInput input) {
+    public ListenableFuture<RpcResult<TestFlowOutput>> testFlow(TestFlowInput input) {
         AddFlowInputBuilder flow = new AddFlowInputBuilder();
         flow.setPriority(2);
         flow.setMatch(createMatchBld().build());
@@ -95,7 +96,7 @@ public class Test implements TestService {
 
         pushFlowViaRpc(flow.build());
 
-        return Futures.immediateFuture(RpcResultBuilder.<Void>status(true).build());
+        return Futures.immediateFuture(RpcResultBuilder.<TestFlowOutput>status(true).build());
     }
 
     private void pushFlowViaRpc(AddFlowInput addFlowInput) {
index 87119f423c314690e5831c2728d434bce66f8224..195cea24ec59c1f2978f65f5d7ae804deb907d08 100644 (file)
@@ -30,8 +30,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
@@ -41,17 +44,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModOutput;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
@@ -109,99 +121,99 @@ abstract class AbstractConnectionAdapter implements ConnectionAdapter {
     }
 
     @Override
-    public Future<RpcResult<BarrierOutput>> barrier(final BarrierInput input) {
+    public ListenableFuture<RpcResult<BarrierOutput>> barrier(final BarrierInput input) {
         return sendToSwitchExpectRpcResultFuture(input, BarrierOutput.class, "barrier-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<EchoOutput>> echo(final EchoInput input) {
+    public ListenableFuture<RpcResult<EchoOutput>> echo(final EchoInput input) {
         return sendToSwitchExpectRpcResultFuture(input, EchoOutput.class, "echo-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> echoReply(final EchoReplyInput input) {
+    public ListenableFuture<RpcResult<EchoReplyOutput>> echoReply(final EchoReplyInput input) {
         return sendToSwitchFuture(input, "echo-reply sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> experimenter(final ExperimenterInput input) {
+    public ListenableFuture<RpcResult<ExperimenterOutput>> experimenter(final ExperimenterInput input) {
         return sendToSwitchFuture(input, "experimenter sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> flowMod(final FlowModInput input) {
+    public ListenableFuture<RpcResult<FlowModOutput>> flowMod(final FlowModInput input) {
         return sendToSwitchFuture(input, "flow-mod sending failed");
     }
 
     @Override
-    public Future<RpcResult<GetConfigOutput>> getConfig(final GetConfigInput input) {
+    public ListenableFuture<RpcResult<GetConfigOutput>> getConfig(final GetConfigInput input) {
         return sendToSwitchExpectRpcResultFuture(input, GetConfigOutput.class, "get-config-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<GetFeaturesOutput>> getFeatures(final GetFeaturesInput input) {
+    public ListenableFuture<RpcResult<GetFeaturesOutput>> getFeatures(final GetFeaturesInput input) {
         return sendToSwitchExpectRpcResultFuture(input, GetFeaturesOutput.class, "get-features-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<GetQueueConfigOutput>> getQueueConfig(final GetQueueConfigInput input) {
+    public ListenableFuture<RpcResult<GetQueueConfigOutput>> getQueueConfig(final GetQueueConfigInput input) {
         return sendToSwitchExpectRpcResultFuture(input, GetQueueConfigOutput.class,
                 "get-queue-config-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> groupMod(final GroupModInput input) {
+    public ListenableFuture<RpcResult<GroupModOutput>> groupMod(final GroupModInput input) {
         return sendToSwitchFuture(input, "group-mod-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> hello(final HelloInput input) {
+    public ListenableFuture<RpcResult<HelloOutput>> hello(final HelloInput input) {
         return sendToSwitchFuture(input, "hello-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> meterMod(final MeterModInput input) {
+    public ListenableFuture<RpcResult<MeterModOutput>> meterMod(final MeterModInput input) {
         return sendToSwitchFuture(input, "meter-mod-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> packetOut(final PacketOutInput input) {
+    public ListenableFuture<RpcResult<PacketOutOutput>> packetOut(final PacketOutInput input) {
         return sendToSwitchFuture(input, "packet-out-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> multipartRequest(final MultipartRequestInput input) {
+    public ListenableFuture<RpcResult<MultipartRequestOutput>> multipartRequest(final MultipartRequestInput input) {
         return sendToSwitchFuture(input, "multi-part-request sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> portMod(final PortModInput input) {
+    public ListenableFuture<RpcResult<PortModOutput>> portMod(final PortModInput input) {
         return sendToSwitchFuture(input, "port-mod-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<RoleRequestOutput>> roleRequest(final RoleRequestInput input) {
+    public ListenableFuture<RpcResult<RoleRequestOutput>> roleRequest(final RoleRequestInput input) {
         return sendToSwitchExpectRpcResultFuture(input, RoleRequestOutput.class,
                 "role-request-config-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> setConfig(final SetConfigInput input) {
+    public ListenableFuture<RpcResult<SetConfigOutput>> setConfig(final SetConfigInput input) {
         return sendToSwitchFuture(input, "set-config-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> tableMod(final TableModInput input) {
+    public ListenableFuture<RpcResult<TableModOutput>> tableMod(final TableModInput input) {
         return sendToSwitchFuture(input, "table-mod-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<GetAsyncOutput>> getAsync(final GetAsyncInput input) {
+    public ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(final GetAsyncInput input) {
         return sendToSwitchExpectRpcResultFuture(input, GetAsyncOutput.class, "get-async-input sending failed");
     }
 
     @Override
-    public Future<RpcResult<Void>> setAsync(final SetAsyncInput input) {
+    public ListenableFuture<RpcResult<SetAsyncOutput>> setAsync(final SetAsyncInput input) {
         return sendToSwitchFuture(input, "set-async-input sending failed");
     }
 
@@ -281,8 +293,10 @@ abstract class AbstractConnectionAdapter implements ConnectionAdapter {
      *         <li>else {@link RpcResult} will contain errors and failed status</li>
      *         </ul>
      */
-    protected ListenableFuture<RpcResult<Void>> sendToSwitchFuture(final DataObject input, final String failureInfo) {
-        return enqueueMessage(new SimpleRpcListener(input, failureInfo));
+    protected <O extends DataObject> ListenableFuture<RpcResult<O>> sendToSwitchFuture(final Object input,
+                                                                                     final String failureInfo) {
+        SimpleRpcListener<O> listener = new SimpleRpcListener(input, failureInfo);
+        return enqueueMessage(listener);
     }
 
     private <T> ListenableFuture<RpcResult<T>> enqueueMessage(final AbstractRpcListener<T> promise) {
index 8fad3968c184ddf7921fe4690f115ba34c8cfc34..75cf2695c7dc0f47fc92ee27b5634069edea49a7 100644 (file)
@@ -11,10 +11,10 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection;
 import com.google.common.util.concurrent.ListenableFuture;
 import io.netty.channel.Channel;
 import java.net.InetSocketAddress;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowjava.statistics.CounterEventTypes;
 import org.opendaylight.openflowjava.statistics.StatisticsCounters;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.DisconnectEvent;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SwitchIdleEvent;
@@ -37,7 +37,7 @@ abstract class AbstractConnectionAdapterStatistics extends AbstractConnectionAda
     }
 
     @Override
-    public Future<RpcResult<Void>> flowMod(final FlowModInput input) {
+    public ListenableFuture<RpcResult<FlowModOutput>> flowMod(final FlowModInput input) {
         statisticsCounters.incrementCounter(CounterEventTypes.DS_FLOW_MODS_ENTERED);
         return super.flowMod(input);
     }
@@ -50,7 +50,8 @@ abstract class AbstractConnectionAdapterStatistics extends AbstractConnectionAda
     }
 
     @Override
-    protected ListenableFuture<RpcResult<Void>> sendToSwitchFuture(final DataObject input, final String failureInfo) {
+    protected <O extends DataObject> ListenableFuture<RpcResult<O>> sendToSwitchFuture(final Object input,
+                                                                         final String failureInfo) {
         statisticsCounters.incrementCounter(CounterEventTypes.DS_ENTERED_OFJAVA);
         return super.sendToSwitchFuture(input, failureInfo);
     }
index 15e12f18e3aa2b42e0dc0b7fb760925e956278f0..1563d4935482efe816bb67baaa8cb2248cbece26 100644 (file)
@@ -37,7 +37,6 @@ abstract class AbstractRpcListener<T> implements GenericFutureListener<Future<Vo
      * Create RcpError object.
      *
      * @param info error info
-     * @param severity - error severity
      * @param message error message
      * @param cause - details of reason
      * @return RpcError
index 011d32f6f0937c6ea7364b47767493662aae42b0..364eadb5aa61ee5f6bd4e481d29b2be99470ce35 100644 (file)
@@ -7,7 +7,9 @@
  */
 package org.opendaylight.openflowjava.protocol.impl.core.connection;
 
-final class SimpleRpcListener extends AbstractRpcListener<Void> {
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+final class SimpleRpcListener<T extends DataObject> extends AbstractRpcListener<T> {
     SimpleRpcListener(final Object message, final String failureInfo) {
         super(message, failureInfo);
     }
index 51c99dcc967e69e466a94fcd9bca7a3a873ddb0d..11da2f0dd9cc94395d58d98fb1d5e5de48b9077f 100644 (file)
@@ -56,7 +56,7 @@ public class SimpleRpcListenerTest {
      */
     @Test
     public void testSuccessfulRpc() {
-        SimpleRpcListener listener = new SimpleRpcListener("MESSAGE", "Failed to send message");
+        SimpleRpcListener<?> listener = new SimpleRpcListener("MESSAGE", "Failed to send message");
         listener.operationSuccessful();
         SettableFuture<RpcResult<?>> result = SettableFuture.create();
         result.set(RpcResultBuilder.success((Void)null).build());
@@ -75,7 +75,7 @@ public class SimpleRpcListenerTest {
     @Test
     public void testOperationComplete() {
         when(future.isSuccess()).thenReturn(false);
-        SimpleRpcListener listener = new SimpleRpcListener("MESSAGE", "Failed to send message");
+        SimpleRpcListener<?> listener = new SimpleRpcListener("MESSAGE", "Failed to send message");
         listener.operationComplete(future);
         verify(future, times(1)).cause();
         try {
@@ -91,7 +91,7 @@ public class SimpleRpcListenerTest {
     @Test
     public void testOperationComplete2() {
         when(future.isSuccess()).thenReturn(true);
-        SimpleRpcListener listener = new SimpleRpcListener("MESSAGE", "Failed to send message");
+        SimpleRpcListener<?> listener = new SimpleRpcListener("MESSAGE", "Failed to send message");
         listener.operationComplete(future);
         verify(future, times(0)).cause();
         try {
index a4dbfc649e37ea89f8b0759b2bea277674f22683..e2f9d91f973129315acd441c4d77579eab1e5a6a 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -329,12 +330,13 @@ public class HandshakeManagerImpl implements HandshakeManager {
         LOG.debug("sending hello message: version{}, xid={}, version bitmap={}", helloVersion, helloXid,
                   MessageFactory.digVersions(helloInput.getElements()));
 
-        Future<RpcResult<Void>> helloResult = connectionAdapter.hello(helloInput);
+        Future<RpcResult<HelloOutput>> helloResult = connectionAdapter.hello(helloInput);
 
-        ListenableFuture<RpcResult<Void>> rpcResultListenableFuture = JdkFutureAdapters.listenInPoolThread(helloResult);
-        Futures.addCallback(rpcResultListenableFuture, new FutureCallback<RpcResult<Void>>() {
+        ListenableFuture<RpcResult<HelloOutput>> rpcResultListenableFuture
+                = JdkFutureAdapters.listenInPoolThread(helloResult);
+        Futures.addCallback(rpcResultListenableFuture, new FutureCallback<RpcResult<HelloOutput>>() {
             @Override
-            public void onSuccess(@Nonnull RpcResult<Void> result) {
+            public void onSuccess(@Nonnull RpcResult<HelloOutput> result) {
                 if (result.isSuccessful()) {
                     LOG.debug("hello successfully sent, xid={}, addr={}", helloXid,
                               connectionAdapter.getRemoteAddress());
index ff58ba0e7d2e61097151dacbd48fdaaa5f9364a1..0f116b34cdd2c638a95d6f4cc850a0e372ed553c 100644 (file)
@@ -81,15 +81,13 @@ public class ContextChainImpl implements ContextChain {
     }
 
     @Override
-    public ListenableFuture<Void> closeServiceInstance() {
+    public ListenableFuture<?> closeServiceInstance() {
 
         contextChainMastershipWatcher.onSlaveRoleAcquired(deviceInfo);
 
-        final ListenableFuture<List<Void>> servicesToBeClosed = Futures
-                .allAsList(Lists.reverse(contexts)
-                        .stream()
-                        .map(OFPContext::closeServiceInstance)
-                        .collect(Collectors.toList()));
+        final ListenableFuture<?> servicesToBeClosed = Futures.allAsList(Lists.reverse(contexts).stream()
+            .map(OFPContext::closeServiceInstance)
+            .collect(Collectors.toList()));
 
         return Futures.transform(servicesToBeClosed, (input) -> {
             LOG.info("Closed clustering services for node {}", deviceInfo);
index aae88d9ff2e1fd209b619701962f21b2475673c5..fc7cf9ef2f66efe8d8399b6581b7982dc08bee6e 100644 (file)
@@ -95,18 +95,18 @@ public class GuardedContextImpl implements GuardedContext {
 
     @Override
     @SuppressWarnings("checkstyle:IllegalCatch")
-    public ListenableFuture<Void> closeServiceInstance() {
-        ListenableFuture<Void> result = Futures.immediateFuture(null);
+    public ListenableFuture<?> closeServiceInstance() {
+        ListenableFuture<?> result = Futures.immediateFuture(null);
 
         if (monitor.enterIf(isStoppable)) {
             try {
                 LOG.info("Stopping {} service for node {}", this, getDeviceInfo());
                 state = STOPPING;
-                final ListenableFuture<Void> resultFuture = delegate.closeServiceInstance();
+                final ListenableFuture<?> resultFuture = delegate.closeServiceInstance();
 
-                Futures.addCallback(resultFuture, new FutureCallback<Void>() {
+                Futures.addCallback(resultFuture, new FutureCallback<Object>() {
                     @Override
-                    public void onSuccess(@Nullable final Void result) {
+                    public void onSuccess(@Nullable final Object result) {
                         state = TERMINATED;
                     }
 
@@ -161,4 +161,4 @@ public class GuardedContextImpl implements GuardedContext {
             }
         }
     }
-}
\ No newline at end of file
+}
index ba4e61458cf18cdb595811ce5cd9a0a0e2b03d20..c2859606e4150afbc3f571ea42bb4068a4cde580 100644 (file)
@@ -12,10 +12,10 @@ import com.google.common.base.Function;
 import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.List;
 import java.util.Optional;
-import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -116,7 +116,7 @@ public class MultiLayerAggregateFlowMultipartService extends AbstractAggregateFl
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(
+    public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(
             final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
         return Futures.transform(handleServiceCall(input),
                      (Function<RpcResult<List<MultipartReply>>,
index fc23fad771d73a326923cf5f976884c09c433133..ddc13630d783cd70108999600c62022a181f2f80 100644 (file)
@@ -17,7 +17,6 @@ import com.google.common.util.concurrent.SettableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
-import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -94,7 +93,8 @@ public class MultiLayerExperimenterMultipartService extends AbstractExperimenter
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<SendExperimenterMpRequestOutput>> handleAndReply(SendExperimenterMpRequestInput input) {
+    public ListenableFuture<RpcResult<SendExperimenterMpRequestOutput>> handleAndReply(
+            SendExperimenterMpRequestInput input) {
         final ListenableFuture<RpcResult<List<MultipartReply>>> multipartFuture = handleServiceCall(input);
         final SettableFuture<RpcResult<SendExperimenterMpRequestOutput>> finalFuture = SettableFuture.create();
 
index aa4d9291155ea91e1fdf00ed70120c34a10fe78a..ba8b8a38c188798b93d99e101876964409f6507e 100644 (file)
@@ -18,7 +18,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
-import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
@@ -81,8 +80,7 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi
     }
 
     @Override
-
-    public Future<RpcResult<UpdateTableOutput>> handleAndReply(UpdateTableInput input) {
+    public ListenableFuture<RpcResult<UpdateTableOutput>> handleAndReply(UpdateTableInput input) {
         final ListenableFuture<RpcResult<List<MultipartReply>>> multipartFuture = handleServiceCall(input);
         final SettableFuture<RpcResult<UpdateTableOutput>> finalFuture = SettableFuture.create();
 
index 9374657928331b2db6d397eeb4d17cb3a2da8046..1259aeb5a7f5446bf58f8c68b47a5129a869a99f 100644 (file)
@@ -7,27 +7,28 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
-import org.opendaylight.openflowplugin.impl.services.AbstractVoidService;
+import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
 import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public class FlowCapableTransactionServiceImpl extends AbstractVoidService<SendBarrierInput>
+public class FlowCapableTransactionServiceImpl extends AbstractSimpleService<SendBarrierInput, SendBarrierOutput>
                                                implements FlowCapableTransactionService {
     public FlowCapableTransactionServiceImpl(final RequestContextStack requestContextStack,
                                              final DeviceContext deviceContext) {
-        super(requestContextStack, deviceContext);
+        super(requestContextStack, deviceContext, SendBarrierOutput.class);
     }
 
     @Override
-    public Future<RpcResult<Void>> sendBarrier(final SendBarrierInput input) {
+    public ListenableFuture<RpcResult<SendBarrierOutput>> sendBarrier(final SendBarrierInput input) {
         return handleServiceCall(input);
     }
 
index 2e90a8cc08b9dc6512184a03e391d1d72b2fd372..097960e0bdf3ad76bfc24ce6e6083bef46cc7cfe 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
@@ -28,7 +28,7 @@ public final class NodeConfigServiceImpl extends AbstractSimpleService<SetConfig
     }
 
     @Override
-    public Future<RpcResult<SetConfigOutput>> setConfig(final SetConfigInput input) {
+    public ListenableFuture<RpcResult<SetConfigOutput>> setConfig(final SetConfigInput input) {
         return handleServiceCall(input);
     }
 
index efd81e438e92c7ad2f9232c1a817e5a70bf8194a..5747461243c9225932dd1a0d350aeb8280e01fb4 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Optional;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
-import org.opendaylight.openflowplugin.impl.services.AbstractVoidService;
+import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
 import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.PacketOutConvertor;
@@ -21,9 +21,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketOutput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public final class PacketProcessingServiceImpl extends AbstractVoidService<TransmitPacketInput>
+public final class PacketProcessingServiceImpl extends AbstractSimpleService<TransmitPacketInput, TransmitPacketOutput>
                                                implements PacketProcessingService {
 
     private final ConvertorExecutor convertorExecutor;
@@ -31,12 +32,12 @@ public final class PacketProcessingServiceImpl extends AbstractVoidService<Trans
     public PacketProcessingServiceImpl(final RequestContextStack requestContextStack,
                                        final DeviceContext deviceContext,
                                        final ConvertorExecutor convertorExecutor) {
-        super(requestContextStack, deviceContext);
+        super(requestContextStack, deviceContext, TransmitPacketOutput.class);
         this.convertorExecutor = convertorExecutor;
     }
 
     @Override
-    public Future<RpcResult<Void>> transmitPacket(final TransmitPacketInput input) {
+    public ListenableFuture<RpcResult<TransmitPacketOutput>> transmitPacket(final TransmitPacketInput input) {
         return handleServiceCall(input);
     }
 
index 23ad2165058d5c3a470429854bf43b4f996dff3e..7ea34abc1729c203ba516278266666a8a68efa6a 100644 (file)
@@ -9,9 +9,9 @@
 package org.opendaylight.openflowplugin.impl.services.sal;
 
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.Objects;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerGetAsyncConfigService;
@@ -21,6 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.GetAsyncOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SalAsyncConfigService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncOutput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
@@ -31,20 +32,20 @@ public class SalAsyncConfigServiceImpl implements SalAsyncConfigService {
 
     public SalAsyncConfigServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
         setAsyncConfigService = new SingleLayerSetAsyncConfigService(requestContextStack, deviceContext);
-        getAsyncConfigService = new SingleLayerGetAsyncConfigService(requestContextStack, deviceContext);
+        this.getAsyncConfigService = new SingleLayerGetAsyncConfigService(requestContextStack, deviceContext);
     }
 
     @Override
-    public Future<RpcResult<Void>> setAsync(SetAsyncInput input) {
+    public ListenableFuture<RpcResult<SetAsyncOutput>> setAsync(SetAsyncInput input) {
         return setAsyncConfigService.handleServiceCall(input);
     }
 
     @Override
-    public Future<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) {
+    public ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) {
         return Futures.transform(getAsyncConfigService.handleServiceCall(input), result ->
                 Objects.nonNull(result) && result.isSuccessful()
                         ? RpcResultBuilder.success(new GetAsyncOutputBuilder(result.getResult())).build()
                         : RpcResultBuilder.<GetAsyncOutput>failed().build(),
                 MoreExecutors.directExecutor());
     }
-}
\ No newline at end of file
+}
index 3c30cc8509df77985b4606eb02b147c4f44c9567..531c2905df37868a27d9958408cff86ad7e9f849 100644 (file)
@@ -17,12 +17,14 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SalExperimenterMessageService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.messages.Message;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.BundleAddMessageSalBuilder;
@@ -46,17 +48,24 @@ public class SalBundleServiceImpl implements SalBundleService {
     }
 
     @Override
-    public Future<RpcResult<Void>> controlBundle(ControlBundleInput input) {
+    public ListenableFuture<RpcResult<ControlBundleOutput>> controlBundle(ControlBundleInput input) {
         final SendExperimenterInputBuilder experimenterInputBuilder = new SendExperimenterInputBuilder();
         experimenterInputBuilder.setNode(input.getNode());
         experimenterInputBuilder.setExperimenterMessageOfChoice(
                 new BundleControlSalBuilder().setSalControlData(new SalControlDataBuilder(input).build()).build());
-        return experimenterMessageService.sendExperimenter(experimenterInputBuilder.build());
+        return Futures.transform(experimenterMessageService.sendExperimenter(
+                experimenterInputBuilder.build()), sendExperimenterOutputRpcResult -> {
+                if (sendExperimenterOutputRpcResult.isSuccessful()) {
+                    return RpcResultBuilder.<ControlBundleOutput>success().build();
+                } else {
+                    return RpcResultBuilder.<ControlBundleOutput>failed().build();
+                }
+            }, MoreExecutors.directExecutor());
     }
 
     @Override
-    public Future<RpcResult<Void>> addBundleMessages(AddBundleMessagesInput input) {
-        final List<ListenableFuture<RpcResult<Void>>> partialResults = new ArrayList<>();
+    public ListenableFuture<RpcResult<AddBundleMessagesOutput>> addBundleMessages(AddBundleMessagesInput input) {
+        final List<ListenableFuture<RpcResult<SendExperimenterOutput>>> partialResults = new ArrayList<>();
         final SendExperimenterInputBuilder experimenterInputBuilder = new SendExperimenterInputBuilder();
         final BundleAddMessageSalBuilder bundleAddMessageBuilder = new BundleAddMessageSalBuilder();
         final SalAddMessageDataBuilder dataBuilder = new SalAddMessageDataBuilder();
@@ -69,22 +78,23 @@ public class SalBundleServiceImpl implements SalBundleService {
             dataBuilder.setBundleInnerMessage(message.getBundleInnerMessage());
             experimenterInputBuilder.setExperimenterMessageOfChoice(
                     bundleAddMessageBuilder.setSalAddMessageData(dataBuilder.build()).build());
-            ListenableFuture<RpcResult<Void>> res = JdkFutureAdapters
+            ListenableFuture<RpcResult<SendExperimenterOutput>> res = JdkFutureAdapters
                     .listenInPoolThread(experimenterMessageService.sendExperimenter(experimenterInputBuilder.build()));
             partialResults.add(res);
         }
         return processResults(partialResults);
     }
 
-    private static Future<RpcResult<Void>> processResults(
-            final List<ListenableFuture<RpcResult<Void>>> partialResults) {
-        final SettableFuture<RpcResult<Void>> result = SettableFuture.create();
-        Futures.addCallback(Futures.successfulAsList(partialResults), new FutureCallback<List<RpcResult<Void>>>() {
+    private static ListenableFuture<RpcResult<AddBundleMessagesOutput>> processResults(
+            final List<ListenableFuture<RpcResult<SendExperimenterOutput>>> partialResults) {
+        final SettableFuture<RpcResult<AddBundleMessagesOutput>> result = SettableFuture.create();
+        Futures.addCallback(Futures.successfulAsList(partialResults),new FutureCallback<
+                List<RpcResult<SendExperimenterOutput>>>() {
             @Override
-            public void onSuccess(@Nonnull List<RpcResult<Void>> results) {
+            public void onSuccess(@Nonnull List<RpcResult<SendExperimenterOutput>> results) {
                 final ArrayList<RpcError> errors = new ArrayList<>();
-                final RpcResultBuilder<Void> rpcResultBuilder;
-                for (RpcResult<Void> res : results) {
+                final RpcResultBuilder<AddBundleMessagesOutput> rpcResultBuilder;
+                for (RpcResult<SendExperimenterOutput> res : results) {
                     if (res == null) {
                         errors.add(RpcResultBuilder.newError(RpcError.ErrorType.APPLICATION, "BundleExtensionService",
                                                              "RpcResult is null."));
@@ -95,14 +105,14 @@ public class SalBundleServiceImpl implements SalBundleService {
                 if (errors.isEmpty()) {
                     rpcResultBuilder = RpcResultBuilder.success();
                 } else {
-                    rpcResultBuilder = RpcResultBuilder.<Void>failed().withRpcErrors(errors);
+                    rpcResultBuilder = RpcResultBuilder.<AddBundleMessagesOutput>failed().withRpcErrors(errors);
                 }
                 result.set(rpcResultBuilder.build());
             }
 
             @Override
             public void onFailure(Throwable throwable) {
-                RpcResultBuilder<Void> rpcResultBuilder = RpcResultBuilder.failed();
+                RpcResultBuilder<AddBundleMessagesOutput> rpcResultBuilder = RpcResultBuilder.failed();
                 result.set(rpcResultBuilder.build());
             }
         }, MoreExecutors.directExecutor());
index f0f9c91438ed1e7abcb43913087deaf7f04901c4..c9a6390a2e1d8a020f983b49dadc37ce2eb50cad 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.impl.services.EchoService;
@@ -33,13 +32,13 @@ public final class SalEchoServiceImpl implements SalEchoService {
     }
 
     @Override
-    public Future<RpcResult<SendEchoOutput>> sendEcho(final SendEchoInput sendEchoInput) {
+    public ListenableFuture<RpcResult<SendEchoOutput>> sendEcho(final SendEchoInput sendEchoInput) {
         final EchoInputBuilder echoInputBld = new EchoInputBuilder()
                 .setData(sendEchoInput.getData());
         return transform(echoService.handleServiceCall(echoInputBld));
     }
 
-    private Future<RpcResult<SendEchoOutput>>
+    private ListenableFuture<RpcResult<SendEchoOutput>>
             transform(final ListenableFuture<RpcResult<EchoOutput>> rpcResultListenableFuture) {
         return Futures.transform(rpcResultListenableFuture, input -> {
             Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL");
index 464aabb15449268eeb1975f4a3567989c1cde1bd..008913f8392d494bbf27a469486929752939bc99 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
@@ -17,10 +17,11 @@ import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
 import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
 import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
 import org.opendaylight.openflowplugin.extension.api.exception.ConverterNotFoundException;
-import org.opendaylight.openflowplugin.impl.services.AbstractVoidService;
+import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
 import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SalExperimenterMessageService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
@@ -32,7 +33,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendExperimenterInput>
+public class SalExperimenterMessageServiceImpl extends AbstractSimpleService<SendExperimenterInput,
+        SendExperimenterOutput>
                                                implements SalExperimenterMessageService {
 
     private static final Logger LOG = LoggerFactory.getLogger(SalExperimenterMessageServiceImpl.class);
@@ -41,7 +43,7 @@ public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendE
     public SalExperimenterMessageServiceImpl(final RequestContextStack requestContextStack,
                                              final DeviceContext deviceContext,
                                              final ExtensionConverterProvider extensionConverterProvider) {
-        super(requestContextStack, deviceContext);
+        super(requestContextStack, deviceContext, SendExperimenterOutput.class);
         this.extensionConverterProvider = extensionConverterProvider;
     }
 
@@ -83,7 +85,7 @@ public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendE
     }
 
     @Override
-    public Future<RpcResult<Void>> sendExperimenter(SendExperimenterInput input) {
+    public ListenableFuture<RpcResult<SendExperimenterOutput>> sendExperimenter(SendExperimenterInput input) {
         return handleServiceCall(input);
     }
 }
index ea00fc7e0db3f16623040297fc5f7223a19da091..a7b45e567a6ea67f153669ec4563a0edb85ad518 100755 (executable)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
@@ -33,7 +33,7 @@ public class SalExperimenterMpMessageServiceImpl implements SalExperimenterMpMes
     }
 
     @Override
-    public Future<RpcResult<SendExperimenterMpRequestOutput>>
+    public ListenableFuture<RpcResult<SendExperimenterMpRequestOutput>>
         sendExperimenterMpRequest(SendExperimenterMpRequestInput input) {
         return singleLayerService.canUseSingleLayerSerialization()
             ? singleLayerService.handleAndReply(input)
index bc1ee5943ac2da2932498c588e69969cc526efc4..5603e4c402f56f0347e3e9efb175f84dcc6b9c6c 100644 (file)
@@ -74,7 +74,7 @@ public class SalFlatBatchServiceImpl implements SalFlatBatchService {
     }
 
     @Override
-    public Future<RpcResult<ProcessFlatBatchOutput>> processFlatBatch(final ProcessFlatBatchInput input) {
+    public ListenableFuture<RpcResult<ProcessFlatBatchOutput>> processFlatBatch(final ProcessFlatBatchInput input) {
         LOG.trace("processing flat batch @ {} : {}",
                   PathUtil.extractNodeId(input.getNode()).getValue(),
                   input.getBatch().size());
@@ -90,7 +90,7 @@ public class SalFlatBatchServiceImpl implements SalFlatBatchService {
     }
 
     @VisibleForTesting
-    Future<RpcResult<ProcessFlatBatchOutput>> executeBatchPlan(final List<BatchStepJob> batchJobsChain) {
+    ListenableFuture<RpcResult<ProcessFlatBatchOutput>> executeBatchPlan(final List<BatchStepJob> batchJobsChain) {
         BatchStepJob batchJob;
         final List<ListenableFuture<RpcResult<ProcessFlatBatchOutput>>> firedJobs = new ArrayList<>();
         ListenableFuture<RpcResult<ProcessFlatBatchOutput>> chainSummaryResult =
index 73e5670c73923416bf134d28b8ecca01bb40a8c3..00448e8ac440748917dfbcbfd8c4668afe73f11e 100644 (file)
@@ -15,7 +15,6 @@ import com.google.common.util.concurrent.SettableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
-import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -83,7 +82,7 @@ public class SalFlowServiceImpl implements SalFlowService {
     }
 
     @Override
-    public Future<RpcResult<AddFlowOutput>> addFlow(final AddFlowInput input) {
+    public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(final AddFlowInput input) {
         final FlowRegistryKey flowRegistryKey =
                 FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
         final ListenableFuture<RpcResult<AddFlowOutput>> future;
@@ -100,7 +99,7 @@ public class SalFlowServiceImpl implements SalFlowService {
     }
 
     @Override
-    public Future<RpcResult<RemoveFlowOutput>> removeFlow(final RemoveFlowInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(final RemoveFlowInput input) {
         final ListenableFuture<RpcResult<RemoveFlowOutput>> future;
 
         if (flowRemoveMessage.canUseSingleLayerSerialization()) {
@@ -116,7 +115,7 @@ public class SalFlowServiceImpl implements SalFlowService {
     }
 
     @Override
-    public Future<RpcResult<UpdateFlowOutput>> updateFlow(final UpdateFlowInput input) {
+    public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(final UpdateFlowInput input) {
         final UpdatedFlow updated = input.getUpdatedFlow();
         final OriginalFlow original = input.getOriginalFlow();
 
index 7b33a60a658099cf328137b5fdd4f047a1dda556..889a0127f238cf2846feb94529c8b0226b7ef5c2 100644 (file)
@@ -14,7 +14,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.impl.util.BarrierUtil;
 import org.opendaylight.openflowplugin.impl.util.FlowUtil;
 import org.opendaylight.openflowplugin.impl.util.PathUtil;
@@ -67,7 +66,7 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
     }
 
     @Override
-    public Future<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBatch(final RemoveFlowsBatchInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBatch(final RemoveFlowsBatchInput input) {
         LOG.trace("Removing flows @ {} : {}",
                   PathUtil.extractNodeId(input.getNode()),
                   input.getBatchRemoveFlows().size());
@@ -97,7 +96,7 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
     }
 
     @Override
-    public Future<RpcResult<AddFlowsBatchOutput>> addFlowsBatch(final AddFlowsBatchInput input) {
+    public ListenableFuture<RpcResult<AddFlowsBatchOutput>> addFlowsBatch(final AddFlowsBatchInput input) {
         LOG.trace("Adding flows @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchAddFlows().size());
         final ArrayList<ListenableFuture<RpcResult<AddFlowOutput>>> resultsLot = new ArrayList<>();
         for (BatchFlowInputGrouping batchFlow : input.getBatchAddFlows()) {
@@ -135,7 +134,7 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
     }
 
     @Override
-    public Future<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBatch(final UpdateFlowsBatchInput input) {
+    public ListenableFuture<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBatch(final UpdateFlowsBatchInput input) {
         LOG.trace("Updating flows @ {} : {}",
                   PathUtil.extractNodeId(input.getNode()),
                   input.getBatchUpdateFlows().size());
index c66cbe9d0ee162cedfef98b54d4862586c08320c..d31096028fa79800bfff3ab24ebaa2ee2c060ad8 100755 (executable)
@@ -11,7 +11,6 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
@@ -67,7 +66,7 @@ public class SalGroupServiceImpl implements SalGroupService {
     }
 
     @Override
-    public Future<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
+    public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
         final ListenableFuture<RpcResult<AddGroupOutput>> resultFuture =
             addGroupMessage.canUseSingleLayerSerialization()
             ? addGroupMessage.handleServiceCall(input)
@@ -98,7 +97,7 @@ public class SalGroupServiceImpl implements SalGroupService {
 
 
     @Override
-    public Future<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
+    public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
         final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture =
             updateGroupMessage.canUseSingleLayerSerialization()
             ? updateGroupMessage.handleServiceCall(input.getUpdatedGroup())
@@ -129,7 +128,7 @@ public class SalGroupServiceImpl implements SalGroupService {
     }
 
     @Override
-    public Future<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
+    public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
         final ListenableFuture<RpcResult<RemoveGroupOutput>> resultFuture =
             removeGroupMessage.canUseSingleLayerSerialization()
             ? removeGroupMessage.handleServiceCall(input)
index 7a213902603f6eac719194f33f6833f49846c2bd..1f04d90c1ad44739b1dd12870e9e41b94c626415 100644 (file)
@@ -14,7 +14,6 @@ import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import org.opendaylight.openflowplugin.impl.util.BarrierUtil;
 import org.opendaylight.openflowplugin.impl.util.GroupUtil;
@@ -70,7 +69,7 @@ public class SalGroupsBatchServiceImpl implements SalGroupsBatchService {
     }
 
     @Override
-    public Future<RpcResult<UpdateGroupsBatchOutput>> updateGroupsBatch(final UpdateGroupsBatchInput input) {
+    public ListenableFuture<RpcResult<UpdateGroupsBatchOutput>> updateGroupsBatch(final UpdateGroupsBatchInput input) {
         final List<BatchUpdateGroups> batchUpdateGroups = input.getBatchUpdateGroups();
         LOG.trace("Updating groups @ {} : {}", PathUtil.extractNodeId(input.getNode()), batchUpdateGroups.size());
 
@@ -103,7 +102,7 @@ public class SalGroupsBatchServiceImpl implements SalGroupsBatchService {
     }
 
     @Override
-    public Future<RpcResult<AddGroupsBatchOutput>> addGroupsBatch(final AddGroupsBatchInput input) {
+    public ListenableFuture<RpcResult<AddGroupsBatchOutput>> addGroupsBatch(final AddGroupsBatchInput input) {
         LOG.trace("Adding groups @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchAddGroups().size());
         final ArrayList<ListenableFuture<RpcResult<AddGroupOutput>>> resultsLot = new ArrayList<>();
         for (BatchAddGroups addGroup : input.getBatchAddGroups()) {
@@ -128,7 +127,7 @@ public class SalGroupsBatchServiceImpl implements SalGroupsBatchService {
     }
 
     @Override
-    public Future<RpcResult<RemoveGroupsBatchOutput>> removeGroupsBatch(final RemoveGroupsBatchInput input) {
+    public ListenableFuture<RpcResult<RemoveGroupsBatchOutput>> removeGroupsBatch(final RemoveGroupsBatchInput input) {
         LOG.trace("Removing groups @ {} : {}", PathUtil.extractNodeId(input.getNode()),
                   input.getBatchRemoveGroups().size());
         final ArrayList<ListenableFuture<RpcResult<RemoveGroupOutput>>> resultsLot = new ArrayList<>();
index 15470d25d5f84e2d8062d3868d4853dab47a16ce..6c7cd2aae1315ed4ebabc727298b723242613d37 100755 (executable)
@@ -11,7 +11,6 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
@@ -67,7 +66,7 @@ public class SalMeterServiceImpl implements SalMeterService {
     }
 
     @Override
-    public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
+    public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
         final ListenableFuture<RpcResult<AddMeterOutput>> resultFuture =
                 addMeterMessage.canUseSingleLayerSerialization()
                         ? addMeterMessage.handleServiceCall(input)
@@ -97,7 +96,7 @@ public class SalMeterServiceImpl implements SalMeterService {
     }
 
     @Override
-    public Future<RpcResult<UpdateMeterOutput>> updateMeter(final UpdateMeterInput input) {
+    public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(final UpdateMeterInput input) {
         final ListenableFuture<RpcResult<UpdateMeterOutput>> resultFuture =
                 updateMeterMessage.canUseSingleLayerSerialization()
                         ? updateMeterMessage.handleServiceCall(input.getUpdatedMeter())
@@ -129,7 +128,7 @@ public class SalMeterServiceImpl implements SalMeterService {
     }
 
     @Override
-    public Future<RpcResult<RemoveMeterOutput>> removeMeter(final RemoveMeterInput input) {
+    public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(final RemoveMeterInput input) {
         final ListenableFuture<RpcResult<RemoveMeterOutput>> resultFuture =
                 removeMeterMessage.canUseSingleLayerSerialization()
                         ? removeMeterMessage.handleServiceCall(input)
index bc68da0956b4ccb9b05f5516612f92925f9775ba..599a8f9f931cc98d173a1a5d98879ea63e342331 100644 (file)
@@ -15,7 +15,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import org.opendaylight.openflowplugin.impl.util.BarrierUtil;
 import org.opendaylight.openflowplugin.impl.util.MeterUtil;
@@ -71,7 +70,7 @@ public class SalMetersBatchServiceImpl implements SalMetersBatchService {
     }
 
     @Override
-    public Future<RpcResult<UpdateMetersBatchOutput>> updateMetersBatch(final UpdateMetersBatchInput input) {
+    public ListenableFuture<RpcResult<UpdateMetersBatchOutput>> updateMetersBatch(final UpdateMetersBatchInput input) {
         final List<BatchUpdateMeters> batchUpdateMeters = input.getBatchUpdateMeters();
         LOG.trace("Updating meters @ {} : {}", PathUtil.extractNodeId(input.getNode()), batchUpdateMeters.size());
 
@@ -107,7 +106,7 @@ public class SalMetersBatchServiceImpl implements SalMetersBatchService {
     }
 
     @Override
-    public Future<RpcResult<AddMetersBatchOutput>> addMetersBatch(final AddMetersBatchInput input) {
+    public ListenableFuture<RpcResult<AddMetersBatchOutput>> addMetersBatch(final AddMetersBatchInput input) {
         LOG.trace("Adding meters @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchAddMeters().size());
         final ArrayList<ListenableFuture<RpcResult<AddMeterOutput>>> resultsLot = new ArrayList<>();
         for (BatchAddMeters addMeter : input.getBatchAddMeters()) {
@@ -135,7 +134,7 @@ public class SalMetersBatchServiceImpl implements SalMetersBatchService {
     }
 
     @Override
-    public Future<RpcResult<RemoveMetersBatchOutput>> removeMetersBatch(final RemoveMetersBatchInput input) {
+    public ListenableFuture<RpcResult<RemoveMetersBatchOutput>> removeMetersBatch(final RemoveMetersBatchInput input) {
         LOG.trace("Removing meters @ {} : {}",
                   PathUtil.extractNodeId(input.getNode()),
                   input.getBatchRemoveMeters().size());
index bf5e344ed5bafb9d18209a95622d64cc241c30d4..159ccc6cedca7d3ebd72560807a2dab429f30e6d 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Optional;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
@@ -43,7 +43,7 @@ public final class SalPortServiceImpl
     }
 
     @Override
-    public Future<RpcResult<UpdatePortOutput>> updatePort(final UpdatePortInput input) {
+    public ListenableFuture<RpcResult<UpdatePortOutput>> updatePort(final UpdatePortInput input) {
         return portMessage.canUseSingleLayerSerialization()
             ? portMessage.handleServiceCall(getPortFromInput(input))
             : handleServiceCall(input);
index 2fafa27a78f137e67847aea8a1570340d970ac7b..7175483ee5930b3e4998b6e5433cdd9fe2a62d1d 100644 (file)
@@ -53,7 +53,7 @@ public final class SalRoleServiceImpl extends AbstractSimpleService<SetRoleInput
     }
 
     @Override
-    public Future<RpcResult<SetRoleOutput>> setRole(final SetRoleInput input) {
+    public ListenableFuture<RpcResult<SetRoleOutput>> setRole(final SetRoleInput input) {
         LOG.info("SetRole called with input:{}", input);
 
         // Check current connection state
@@ -102,4 +102,4 @@ public final class SalRoleServiceImpl extends AbstractSimpleService<SetRoleInput
             return BigInteger.ZERO;
         }
     }
-}
\ No newline at end of file
+}
index 0fe78315a604b6997f743df348f298804cd06e0b..e94f65b35031a4292f652e3ed69cb1b62949d65d 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
@@ -38,7 +38,7 @@ public final class SalTableServiceImpl implements SalTableService {
     }
 
     @Override
-    public Future<RpcResult<UpdateTableOutput>> updateTable(final UpdateTableInput input) {
+    public ListenableFuture<RpcResult<UpdateTableOutput>> updateTable(final UpdateTableInput input) {
         return singleLayerService.canUseSingleLayerSerialization()
             ? singleLayerService.handleAndReply(input)
             : multiLayerService.handleAndReply(input);
index 2625e6fd95d99d456401f3c24a3d1c2cd18e43df..14bf93ae58ec50c5a7a51111bd9e7301314a70f8 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.openflowplugin.impl.services.singlelayer;
 
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
@@ -52,7 +52,7 @@ public class SingleLayerAggregateFlowMultipartService
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(
+    public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(
             final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
         return Futures.transform(handleServiceCall(input), result -> {
             if (Preconditions.checkNotNull(result).isSuccessful()) {
index ef44bd52de900b9e2d4cd7a5a1035ab4d18b4c5e..b69525b5c0bfdcbf192c1a0022986dd64ef644b1 100644 (file)
@@ -10,10 +10,10 @@ package org.opendaylight.openflowplugin.impl.services.singlelayer;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.List;
-import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -56,7 +56,8 @@ public class SingleLayerExperimenterMultipartService extends AbstractExperimente
     }
 
     @Override
-    public Future<RpcResult<SendExperimenterMpRequestOutput>> handleAndReply(SendExperimenterMpRequestInput input) {
+    public ListenableFuture<RpcResult<SendExperimenterMpRequestOutput>> handleAndReply(
+            SendExperimenterMpRequestInput input) {
         final SettableFuture<RpcResult<SendExperimenterMpRequestOutput>> future = SettableFuture.create();
 
         Futures.addCallback(handleServiceCall(input), new FutureCallback<RpcResult<List<MultipartReply>>>() {
index b4ab33ab2866aeac681a01e0fec23b0a84e9f5b5..0e4f9971a56237c808a8a58df3e7230130090d7c 100644 (file)
@@ -11,17 +11,18 @@ package org.opendaylight.openflowplugin.impl.services.singlelayer;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
-import org.opendaylight.openflowplugin.impl.services.AbstractVoidService;
+import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
 import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.AsyncConfigMessageBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
-public class SingleLayerSetAsyncConfigService extends AbstractVoidService<SetAsyncInput> {
+public class SingleLayerSetAsyncConfigService extends AbstractSimpleService<SetAsyncInput, SetAsyncOutput> {
 
     public SingleLayerSetAsyncConfigService(final RequestContextStack requestContextStack,
                                             final DeviceContext deviceContext) {
-        super(requestContextStack, deviceContext);
+        super(requestContextStack, deviceContext, SetAsyncOutput.class);
     }
 
     @Override
index e91ad820b255fc6618870e66ce06f383e2d283e9..497148d499907b63e204ca23a80c28b803aa5d9b 100644 (file)
@@ -10,11 +10,11 @@ package org.opendaylight.openflowplugin.impl.services.singlelayer;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.math.BigInteger;
 import java.util.List;
-import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -61,7 +61,7 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
     }
 
     @Override
-    public Future<RpcResult<UpdateTableOutput>> handleAndReply(UpdateTableInput input) {
+    public ListenableFuture<RpcResult<UpdateTableOutput>> handleAndReply(UpdateTableInput input) {
         final SettableFuture<RpcResult<UpdateTableOutput>> finalFuture = SettableFuture.create();
 
         Futures.addCallback(handleServiceCall(input), new FutureCallback<RpcResult<List<MultipartReply>>>() {
index 2a38430845f5d6009ebde3280164cc3c136f6b74..6d15aa2827aac2b8cac990f33ae680cdd1bc5aea 100644 (file)
@@ -9,10 +9,10 @@
 package org.opendaylight.openflowplugin.impl.statistics;
 
 import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.Future;
 import java.util.concurrent.Semaphore;
 import javax.annotation.Nonnull;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
@@ -26,6 +26,8 @@ import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProviderFac
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.GetStatisticsWorkModeInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.GetStatisticsWorkModeOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.GetStatisticsWorkModeOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.StatisticsManagerControlService;
@@ -61,14 +63,16 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
     }
 
     @Override
-    public Future<RpcResult<GetStatisticsWorkModeOutput>> getStatisticsWorkMode() {
+    public ListenableFuture<RpcResult<GetStatisticsWorkModeOutput>> getStatisticsWorkMode(
+            GetStatisticsWorkModeInput input) {
         return RpcResultBuilder.success(new GetStatisticsWorkModeOutputBuilder()
                 .setMode(workMode)
                 .build()).buildFuture();
     }
 
     @Override
-    public Future<RpcResult<Void>> changeStatisticsWorkMode(ChangeStatisticsWorkModeInput input) {
+    public ListenableFuture<RpcResult<ChangeStatisticsWorkModeOutput>> changeStatisticsWorkMode(
+            ChangeStatisticsWorkModeInput input) {
         if (workModeGuard.tryAcquire()) {
             final StatisticsWorkMode targetWorkMode = input.getMode();
             isStatisticsFullyDisabled = StatisticsWorkMode.FULLYDISABLED.equals(targetWorkMode);
@@ -87,10 +91,10 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
             });
 
             workModeGuard.release();
-            return RpcResultBuilder.<Void>success().buildFuture();
+            return RpcResultBuilder.<ChangeStatisticsWorkModeOutput>success().buildFuture();
         }
 
-        return RpcResultBuilder.<Void>failed()
+        return RpcResultBuilder.<ChangeStatisticsWorkModeOutput>failed()
                 .withError(RpcError.ErrorType.APPLICATION,
                         "Statistics work mode change is already in progress")
                 .buildFuture();
index b9debdd8b890cfa960f09607af8dcdbeec8d7283..a61629e29b39e91af1edea90460350642c983155 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.TranslatorLibrary;
@@ -65,7 +65,7 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>>
+    public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>>
         getAggregateFlowStatisticsFromFlowTableForAllFlows(
                 final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
         if (delegate != null) {
@@ -76,7 +76,7 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
+    public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
         getAggregateFlowStatisticsFromFlowTableForGivenMatch(
                 final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
         return singleLayerService.canUseSingleLayerSerialization()
@@ -91,7 +91,7 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(
+    public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(
             final GetAllFlowStatisticsFromFlowTableInput input) {
         if (delegate != null) {
             return delegate.getAllFlowStatisticsFromFlowTable(input);
@@ -107,8 +107,8 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> getAllFlowsStatisticsFromAllFlowTables(
-            final GetAllFlowsStatisticsFromAllFlowTablesInput input) {
+    public ListenableFuture<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>>
+        getAllFlowsStatisticsFromAllFlowTables(final GetAllFlowsStatisticsFromAllFlowTablesInput input) {
         if (delegate != null) {
             return delegate.getAllFlowsStatisticsFromAllFlowTables(input);
         } else {
@@ -123,7 +123,7 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(
+    public ListenableFuture<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(
             final GetFlowStatisticsFromFlowTableInput input) {
         if (delegate != null) {
             return delegate.getFlowStatisticsFromFlowTable(input);
index 9249109c63e090cdd676a2856872348b86eddfaf..67eae3a62470695695b7082ab267f09d1911f2e4 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -58,7 +58,7 @@ public final class OpendaylightFlowTableStatisticsServiceImpl extends
     }
 
     @Override
-    public Future<RpcResult<GetFlowTablesStatisticsOutput>> getFlowTablesStatistics(
+    public ListenableFuture<RpcResult<GetFlowTablesStatisticsOutput>> getFlowTablesStatistics(
             final GetFlowTablesStatisticsInput input) {
         return handleAndNotify(input, notificationPublishService);
     }
index 5b75ecc7a42bb1e1fd4fbc464123965ffdca7d93..4199186dcdf8ce83b24736a9f53ab8c0db101efa 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -48,23 +48,25 @@ public class OpendaylightGroupStatisticsServiceImpl implements OpendaylightGroup
     }
 
     @Override
-    public Future<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(
+    public ListenableFuture<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(
             final GetAllGroupStatisticsInput input) {
         return allGroups.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetGroupDescriptionOutput>> getGroupDescription(final GetGroupDescriptionInput input) {
+    public ListenableFuture<RpcResult<GetGroupDescriptionOutput>> getGroupDescription(
+            final GetGroupDescriptionInput input) {
         return groupDesc.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetGroupFeaturesOutput>> getGroupFeatures(final GetGroupFeaturesInput input) {
+    public ListenableFuture<RpcResult<GetGroupFeaturesOutput>> getGroupFeatures(final GetGroupFeaturesInput input) {
         return groupFeat.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(final GetGroupStatisticsInput input) {
+    public ListenableFuture<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(
+            final GetGroupStatisticsInput input) {
         return groupStats.handleAndNotify(input, notificationPublishService);
     }
 }
index 03513d001aafa021b15405268abd7bc778112ee6..5e00bce0b2c93449b411acf68cd3945705c42d11 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -51,24 +51,25 @@ public class OpendaylightMeterStatisticsServiceImpl implements OpendaylightMeter
     }
 
     @Override
-    public Future<RpcResult<GetAllMeterConfigStatisticsOutput>> getAllMeterConfigStatistics(
+    public ListenableFuture<RpcResult<GetAllMeterConfigStatisticsOutput>> getAllMeterConfigStatistics(
             final GetAllMeterConfigStatisticsInput input) {
         return allMeterConfig.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetAllMeterStatisticsOutput>> getAllMeterStatistics(
+    public ListenableFuture<RpcResult<GetAllMeterStatisticsOutput>> getAllMeterStatistics(
                                                                       final GetAllMeterStatisticsInput input) {
         return allMeterStats.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetMeterFeaturesOutput>> getMeterFeatures(final GetMeterFeaturesInput input) {
+    public ListenableFuture<RpcResult<GetMeterFeaturesOutput>> getMeterFeatures(final GetMeterFeaturesInput input) {
         return meterFeatures.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetMeterStatisticsOutput>> getMeterStatistics(final GetMeterStatisticsInput input) {
+    public ListenableFuture<RpcResult<GetMeterStatisticsOutput>> getMeterStatistics(
+            final GetMeterStatisticsInput input) {
         return meterStats.handleAndNotify(input, notificationPublishService);
     }
 }
index 7f97e503d2128fda4d227ad720049b1da4d6a8b5..3971f7f60b9c3f8584aab61b293147857aaa5350 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -34,13 +34,13 @@ public class OpendaylightPortStatisticsServiceImpl implements OpendaylightPortSt
     }
 
     @Override
-    public Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> getAllNodeConnectorsStatistics(
+    public ListenableFuture<RpcResult<GetAllNodeConnectorsStatisticsOutput>> getAllNodeConnectorsStatistics(
             final GetAllNodeConnectorsStatisticsInput input) {
         return allPortStats.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetNodeConnectorStatisticsOutput>> getNodeConnectorStatistics(
+    public ListenableFuture<RpcResult<GetNodeConnectorStatisticsOutput>> getNodeConnectorStatistics(
             final GetNodeConnectorStatisticsInput input) {
         return portStats.handleAndNotify(input, notificationPublishService);
     }
index 2c90974a310dd31fe2836e960f9af26a1516da30..91a9f44ff82d3a2a3749dc4812bb2a551b1c4bd9 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -38,19 +38,19 @@ public class OpendaylightQueueStatisticsServiceImpl implements OpendaylightQueue
     }
 
     @Override
-    public Future<RpcResult<GetAllQueuesStatisticsFromAllPortsOutput>> getAllQueuesStatisticsFromAllPorts(
+    public ListenableFuture<RpcResult<GetAllQueuesStatisticsFromAllPortsOutput>> getAllQueuesStatisticsFromAllPorts(
             final GetAllQueuesStatisticsFromAllPortsInput input) {
         return allQueuesAllPorts.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetAllQueuesStatisticsFromGivenPortOutput>> getAllQueuesStatisticsFromGivenPort(
+    public ListenableFuture<RpcResult<GetAllQueuesStatisticsFromGivenPortOutput>> getAllQueuesStatisticsFromGivenPort(
             final GetAllQueuesStatisticsFromGivenPortInput input) {
         return allQueuesOnePort.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetQueueStatisticsFromGivenPortOutput>> getQueueStatisticsFromGivenPort(
+    public ListenableFuture<RpcResult<GetQueueStatisticsFromGivenPortOutput>> getQueueStatisticsFromGivenPort(
             final GetQueueStatisticsFromGivenPortInput input) {
         return oneQueueOnePort.handleAndNotify(input, notificationPublishService);
     }
index f172802608175b4817d117ffd040dfce9ab47728..b0f9378da942b0e87030aefa029af460fbc193e3 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services.compatibility;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -67,7 +67,7 @@ public class OpendaylightFlowStatisticsServiceDelegateImpl implements Opendaylig
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
+    public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
         getAggregateFlowStatisticsFromFlowTableForGivenMatch(
             final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
         throw new IllegalAccessError("unsupported by backward compatibility delegate service "
@@ -75,26 +75,26 @@ public class OpendaylightFlowStatisticsServiceDelegateImpl implements Opendaylig
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>>
+    public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>>
         getAggregateFlowStatisticsFromFlowTableForAllFlows(
             final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
         return aggregateFlowsInTable.handleAndNotify(input, notificationService);
     }
 
     @Override
-    public Future<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(
+    public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(
             final GetAllFlowStatisticsFromFlowTableInput input) {
         return allFlowsInTable.handleAndNotify(input, notificationService);
     }
 
     @Override
-    public Future<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> getAllFlowsStatisticsFromAllFlowTables(
-            final GetAllFlowsStatisticsFromAllFlowTablesInput input) {
+    public ListenableFuture<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>>
+        getAllFlowsStatisticsFromAllFlowTables(final GetAllFlowsStatisticsFromAllFlowTablesInput input) {
         return allFlowsInAllTables.handleAndNotify(input, notificationService);
     }
 
     @Override
-    public Future<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(
+    public ListenableFuture<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(
             final GetFlowStatisticsFromFlowTableInput input) {
         return flowsInTable.handleAndNotify(input, notificationService);
     }
index b517e98819b54f94fda8b7b2bc2b11d654bc8510..6db39e522aa03ce0282c2a15651d023f52380cda 100644 (file)
@@ -13,7 +13,6 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -69,7 +68,7 @@ abstract class AbstractDirectStatisticsService<I extends StoreStatsGrouping,
      * @param input the input
      * @return the future
      */
-    Future<RpcResult<O>> handleAndReply(final I input) {
+    ListenableFuture<RpcResult<O>> handleAndReply(final I input) {
         final ListenableFuture<RpcResult<List<T>>> rpcReply = handleServiceCall(input);
         ListenableFuture<RpcResult<O>> rpcResult = Futures.transform(rpcReply,
                 this::transformResult,
index d9f1f85aef8a790cf5b17241ad5c6d0b2942aba7..d8faf06d5f501c650f7977d2aeaeade0ec715a89 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.openflowplugin.impl.statistics.services.direct;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetGroupStatisticsInput;
@@ -43,7 +43,7 @@ public class OpendaylightDirectStatisticsServiceImpl implements OpendaylightDire
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(GetGroupStatisticsInput input) {
+    public ListenableFuture<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(GetGroupStatisticsInput input) {
         return provider.lookup(AbstractGroupDirectStatisticsService.class)
                 .map(service -> service.handleAndReply(input))
                 .orElse(missingImplementation(AbstractGroupDirectStatisticsService.class));
@@ -51,7 +51,7 @@ public class OpendaylightDirectStatisticsServiceImpl implements OpendaylightDire
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<GetQueueStatisticsOutput>> getQueueStatistics(GetQueueStatisticsInput input) {
+    public ListenableFuture<RpcResult<GetQueueStatisticsOutput>> getQueueStatistics(GetQueueStatisticsInput input) {
         return provider.lookup(AbstractQueueDirectStatisticsService.class)
                 .map(service -> service.handleAndReply(input))
                 .orElse(missingImplementation(AbstractQueueDirectStatisticsService.class));
@@ -59,7 +59,7 @@ public class OpendaylightDirectStatisticsServiceImpl implements OpendaylightDire
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<GetFlowStatisticsOutput>> getFlowStatistics(GetFlowStatisticsInput input) {
+    public ListenableFuture<RpcResult<GetFlowStatisticsOutput>> getFlowStatistics(GetFlowStatisticsInput input) {
         return provider.lookup(AbstractFlowDirectStatisticsService.class)
                 .map(service -> service.handleAndReply(input))
                 .orElse(missingImplementation(AbstractFlowDirectStatisticsService.class));
@@ -67,7 +67,7 @@ public class OpendaylightDirectStatisticsServiceImpl implements OpendaylightDire
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<GetMeterStatisticsOutput>> getMeterStatistics(GetMeterStatisticsInput input) {
+    public ListenableFuture<RpcResult<GetMeterStatisticsOutput>> getMeterStatistics(GetMeterStatisticsInput input) {
         return provider.lookup(AbstractMeterDirectStatisticsService.class)
                 .map(service -> service.handleAndReply(input))
                 .orElse(missingImplementation(AbstractMeterDirectStatisticsService.class));
@@ -75,14 +75,14 @@ public class OpendaylightDirectStatisticsServiceImpl implements OpendaylightDire
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<GetNodeConnectorStatisticsOutput>>
+    public ListenableFuture<RpcResult<GetNodeConnectorStatisticsOutput>>
             getNodeConnectorStatistics(GetNodeConnectorStatisticsInput input) {
         return provider.lookup(AbstractPortDirectStatisticsService.class)
                 .map(service -> service.handleAndReply(input))
                 .orElse(missingImplementation(AbstractPortDirectStatisticsService.class));
     }
 
-    private static <T extends DataObject> Future<RpcResult<T>> missingImplementation(Class service) {
+    private static <T extends DataObject> ListenableFuture<RpcResult<T>> missingImplementation(Class service) {
         return RpcResultBuilder.<T>failed().withError(
                 RpcError.ErrorType.APPLICATION,
                 String.format("No implementation found for direct statistics service %s.", service.getCanonicalName()))
index 6c40f55a81d6fa0bbce47b963345de12364b3bba..09bf3596fa9d5d782e1524e70a45646677996da9 100644 (file)
@@ -13,12 +13,12 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import javax.annotation.Nullable;
 import org.apache.commons.lang3.tuple.MutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
@@ -47,26 +47,23 @@ public final class BarrierUtil {
     public static <T> ListenableFuture<RpcResult<T>> chainBarrier(
             final ListenableFuture<RpcResult<T>> input, final NodeRef nodeRef,
             final FlowCapableTransactionService transactionService,
-            final Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> compositeTransform) {
-        final MutablePair<RpcResult<T>, RpcResult<Void>> resultPair = new MutablePair<>();
+            final Function<Pair<RpcResult<T>, RpcResult<SendBarrierOutput>>, RpcResult<T>> compositeTransform) {
+        final MutablePair<RpcResult<T>, RpcResult<SendBarrierOutput>> resultPair = new MutablePair<>();
 
         // store input result and append barrier
-        final ListenableFuture<RpcResult<Void>> barrierResult = Futures.transformAsync(input,
+        final ListenableFuture<RpcResult<SendBarrierOutput>> barrierResult = Futures.transformAsync(input,
             interInput -> {
                 resultPair.setLeft(interInput);
                 final SendBarrierInput barrierInput = createSendBarrierInput(nodeRef);
                 return JdkFutureAdapters.listenInPoolThread(transactionService.sendBarrier(barrierInput));
             }, MoreExecutors.directExecutor());
         // store barrier result and return initiated pair
-        final ListenableFuture<Pair<RpcResult<T>, RpcResult<Void>>> compositeResult = Futures.transform(
-                barrierResult, new Function<RpcResult<Void>, Pair<RpcResult<T>, RpcResult<Void>>>() {
-                    @Nullable
-                    @Override
-                    public Pair<RpcResult<T>, RpcResult<Void>> apply(@Nullable final RpcResult<Void> input) {
-                        resultPair.setRight(input);
-                        return resultPair;
-                    }
-                }, MoreExecutors.directExecutor());
+        final ListenableFuture<Pair<RpcResult<T>, RpcResult<SendBarrierOutput>>> compositeResult = Futures.transform(
+                barrierResult,
+            input1 -> {
+                resultPair.setRight(input1);
+                return resultPair;
+            }, MoreExecutors.directExecutor());
         // append assembling transform to barrier result
         return Futures.transform(compositeResult, compositeTransform, MoreExecutors.directExecutor());
     }
index 2ff98cbfe56c0816ee0fe6dc465a61bc224f4a6a..3667b61016d18e12c9a7c9b131172e2859b71dff 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.ta
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
 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.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutputBuilder;
@@ -51,21 +52,22 @@ public final class FlowUtil {
      * Attach barrier response to given {@link RpcResult}&lt;RemoveFlowsBatchOutput&gt;.
      */
     public static final Function<Pair<RpcResult<RemoveFlowsBatchOutput>,
-                                 RpcResult<Void>>,
+                                 RpcResult<SendBarrierOutput>>,
                                  RpcResult<RemoveFlowsBatchOutput>>
             FLOW_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
 
     /**
      * Attach barrier response to given {@link RpcResult}&lt;AddFlowsBatchOutput&gt;.
      */
-    public static final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
+    public static final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
+            RpcResult<AddFlowsBatchOutput>>
             FLOW_ADD_COMPOSING_TRANSFORM = createComposingFunction();
 
     /**
      * Attach barrier response to given {@link RpcResult}&lt;UpdateFlowsBatchOutput&gt;.
      */
     public static final Function<Pair<RpcResult<UpdateFlowsBatchOutput>,
-                                 RpcResult<Void>>,
+                                 RpcResult<SendBarrierOutput>>,
                                  RpcResult<UpdateFlowsBatchOutput>>
             FLOW_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -147,7 +149,7 @@ public final class FlowUtil {
      */
     @VisibleForTesting
     static <T extends BatchFlowOutputListGrouping>
-        Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
+        Function<Pair<RpcResult<T>, RpcResult<SendBarrierOutput>>, RpcResult<T>> createComposingFunction() {
         return input -> {
             final RpcResultBuilder<T> resultBld;
             if (input.getLeft().isSuccessful() && input.getRight().isSuccessful()) {
index 9ef70858240d89d843f1107b85d3bbeaeb7f8acb..88a3147177302453e6dc9911475d3ca173f4130a 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.lang3.tuple.Pair;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
@@ -58,7 +59,7 @@ public final class GroupUtil {
             return resultBld.build();
         };
     public static final Function<Pair<RpcResult<AddGroupsBatchOutput>,
-                                 RpcResult<Void>>,
+                                 RpcResult<SendBarrierOutput>>,
                                  RpcResult<AddGroupsBatchOutput>>
         GROUP_ADD_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -73,7 +74,7 @@ public final class GroupUtil {
                 return resultBld.build();
             };
     public static final Function<Pair<RpcResult<RemoveGroupsBatchOutput>,
-                                      RpcResult<Void>>,
+                                      RpcResult<SendBarrierOutput>>,
                                       RpcResult<RemoveGroupsBatchOutput>>
         GROUP_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -88,7 +89,7 @@ public final class GroupUtil {
                 return resultBld.build();
             };
     public static final Function<Pair<RpcResult<UpdateGroupsBatchOutput>,
-                                      RpcResult<Void>>,
+                                      RpcResult<SendBarrierOutput>>,
                                       RpcResult<UpdateGroupsBatchOutput>>
             GROUP_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -164,7 +165,8 @@ public final class GroupUtil {
      * @return reusable static function
      */
     @VisibleForTesting
-    static <T extends BatchGroupOutputListGrouping> Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>>
+    static <T extends BatchGroupOutputListGrouping> Function<Pair<RpcResult<T>, RpcResult<SendBarrierOutput>>,
+            RpcResult<T>>
         createComposingFunction() {
         return input -> {
             final RpcResultBuilder<T> resultBld;
index 1172cc47c6f4a883e0fbdf93dc404e3e0dfd4e94..af0a78dc2089d90ce6419e036b9531c82751f44e 100644 (file)
@@ -21,6 +21,7 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef;
@@ -57,7 +58,7 @@ public final class MeterUtil {
             return resultBld.build();
         };
     public static final Function<Pair<RpcResult<AddMetersBatchOutput>,
-                                      RpcResult<Void>>,
+                                      RpcResult<SendBarrierOutput>>,
                                       RpcResult<AddMetersBatchOutput>>
         METER_ADD_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -72,7 +73,7 @@ public final class MeterUtil {
                 return resultBld.build();
             };
     public static final Function<Pair<RpcResult<RemoveMetersBatchOutput>,
-                                      RpcResult<Void>>,
+                                      RpcResult<SendBarrierOutput>>,
                                       RpcResult<RemoveMetersBatchOutput>>
         METER_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -87,7 +88,7 @@ public final class MeterUtil {
                 return resultBld.build();
             };
     public static final Function<Pair<RpcResult<UpdateMetersBatchOutput>,
-                                      RpcResult<Void>>,
+                                      RpcResult<SendBarrierOutput>>,
                                       RpcResult<UpdateMetersBatchOutput>>
         METER_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
 
@@ -133,7 +134,7 @@ public final class MeterUtil {
      */
     @VisibleForTesting
     static <T extends BatchMeterOutputListGrouping>
-        Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
+        Function<Pair<RpcResult<T>, RpcResult<SendBarrierOutput>>, RpcResult<T>> createComposingFunction() {
         return input -> {
             final RpcResultBuilder<T> resultBld;
             if (input.getLeft().isSuccessful() && input.getRight().isSuccessful()) {
index cec8c64a361dbb93e8683e8abb80125a19b4c61b..ce26880054237e06faff7bb355dcf47ae872b0a5 100644 (file)
@@ -36,6 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessageBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfigBuilder;
@@ -108,7 +109,7 @@ public class ConnectionManagerImplTest {
         Mockito.verify(connection).setMessageListener(ofpListenerAC.capture());
 
         // prepare void reply (hello rpc output)
-        final SettableFuture<RpcResult<Void>> voidResponseFx = SettableFuture.<RpcResult<Void>>create();
+        final SettableFuture<RpcResult<HelloOutput>> voidResponseFx = SettableFuture.create();
         Mockito.when(connection.hello(Matchers.any(HelloInput.class))).thenReturn(voidResponseFx);
         // prepare getFeature reply (getFeture rpc output)
         final SettableFuture<RpcResult<GetFeaturesOutput>> featureResponseFx =
@@ -121,7 +122,7 @@ public class ConnectionManagerImplTest {
 
         // deliver hello send output (void)
         Thread.sleep(100L);
-        final RpcResult<Void> helloResponse = RpcResultBuilder.success((Void) null).build();
+        final RpcResult<HelloOutput> helloResponse = RpcResultBuilder.success((HelloOutput) null).build();
         voidResponseFx.set(helloResponse);
 
         // send hello reply
@@ -164,7 +165,7 @@ public class ConnectionManagerImplTest {
         Mockito.verify(connection).setMessageListener(ofpListenerAC.capture());
 
         // prepare void reply (hello rpc output)
-        final SettableFuture<RpcResult<Void>> voidResponseFx = SettableFuture.<RpcResult<Void>>create();
+        final SettableFuture<RpcResult<HelloOutput>> voidResponseFx = SettableFuture.create();
         Mockito.when(connection.hello(Matchers.any(HelloInput.class))).thenReturn(voidResponseFx);
         // prepare getFeature reply (getFeture rpc output)
         final SettableFuture<RpcResult<GetFeaturesOutput>> featureResponseFx =
@@ -181,7 +182,7 @@ public class ConnectionManagerImplTest {
 
         // deliver hello send output (void)
         Thread.sleep(100L);
-        final RpcResult<Void> helloResponse = RpcResultBuilder.success((Void) null).build();
+        final RpcResult<HelloOutput> helloResponse = RpcResultBuilder.success((HelloOutput) null).build();
         voidResponseFx.set(helloResponse);
 
         // deliver getFeature output
index 650a7b5160b22b67c8cd9a303a1de5ee4a5301dc..8f896331568a6bcaf7694f8d4b71f946ae1c4b9e 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessageBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.ElementsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfigBuilder;
@@ -79,7 +80,7 @@ public class HandshakeManagerImplTest {
         resultFeatures = RpcResultBuilder.success(new GetFeaturesOutputBuilder().build()).build();
 
         Mockito.when(adapter.hello(Matchers.any(HelloInput.class)))
-                .thenReturn(Futures.immediateFuture(RpcResultBuilder.success((Void) null).build()));
+                .thenReturn(Futures.immediateFuture(RpcResultBuilder.success((HelloOutput) null).build()));
     }
 
     /**
index fad4b579821cb4ee74d57d618ae75b6c06f63055..62eb39a37017d461764fa25f561977861bb0f760 100644 (file)
@@ -9,12 +9,11 @@
 package org.opendaylight.openflowplugin.impl.connection.listener;
 
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.net.InetSocketAddress;
-import java.util.concurrent.Future;
 import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.TimeUnit;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -164,7 +163,7 @@ public class SystemNotificationsListenerImplTest {
      */
     @Test
     public void testOnSwitchIdleEvent1() throws Exception {
-        final Future<RpcResult<EchoOutput>> echoReply =
+        final ListenableFuture<RpcResult<EchoOutput>> echoReply =
                 Futures.immediateFuture(RpcResultBuilder.success(new EchoOutputBuilder().setXid(0L).build()).build());
 
         Mockito.when(connectionAdapter.echo(Matchers.any(EchoInput.class))).thenReturn(echoReply);
@@ -216,4 +215,4 @@ public class SystemNotificationsListenerImplTest {
         Mockito.verify(connectionContext, Mockito.timeout(SAFE_TIMEOUT).atLeastOnce()).getConnectionState();
         Mockito.verify(connectionContext, Mockito.timeout(SAFE_TIMEOUT).atLeastOnce()).getFeatures();
     }
-}
\ No newline at end of file
+}
index c3f78e651567d41e3e96f03df74411132aa4f329..9b332b586b689702d2976bd26b9e58959f79faab 100644 (file)
@@ -13,8 +13,8 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import io.netty.util.HashedWheelTimer;
-import java.util.concurrent.Future;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -48,7 +48,7 @@ public class RoleContextImplTest {
     @Mock
     private DeviceContext deviceContext;
     @Mock
-    private Future<RpcResult<SetRoleOutput>> setRoleFuture;
+    private ListenableFuture<RpcResult<SetRoleOutput>> setRoleFuture;
     @Mock
     private OpenflowProviderConfig config;
     private RoleContext roleContext;
@@ -92,4 +92,4 @@ public class RoleContextImplTest {
         verify(setRoleFuture).cancel(true);
     }
 
-}
\ No newline at end of file
+}
index 246b2db4982f2b140ced7194694059891a46a6a0..ec7574380a676b6574c6258c447ec4b64123d5cc 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.GetAsyncOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.GetAsyncOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -52,7 +53,7 @@ public class SalAsyncConfigServiceImplTest extends ServiceMocking {
         final ListenableFuture<RpcResult<SetAsyncInput>> replyFuture = Futures.immediateFuture(replyRpcResult);
         Mockito.when(mockedRequestContext.getFuture()).thenReturn(replyFuture);
 
-        final Future<RpcResult<Void>> setAsyncResult =
+        final ListenableFuture<RpcResult<SetAsyncOutput>> setAsyncResult =
                 salAsyncConfigService.setAsync(new SetAsyncInputBuilder().build());
 
         Assert.assertNotNull(setAsyncResult);
index 6bee7c92ccb664ae50b5ee1db47179e4d9783da6..fd76f4e1f57b48343bd0f782a1ef01996ce231f9 100644 (file)
@@ -84,6 +84,7 @@ public class SalBundleServiceImplTest {
         experimenterBuilder.setExperimenterMessageOfChoice(new BundleControlSalBuilder()
                 .setSalControlData(new SalControlDataBuilder(input).build())
                 .build());
+        Mockito.when(experimenterMessageService.sendExperimenter(Matchers.any())).thenReturn(SettableFuture.create());
         service.controlBundle(input);
         Mockito.verify(experimenterMessageService).sendExperimenter(experimenterBuilder.build());
     }
@@ -145,4 +146,4 @@ public class SalBundleServiceImplTest {
         return messages;
     }
 
-}
\ No newline at end of file
+}
index e3927efea3f17debc732ee93796a528c488ebd20..6e2941af38ec8110e2f725a6202c495210e83137 100644 (file)
@@ -36,6 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Upda
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInputBuilder;
@@ -99,7 +100,7 @@ public class SalFlowsBatchServiceImplTest {
         salFlowsBatchService = new SalFlowsBatchServiceImpl(salFlowService, transactionService);
 
         Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
-                .thenReturn(RpcResultBuilder.<Void>success().buildFuture());
+                .thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
     }
 
     @After
index 9146fb3a2d8fd0cc22d0a661a2522caf71f62a13..8eef763b369b51b235de0fd8420355ed97ddbce4 100644 (file)
@@ -25,6 +25,7 @@ import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutputBuilder;
@@ -93,7 +94,7 @@ public class SalGroupsBatchServiceImplTest {
         salGroupsBatchService = new SalGroupsBatchServiceImpl(salGroupService, transactionService);
 
         Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
-                .thenReturn(RpcResultBuilder.<Void>success().buildFuture());
+                .thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
     }
 
     @After
index 1524675b2eb9cc11451584017152f1087d3ddfa9..5c43de2b48c8afb34645467740bc4661816db02d 100644 (file)
@@ -25,6 +25,7 @@ import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
@@ -91,8 +92,8 @@ public class SalMetersBatchServiceImplTest {
     public void setUp() throws Exception {
         salMetersBatchService = new SalMetersBatchServiceImpl(salMeterService, transactionService);
 
-        Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
-                .thenReturn(RpcResultBuilder.<Void>success().buildFuture());
+        Mockito.when(transactionService.sendBarrier(Matchers.any()))
+                .thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
     }
 
     @After
index 359217c3a368c17ebab4f02937bbc8a4645955f8..719e35d2d13631cefcbf9728a3147dfbdcddde25 100644 (file)
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.lang.reflect.Field;
 import java.math.BigInteger;
@@ -53,6 +54,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfigBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.GetStatisticsWorkModeOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.StatisticsManagerControlService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.StatisticsWorkMode;
@@ -165,7 +167,7 @@ public class StatisticsManagerImplTest {
 
     @Test
     public void testGetStatisticsWorkMode() throws Exception {
-        final Future<RpcResult<GetStatisticsWorkModeOutput>> workMode = statisticsManager.getStatisticsWorkMode();
+        final Future<RpcResult<GetStatisticsWorkModeOutput>> workMode = statisticsManager.getStatisticsWorkMode(null);
         Assert.assertTrue(workMode.isDone());
         Assert.assertTrue(workMode.get().isSuccessful());
         assertNotNull(workMode.get().getResult());
@@ -186,14 +188,14 @@ public class StatisticsManagerImplTest {
                 new ChangeStatisticsWorkModeInputBuilder()
                         .setMode(StatisticsWorkMode.FULLYDISABLED);
 
-        final Future<RpcResult<Void>> workMode = statisticsManager
+        final ListenableFuture<RpcResult<ChangeStatisticsWorkModeOutput>> workMode = statisticsManager
                 .changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
 
         checkWorkModeChangeOutcome(workMode);
         verify(statisticContext).disableGathering();
     }
 
-    private static void checkWorkModeChangeOutcome(Future<RpcResult<Void>> workMode)
+    private static void checkWorkModeChangeOutcome(ListenableFuture<RpcResult<ChangeStatisticsWorkModeOutput>> workMode)
             throws InterruptedException, ExecutionException {
         Assert.assertTrue(workMode.isDone());
         Assert.assertTrue(workMode.get().isSuccessful());
@@ -214,7 +216,7 @@ public class StatisticsManagerImplTest {
                 new ChangeStatisticsWorkModeInputBuilder()
                         .setMode(StatisticsWorkMode.FULLYDISABLED);
 
-        Future<RpcResult<Void>> workMode = statisticsManager
+        ListenableFuture<RpcResult<ChangeStatisticsWorkModeOutput>> workMode = statisticsManager
             .changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
         checkWorkModeChangeOutcome(workMode);
 
@@ -236,7 +238,7 @@ public class StatisticsManagerImplTest {
                 new ChangeStatisticsWorkModeInputBuilder()
                         .setMode(StatisticsWorkMode.FULLYDISABLED);
 
-        Future<RpcResult<Void>> workMode;
+        ListenableFuture<RpcResult<ChangeStatisticsWorkModeOutput>> workMode;
         workMode = statisticsManager.changeStatisticsWorkMode(
                 changeStatisticsWorkModeInputBld.build());
         checkWorkModeChangeOutcome(workMode);
index 9c6cf993518a866bba491b4800d7026e89f483a5..e3880f4441ffcf1c1ddde136a6f3453af0e2e39e 100644 (file)
@@ -24,6 +24,7 @@ import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
@@ -46,14 +47,14 @@ public class BarrierUtilTest {
     @Mock
     private FlowCapableTransactionService transactionService;
     @Mock
-    private Function<Pair<RpcResult<String>, RpcResult<Void>>, RpcResult<String>> compositeTransform;
+    private Function<Pair<RpcResult<String>, RpcResult<SendBarrierOutput>>, RpcResult<String>> compositeTransform;
     @Captor
-    private ArgumentCaptor<Pair<RpcResult<String>, RpcResult<Void>>> pairCpt;
+    private ArgumentCaptor<Pair<RpcResult<String>, RpcResult<SendBarrierOutput>>> pairCpt;
 
     @Before
     public void setUp() throws Exception {
         Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
-                .thenReturn(RpcResultBuilder.<Void>success().buildFuture());
+                .thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
     }
 
     @After
@@ -71,7 +72,7 @@ public class BarrierUtilTest {
         Mockito.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
         Mockito.verify(compositeTransform).apply(pairCpt.capture());
 
-        final Pair<RpcResult<String>, RpcResult<Void>> value = pairCpt.getValue();
+        final Pair<RpcResult<String>, RpcResult<SendBarrierOutput>> value = pairCpt.getValue();
         Assert.assertTrue(value.getLeft().isSuccessful());
         Assert.assertEquals(data, value.getLeft().getResult());
         Assert.assertTrue(value.getRight().isSuccessful());
@@ -86,4 +87,4 @@ public class BarrierUtilTest {
         Assert.assertEquals(NODE_REF, barrierInput.getNode());
         Assert.assertEquals(SendBarrierInput.class, barrierInput.getImplementedInterface());
     }
-}
\ No newline at end of file
+}
index 1275ef8a52232d4472f5b9debf2cb3cbe529c720..7d86563b592eefec9c4528020a1f2aaa0663f692 100644 (file)
@@ -19,6 +19,7 @@ import org.mockito.Mockito;
 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;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutputBuilder;
@@ -148,12 +149,13 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_success() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
-                compositeFunction = FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchSuccessOutput();
-        final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>> input = Pair.of(addFlowBatchOutput, barrierOutput);
+        final RpcResult<SendBarrierOutput> barrierOutput = RpcResultBuilder.<SendBarrierOutput>success().build();
+        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>> input
+                = Pair.of(addFlowBatchOutput, barrierOutput);
         final RpcResult<AddFlowsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertTrue(composite.isSuccessful());
@@ -163,12 +165,13 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_success() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
-                compositeFunction = FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchFailureOutcome();
-        final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>> input = Pair.of(addFlowBatchOutput, barrierOutput);
+        final RpcResult<SendBarrierOutput> barrierOutput = RpcResultBuilder.<SendBarrierOutput>success().build();
+        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>> input
+                = Pair.of(addFlowBatchOutput, barrierOutput);
         final RpcResult<AddFlowsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -178,12 +181,13 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_failure() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
-                compositeFunction = FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchSuccessOutput();
-        final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>> input = Pair.of(addFlowBatchOutput, barrierOutput);
+        final RpcResult<SendBarrierOutput> barrierOutput = createBarrierFailureOutcome();
+        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>> input
+                = Pair.of(addFlowBatchOutput, barrierOutput);
         final RpcResult<AddFlowsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -193,12 +197,13 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_failure() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
-                compositeFunction = FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchFailureOutcome();
-        final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>> input = Pair.of(addFlowBatchOutput, barrierOutput);
+        final RpcResult<SendBarrierOutput> barrierOutput = createBarrierFailureOutcome();
+        final Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>> input
+                = Pair.of(addFlowBatchOutput, barrierOutput);
         final RpcResult<AddFlowsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -206,8 +211,8 @@ public class FlowUtilTest {
         Assert.assertEquals(1, composite.getResult().getBatchFailedFlowsOutput().size());
     }
 
-    private RpcResult<Void> createBarrierFailureOutcome() {
-        return RpcResultBuilder.<Void>failed()
+    private RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
+        return RpcResultBuilder.<SendBarrierOutput>failed()
                 .withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
                 .build();
     }
index c49c85af7278635e24176bd0ecaf33f61f492ddc..a2caac19b80a411769a41438d2ce32108c3f8061 100644 (file)
@@ -17,6 +17,7 @@ import java.util.List;
 import org.apache.commons.lang3.tuple.Pair;
 import org.junit.Assert;
 import org.junit.Test;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
@@ -151,12 +152,12 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_success() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
-                compositeFunction = GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchSuccessOutput();
-        final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = RpcResultBuilder.<SendBarrierOutput>success().build();
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
@@ -167,12 +168,12 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_success() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
-                compositeFunction = GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchFailureOutcome();
-        final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = RpcResultBuilder.<SendBarrierOutput>success().build();
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
@@ -183,12 +184,12 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_failure() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
-                compositeFunction = GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchSuccessOutput();
-        final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = createBarrierFailureOutcome();
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
@@ -199,12 +200,12 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_failure() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
-                compositeFunction = GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchFailureOutcome();
-        final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = createBarrierFailureOutcome();
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
@@ -224,8 +225,8 @@ public class GroupUtilTest {
         assertEquals(GROUP_ACTION_BITMAP, bitmap);
     }
 
-    private RpcResult<Void> createBarrierFailureOutcome() {
-        return RpcResultBuilder.<Void>failed()
+    private RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
+        return RpcResultBuilder.<SendBarrierOutput>failed()
                 .withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
                 .build();
     }
@@ -247,4 +248,4 @@ public class GroupUtilTest {
                 .withRpcErrors(batchOutcomeWithError.getErrors())
                 .build();
     }
-}
\ No newline at end of file
+}
index a83eaab74b42b15f17bc94b0fc94c29d4d205ea3..e607ab0206483bb28609ad18722e895cc2485377 100644 (file)
@@ -17,6 +17,7 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
@@ -149,12 +150,12 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_success() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
-                compositeFunction = MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchSuccessOutput();
-        final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = RpcResultBuilder.<SendBarrierOutput>success().build();
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
@@ -165,12 +166,12 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_success() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
-                compositeFunction = MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchFailureOutcome();
-        final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = RpcResultBuilder.<SendBarrierOutput>success().build();
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
@@ -181,12 +182,12 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_failure() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
-                compositeFunction = MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchSuccessOutput();
-        final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = createBarrierFailureOutcome();
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
@@ -197,12 +198,12 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_failure() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
-                compositeFunction = MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
+                RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchFailureOutcome();
-        final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+        final RpcResult<SendBarrierOutput> barrierOutput = createBarrierFailureOutcome();
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>> input =
                 Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
@@ -211,8 +212,8 @@ public class MeterUtilTest {
         Assert.assertEquals(1, composite.getResult().getBatchFailedMetersOutput().size());
     }
 
-    private RpcResult<Void> createBarrierFailureOutcome() {
-        return RpcResultBuilder.<Void>failed()
+    private RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
+        return RpcResultBuilder.<SendBarrierOutput>failed()
                 .withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
                 .build();
     }
@@ -234,4 +235,4 @@ public class MeterUtilTest {
                 .withRpcErrors(batchOutcomeWithError.getErrors())
                 .build();
     }
-}
\ No newline at end of file
+}
index fd3d87a95530f667dc5739ef92ea570fe5b38886..57caeb230597189c1f1687d0501870f198ec261d 100644 (file)
@@ -68,8 +68,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.Messages;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.MessagesBuilder;
@@ -160,7 +162,7 @@ public class Activator extends AbstractBrokerAwareActivator implements BindingAw
                         LOG.debug("Open successful: {}, msg: {}", voidRpcResult.isSuccessful(),
                                 voidRpcResult.getErrors());
 
-                        final CompletableFuture<RpcResult<Void>> addFuture =
+                        final CompletableFuture<RpcResult<AddBundleMessagesOutput>> addFuture =
                                 makeCompletableFuture(bundleService.addBundleMessages(addBundleMessagesInput));
 
                         return addFuture;
@@ -168,7 +170,7 @@ public class Activator extends AbstractBrokerAwareActivator implements BindingAw
                         LOG.debug("AddBundleMessages successful: {}, msg: {}", voidRpcResult.isSuccessful(),
                                 voidRpcResult.getErrors());
 
-                        final CompletableFuture<RpcResult<Void>> controlCommitFuture =
+                        final CompletableFuture<RpcResult<ControlBundleOutput>> controlCommitFuture =
                                 makeCompletableFuture(bundleService.controlBundle(commitBundleInput));
 
                         return controlCommitFuture;
index 1f0e647442d54dbb5a4b277079d2c6ff7431a836..112659e2d42a3d926a2415313435e6dae44321b8 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.openflowplugin.test;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -101,7 +101,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
      * .service.rev130918.AddGroupInput)
      */
     @Override
-    public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
+    public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
         String plus = "addGroup - " + input;
         OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
         return null;
@@ -117,7 +117,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
      * .group.service.rev130918.RemoveGroupInput)
      */
     @Override
-    public Future<RpcResult<RemoveGroupOutput>> removeGroup(
+    public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(
             RemoveGroupInput input) {
         String plus = "removeGroup - " + input;
         OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
@@ -134,7 +134,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
      * .group.service.rev130918.UpdateGroupInput)
      */
     @Override
-    public Future<RpcResult<UpdateGroupOutput>> updateGroup(
+    public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(
             UpdateGroupInput input) {
         String plus = "updateGroup - " + input;
         OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
index 053cae7447831dc97e5f7d9288a3247b71e6d1d8..bd55a4e53355e3563063f8719be0428056cd32da 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.openflowplugin.test;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
@@ -118,7 +118,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * .service.rev130918.AddMeterInput)
      */
     @Override
-    public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
+    public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
         String plus = "addMeter - " + input;
         OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
         return null;
@@ -134,7 +134,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * .meter.service.rev130918.RemoveMeterInput)
      */
     @Override
-    public Future<RpcResult<RemoveMeterOutput>> removeMeter(
+    public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(
             final RemoveMeterInput input) {
         String plus = "removeMeter - " + input;
         OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
@@ -151,7 +151,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * .meter.service.rev130918.UpdateMeterInput)
      */
     @Override
-    public Future<RpcResult<UpdateMeterOutput>> updateMeter(
+    public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(
             final UpdateMeterInput input) {
         String plus = "updateMeter - " + input;
         OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
index 8150887a7dd13961c90210e763fc28c7a295c58a..ce978684cdc568683b97d814446b25eb12b0b324 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.openflowplugin.test;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -97,7 +97,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
      * .table.service.rev131026.UpdateTableInput)
      */
     @Override
-    public Future<RpcResult<UpdateTableOutput>> updateTable(
+    public ListenableFuture<RpcResult<UpdateTableOutput>> updateTable(
             UpdateTableInput input) {
         String plus = "updateTable - " + input;
         OpenflowpluginTableFeaturesTestServiceProvider.LOG.info(plus);
index 25016c14c46a8cc6be9d30c08b26c09486e922cb..a5d5740641736fcba9e17b37cfabd10d8074c240 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.openflowplugin.test;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
@@ -119,7 +119,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
      * service.rev130819.AddFlowInput)
      */
     @Override
-    public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
+    public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
         String plus = "addFlow - " + input;
         OpenflowpluginTestServiceProvider.LOG.info(plus);
         return null;
@@ -135,7 +135,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
      * .service.rev130819.RemoveFlowInput)
      */
     @Override
-    public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
         String plus = "removeFlow - " + input;
         OpenflowpluginTestServiceProvider.LOG.info(plus);
         return null;
@@ -151,7 +151,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
      * .service.rev130819.UpdateFlowInput)
      */
     @Override
-    public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
+    public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
         String plus = "updateFlow - " + input;
         OpenflowpluginTestServiceProvider.LOG.info(plus);
         return null;