Fix checkstyle warnings for statistics package 46/61846/9
authormiroslav.macko <miroslav.macko@pantheon.tech>
Wed, 16 Aug 2017 13:49:07 +0000 (15:49 +0200)
committermiroslav.macko <miroslav.macko@pantheon.tech>
Tue, 22 Aug 2017 09:49:59 +0000 (11:49 +0200)
See also: bug 8607

Change-Id: I45875a328dbfb078701ff1c6684c7c28a97a7634
Signed-off-by: miroslav.macko <miroslav.macko@pantheon.tech>
86 files changed:
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsGatheringUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/TimeCounter.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/EventsTimeCounter.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/SessionStatistics.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AggregateFlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllFlowsInAllTablesService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllFlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllGroupsStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllMeterConfigStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllMeterStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllPortStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllQueuesAllPortsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllQueuesOnePortService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/FlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/GroupDescriptionService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/GroupFeaturesService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/GroupStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/MeterFeaturesService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/MeterStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OneQueueOnePortService.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/PortStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/FlowStatisticsToNotificationTransformer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/GroupStatisticsToNotificationTransformer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/MeterStatisticsToNotificationTransformer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/NodeConnectorStatisticsToNotificationTransformer.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/compatibility/QueueStatisticsToNotificationTransformer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringOnTheFlyService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringService.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/AbstractFlowDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractGroupDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractMeterDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractPortDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractQueueDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/OpendaylightDirectStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/OpendaylightDirectStatisticsServiceProvider.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/FlowDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/MeterDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/MultiLayerDirectStatisticsProviderInitializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/PortDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/QueueDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/FlowDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/PortDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/SingleLayerDirectStatisticsProviderInitializer.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/MultipartReplyTranslatorTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpMockInitiation.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplParamTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsGatheringUtilsTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/TimeCounterTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/AbstractSingleStatsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/AbstractStatsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowStatisticsServiceImpl1Test.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowStatisticsServiceImpl2Test.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowStatisticsServiceImpl3Test.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightGroupStatisticsServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightMeterStatisticsServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightPortStatisticsServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightQueueStatisticsServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/PortStatsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/OpendaylightFlowStatisticsServiceDelegateImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringOnTheFlyServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/FlowDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/GroupDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/MeterDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/NodeConnectorDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/QueueDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/FlowDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/GroupDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/MeterDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/NodeConnectorDirectStatisticsServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/QueueDirectStatisticsServiceTest.java

index d53f6e09e4660ee827ef0ed23b2689d881e3a021..88c09233fd4e85815f443b364592041c9d367336 100644 (file)
@@ -144,9 +144,10 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
             StatisticsGatheringUtils.markDeviceStateSnapshotStart(deviceContext);
 
             lastDataGathering = collectingStatType.stream().reduce(
-                    lastDataGathering,
-                    this::statChainFuture,
-                    (a, b) -> Futures.transformAsync(a, (AsyncFunction<Boolean, Boolean>) result -> b));
+                lastDataGathering,
+                this::statChainFuture,
+                (input, function) -> Futures
+                        .transformAsync(input, (AsyncFunction<Boolean, Boolean>) result -> function));
 
             // write end timestamp to state snapshot container
             Futures.addCallback(lastDataGathering, new FutureCallback<Boolean>() {
@@ -156,8 +157,8 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
                 }
 
                 @Override
-                public void onFailure(final Throwable t) {
-                    if (!(t instanceof TransactionChainClosedException)) {
+                public void onFailure(final Throwable throwable) {
+                    if (!(throwable instanceof TransactionChainClosedException)) {
                         StatisticsGatheringUtils.markDeviceStateSnapshotEnd(deviceContext, false);
                     }
                 }
@@ -167,7 +168,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
         return lastDataGathering;
     }
 
-    private ListenableFuture<Boolean> chooseStat(final MultipartType multipartType){
+    private ListenableFuture<Boolean> chooseStat(final MultipartType multipartType) {
         ListenableFuture<Boolean> result = Futures.immediateCheckedFuture(Boolean.TRUE);
 
         switch (multipartType) {
@@ -238,8 +239,10 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
         this.pollTimeout = pollTimeout;
     }
 
-    private ListenableFuture<Boolean> statChainFuture(final ListenableFuture<Boolean> prevFuture, final MultipartType multipartType) {
-        return Futures.transformAsync(deviceConnectionCheck(), (AsyncFunction<Boolean, Boolean>) connectionResult -> Futures
+    private ListenableFuture<Boolean> statChainFuture(final ListenableFuture<Boolean> prevFuture,
+                                                      final MultipartType multipartType) {
+        return Futures
+                .transformAsync(deviceConnectionCheck(), (AsyncFunction<Boolean, Boolean>) connectionResult -> Futures
                 .transformAsync(prevFuture, (AsyncFunction<Boolean, Boolean>) result -> {
                     LOG.debug("Status of previous stat iteration for node {}: {}", deviceInfo.getLOGValue(), result);
                     LOG.debug("Stats iterating to next type for node {} of type {}",
@@ -252,7 +255,8 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
 
     @VisibleForTesting
     ListenableFuture<Boolean> deviceConnectionCheck() {
-        if (ConnectionContext.CONNECTION_STATE.RIP.equals(deviceContext.getPrimaryConnectionContext().getConnectionState())) {
+        if (ConnectionContext.CONNECTION_STATE.RIP
+                .equals(deviceContext.getPrimaryConnectionContext().getConnectionState())) {
             final String errMsg = String
                     .format("Device connection for node %s doesn't exist anymore. Primary connection status : %s",
                             getDeviceInfo().getNodeId(),
@@ -284,12 +288,13 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
     }
 
     @VisibleForTesting
-    void setStatisticsGatheringOnTheFlyService(final StatisticsGatheringOnTheFlyService<T> statisticsGatheringOnTheFlyService) {
+    void setStatisticsGatheringOnTheFlyService(
+            final StatisticsGatheringOnTheFlyService<T> statisticsGatheringOnTheFlyService) {
         this.statisticsGatheringOnTheFlyService = statisticsGatheringOnTheFlyService;
     }
 
     @Override
-    public ItemLifecycleListener getItemLifeCycleListener () {
+    public ItemLifecycleListener getItemLifeCycleListener() {
         return itemLifeCycleListener;
     }
 
@@ -354,7 +359,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
 
         Futures.addCallback(this.gatherDynamicData(), new FutureCallback<Boolean>() {
             @Override
-            public void onSuccess(@Nullable Boolean aBoolean) {
+            public void onSuccess(@Nullable Boolean isSuccess) {
                 contextChainMastershipWatcher.onMasterRoleAcquired(
                         deviceInfo,
                         ContextChainMastershipState.INITIAL_GATHERING
index 80c8fa3cf8ff755cb8edb6ea5887442659151da3..c933adbd6e5cd8467e5134b9f46cf54c86058f31 100644 (file)
@@ -60,7 +60,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Utils for gathering statistics
+ * Utils for gathering statistics.
  */
 public final class StatisticsGatheringUtils {
 
@@ -72,13 +72,14 @@ public final class StatisticsGatheringUtils {
         throw new IllegalStateException("This class should not be instantiated.");
     }
 
-    static <T extends OfHeader>ListenableFuture<Boolean> gatherStatistics(final StatisticsGatherer<T> statisticsGatheringService,
-                                                                          final DeviceInfo deviceInfo,
-                                                                          final MultipartType type,
-                                                                          final TxFacade txFacade,
-                                                                          final DeviceRegistry registry,
-                                                                          final ConvertorExecutor convertorExecutor,
-                                                                          final MultipartWriterProvider statisticsWriterProvider) {
+    static <T extends OfHeader> ListenableFuture<Boolean> gatherStatistics(
+                                                            final StatisticsGatherer<T> statisticsGatheringService,
+                                                            final DeviceInfo deviceInfo,
+                                                            final MultipartType type,
+                                                            final TxFacade txFacade,
+                                                            final DeviceRegistry registry,
+                                                            final ConvertorExecutor convertorExecutor,
+                                                            final MultipartWriterProvider statisticsWriterProvider) {
         return Futures.transformAsync(
                 statisticsGatheringService.getStatisticsOfType(
                         new EventIdentifier(QUEUE2_REQCTX + type.toString(), deviceInfo.getNodeId().toString()),
@@ -86,14 +87,17 @@ public final class StatisticsGatheringUtils {
                 new AsyncFunction<RpcResult<List<T>>, Boolean>() {
                     @Nullable
                     @Override
+                    @SuppressWarnings("checkstyle:IllegalCatch")
                     public ListenableFuture<Boolean> apply(@Nonnull final RpcResult<List<T>> rpcResult) {
                         boolean isMultipartProcessed = Boolean.TRUE;
 
                         if (rpcResult.isSuccessful()) {
-                            LOG.debug("Stats reply successfully received for node {} of type {}", deviceInfo.getNodeId(), type);
+                            LOG.debug("Stats reply successfully received for node {} of type {}",
+                                    deviceInfo.getNodeId(), type);
 
-                            // TODO: in case the result value is null then multipart data probably got processed on the fly -
-                            // TODO: this contract should by clearly stated and enforced - now simple true value is returned
+                            // TODO: in case the result value is null then multipart data probably got processed
+                            // TODO: on the fly. This contract should by clearly stated and enforced.
+                            // TODO: Now simple true value is returned
                             if (Objects.nonNull(rpcResult.getResult()) && !rpcResult.getResult().isEmpty()) {
                                 final List<DataContainer> allMultipartData;
 
@@ -107,7 +111,8 @@ public final class StatisticsGatheringUtils {
                                             .map(java.util.Optional::get)
                                             .collect(Collectors.toList());
                                 } catch (final Exception e) {
-                                    LOG.warn("Stats processing of type {} for node {} failed during transformation step",
+                                    LOG.warn("Stats processing of type {} for node {} "
+                                                    + "failed during transformation step",
                                             type, deviceInfo.getLOGValue(), e);
                                     return Futures.immediateFailedFuture(e);
                                 }
@@ -159,6 +164,8 @@ public final class StatisticsGatheringUtils {
             case OFPMPGROUPDESC:
                 deleteAllKnownGroups(txFacade, instanceIdentifier, deviceRegistry.getDeviceGroupRegistry());
                 break;
+            default:
+                LOG.warn("Unsupported statistics type {}", type);
         }
 
         if (writeStatistics(type, statistics, deviceInfo, statisticsWriterProvider)) {
@@ -174,16 +181,20 @@ public final class StatisticsGatheringUtils {
                 case OFPMPGROUPDESC:
                     deviceRegistry.getDeviceGroupRegistry().processMarks();
                     break;
+                default:
+                    LOG.warn("Unsupported statistics type {}", type);
             }
 
             LOG.debug("Stats reply added to transaction for node {} of type {}", deviceInfo.getNodeId(), type);
             return true;
         }
 
-        LOG.warn("Stats processing of type {} for node {} failed during write-to-tx step", type, deviceInfo.getLOGValue());
+        LOG.warn("Stats processing of type {} for node {} "
+                + "failed during write-to-tx step", type, deviceInfo.getLOGValue());
         return false;
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private static boolean writeStatistics(final MultipartType type,
                                            final List<? extends DataContainer> statistics,
                                            final DeviceInfo deviceInfo,
@@ -199,7 +210,8 @@ public final class StatisticsGatheringUtils {
                 }
             }));
         } catch (final Exception ex) {
-            LOG.warn("Stats processing of type {} for node {} failed during write-to-tx step", type, deviceInfo.getLOGValue(), ex);
+            LOG.warn("Stats processing of type {} for node {} "
+                    + "failed during write-to-tx step", type, deviceInfo.getLOGValue(), ex);
         }
 
         return result.get();
@@ -216,27 +228,28 @@ public final class StatisticsGatheringUtils {
 
         try {
             Futures.transform(Futures
-                    .catchingAsync(readTx.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifier),
-                            Throwable.class,
-                            t -> {
+                .catchingAsync(readTx.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifier), Throwable.class,
+                    t -> {
                         // we wish to close readTx for fallBack
                         readTx.close();
                         return Futures.immediateFailedFuture(t);
                     }), (Function<Optional<FlowCapableNode>, Void>)
-                    flowCapNodeOpt -> {
-                        // we have to read actual tables with all information before we set empty Flow list, merge is expensive and
-                        // not applicable for lists
-                        if (flowCapNodeOpt != null && flowCapNodeOpt.isPresent()) {
-                            for (final Table tableData : flowCapNodeOpt.get().getTable()) {
-                                final Table table = new TableBuilder(tableData).setFlow(Collections.emptyList()).build();
-                                final InstanceIdentifier<Table> iiToTable = instanceIdentifier.child(Table.class, tableData.getKey());
-                                txFacade.writeToTransaction(LogicalDatastoreType.OPERATIONAL, iiToTable, table);
-                            }
+                flowCapNodeOpt -> {
+                    // we have to read actual tables with all information before we set empty Flow list,
+                    // merge is expensive and not applicable for lists
+                    if (flowCapNodeOpt != null && flowCapNodeOpt.isPresent()) {
+                        for (final Table tableData : flowCapNodeOpt.get().getTable()) {
+                            final Table table =
+                                    new TableBuilder(tableData).setFlow(Collections.emptyList()).build();
+                            final InstanceIdentifier<Table> iiToTable =
+                                    instanceIdentifier.child(Table.class, tableData.getKey());
+                            txFacade.writeToTransaction(LogicalDatastoreType.OPERATIONAL, iiToTable, table);
                         }
+                    }
 
-                        readTx.close();
-                        return null;
-                    }).get();
+                    readTx.close();
+                    return null;
+                }).get();
         } catch (InterruptedException | ExecutionException ex) {
             LOG.debug("Failed to delete {} flows, exception: {}", deviceFlowRegistry.size(), ex);
         }
@@ -261,7 +274,7 @@ public final class StatisticsGatheringUtils {
     }
 
     /**
-     * Writes snapshot gathering start timestamp + cleans end mark
+     * Writes snapshot gathering start timestamp + cleans end mark.
      *
      * @param deviceContext txManager + node path keeper
      */
@@ -287,7 +300,7 @@ public final class StatisticsGatheringUtils {
     }
 
     /**
-     * Writes snapshot gathering end timestamp + outcome
+     * Writes snapshot gathering end timestamp + outcome.
      *
      * @param deviceContext txManager + node path keeper
      * @param succeeded     outcome of currently finished gathering
index 4b87653e3d9994d4fa71f6156841224aabd7fda5..ae21a11a6bbbb55b281a134a24a7cddc39ba9001 100644 (file)
@@ -105,7 +105,7 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
         final ListenableFuture<Boolean> deviceStatisticsCollectionFuture = statisticsContext.gatherDynamicData();
         Futures.addCallback(deviceStatisticsCollectionFuture, new FutureCallback<Boolean>() {
             @Override
-            public void onSuccess(final Boolean o) {
+            public void onSuccess(final Boolean isSuccess) {
                 timeCounter.addTimeMark();
                 calculateTimerDelay(timeCounter);
                 scheduleNextPolling(deviceState, deviceInfo, statisticsContext, timeCounter);
@@ -126,8 +126,8 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
                 } else if (throwable instanceof CancellationException) {
                     LOG.info("Statistics gathering for device {} was cancelled.", deviceInfo);
                 } else {
-                    LOG.warn("Unexpected error occurred during statistics collection for device {}, rescheduling " +
-                            "statistics collections", deviceInfo, throwable);
+                    LOG.warn("Unexpected error occurred during statistics collection for device {}, rescheduling "
+                            "statistics collections", deviceInfo, throwable);
 
                     scheduleNextPolling(deviceState, deviceInfo, statisticsContext, timeCounter);
                 }
@@ -138,7 +138,8 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
         final long statsTimeoutSec = averageTime > 0 ? 3 * averageTime : DEFAULT_STATS_TIMEOUT_SEC;
         final TimerTask timerTask = timeout -> {
             if (!deviceStatisticsCollectionFuture.isDone()) {
-                LOG.info("Statistics collection for node {} still in progress even after {} secs", deviceInfo, statsTimeoutSec);
+                LOG.info("Statistics collection for node {} still in progress even after {} secs",
+                        deviceInfo, statsTimeoutSec);
                 deviceStatisticsCollectionFuture.cancel(true);
             }
         };
@@ -156,13 +157,13 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
 
         if (isStatisticsEnabled()) {
             final Timeout pollTimeout = hashedWheelTimer.newTimeout(
-                    timeout -> pollStatistics(
-                            deviceState,
-                            statisticsContext,
-                            timeCounter,
-                            deviceInfo),
-                    currentTimerDelay,
-                    TimeUnit.MILLISECONDS);
+                timeout -> pollStatistics(
+                        deviceState,
+                        statisticsContext,
+                        timeCounter,
+                        deviceInfo),
+                currentTimerDelay,
+                TimeUnit.MILLISECONDS);
 
             statisticsContext.setPollTimeout(pollTimeout);
         }
@@ -217,14 +218,19 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
                     final DeviceContext deviceContext = statisticsContext.gainDeviceContext();
                     switch (targetWorkMode) {
                         case COLLECTALL:
-                            scheduleNextPolling(statisticsContext.gainDeviceState(), deviceInfo, statisticsContext, new TimeCounter());
-                            for (final ItemLifeCycleSource lifeCycleSource : deviceContext.getItemLifeCycleSourceRegistry().getLifeCycleSources()) {
+                            scheduleNextPolling(statisticsContext.gainDeviceState(),
+                                                deviceInfo,
+                                                statisticsContext,
+                                                new TimeCounter());
+                            for (final ItemLifeCycleSource lifeCycleSource :
+                                    deviceContext.getItemLifeCycleSourceRegistry().getLifeCycleSources()) {
                                 lifeCycleSource.setItemLifecycleListener(null);
                             }
                             break;
                         case FULLYDISABLED:
                             statisticsContext.stopGatheringData();
-                            for (final ItemLifeCycleSource lifeCycleSource : deviceContext.getItemLifeCycleSourceRegistry().getLifeCycleSources()) {
+                            for (final ItemLifeCycleSource lifeCycleSource :
+                                    deviceContext.getItemLifeCycleSourceRegistry().getLifeCycleSources()) {
                                 lifeCycleSource.setItemLifecycleListener(statisticsContext.getItemLifeCycleListener());
                             }
                             break;
@@ -317,16 +323,16 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
                 .createDefaultProvider(deviceContext);
 
         final StatisticsContext statisticsContext =
-                deviceContext.canUseSingleLayerSerialization() ?
-                        new StatisticsContextImpl<MultipartReply>(
+                deviceContext.canUseSingleLayerSerialization()
+                        new StatisticsContextImpl<MultipartReply>(
                                 isStatisticsEnabled(),
                                 deviceContext,
                                 converterExecutor,
                                 this,
                                 statisticsWriterProvider,
-                                reconciliationFrameworkRegistrar.isReconciliationFrameworkRegistered()) :
-                        new StatisticsContextImpl<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
-                                .MultipartReply>(
+                                reconciliationFrameworkRegistrar.isReconciliationFrameworkRegistered())
+                        : new StatisticsContextImpl<org.opendaylight.yang.gen.v1.urn
+                                .opendaylight.openflow.protocol.rev130731.MultipartReply>(
                                 isStatisticsEnabled(),
                                 deviceContext,
                                 converterExecutor,
index 19a20c74d7dc81665c52befa544265767977ac81..52df9f4cb298313a43edf4c5560cbc962b458791 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.openflowplugin.impl.statistics;
 import java.util.concurrent.TimeUnit;
 
 /**
- * Moving average - measure and compute
+ * Moving average - measure and compute.
  */
 public class TimeCounter {
     private long beginningOfLap;
index 357c0ab69475bd2cbcd5673c8a1761048e263f28..2e0f9b8669da276cf724a8ff3b6897e7aeaa8719 100644 (file)
@@ -15,9 +15,6 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
 
-/**
- * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 28.5.2015.
- */
 public final class EventsTimeCounter {
 
     private static final Map<String, Map<String, EventTimeCounter>> DEVICES_EVENTS = new HashMap<>();
@@ -38,7 +35,8 @@ public final class EventsTimeCounter {
         eventTimeCounter.markEnd();
     }
 
-    private static EventTimeCounter getOrCreateEventOfType(final String event, final Map<String, EventTimeCounter> deviceEvents) {
+    private static EventTimeCounter getOrCreateEventOfType(final String event,
+                                                           final Map<String, EventTimeCounter> deviceEvents) {
         EventTimeCounter lookup = deviceEvents.get(event);
         if (null == lookup) {
             lookup = new EventTimeCounter();
@@ -141,6 +139,4 @@ public final class EventsTimeCounter {
         }
 
     }
-
-
 }
index 4e7aba7317b377f30f6a8fc9bee5df6454c85fec..ff5300859edf498c7f2fb27c4ed6b65094a68ab5 100644 (file)
@@ -22,16 +22,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Implementation of {@link org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency}.
- * Class counts message of {@link StatisticsGroup} type
- * and provides info as debug log.
+ * Implementation of
+ * {@link org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency}.
+ * Class counts message of {@link StatisticsGroup} type and provides info as debug log.
  */
 public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, MessageIntelligenceAgencyMXBean {
 
     private static final Logger LOG = LoggerFactory.getLogger(MessageIntelligenceAgencyImpl.class);
 
     private static final class MessageCounters {
-        private static final AtomicLongFieldUpdater<MessageCounters> UPDATER = AtomicLongFieldUpdater.newUpdater(MessageCounters.class, "current");
+        private static final AtomicLongFieldUpdater<MessageCounters> UPDATER =
+                AtomicLongFieldUpdater.newUpdater(MessageCounters.class, "current");
         @SuppressWarnings("unused")
         private volatile long current;
         private long cumulative;
@@ -51,7 +52,8 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency,
         }
     }
 
-    private ConcurrentMap<StatisticsGroup, ConcurrentMap<Class<?>, MessageCounters>> inputStats = new ConcurrentHashMap<>();
+    private ConcurrentMap<StatisticsGroup, ConcurrentMap<Class<?>, MessageCounters>> inputStats =
+            new ConcurrentHashMap<>();
 
     @Override
     public void spyMessage(@Nonnull final Class<?> message, final StatisticsGroup statGroup) {
@@ -60,6 +62,7 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency,
     }
 
     /**
+     * Get counters.
      * @param message counted element
      * @param statGroup statistic counter group
      * @return corresponding counter
@@ -70,7 +73,8 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency,
         return counters;
     }
 
-    private static MessageCounters getOrCreateCountersPair(final Class<?> msgType, final ConcurrentMap<Class<?>, MessageCounters> groupData) {
+    private static MessageCounters getOrCreateCountersPair(final Class<?> msgType,
+                                                           final ConcurrentMap<Class<?>, MessageCounters> groupData) {
         final MessageCounters lookup = groupData.get(msgType);
         if (lookup != null) {
             return lookup;
index 7ae6d0c957a87f0d443094d487eb440d5d5fa9bd..70892d92b7b3246deba1a650ecc4938032d33ede 100644 (file)
@@ -14,9 +14,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicLongFieldUpdater;
 
-/**
- * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 5.6.2015.
- */
 public class SessionStatistics {
 
     private static final Map<String, Map<ConnectionStatus, EventCounter>> SESSION_EVENTS = new HashMap<>();
@@ -53,7 +50,8 @@ public class SessionStatistics {
             Map<ConnectionStatus, EventCounter> sessionEvents = sessionEntries.getValue();
             dump.add(String.format("SESSION : %s", sessionEntries.getKey()));
             for (Map.Entry<ConnectionStatus, EventCounter> sessionEvent : sessionEvents.entrySet()) {
-                dump.add(String.format(" %s : %d", sessionEvent.getKey().toString(), sessionEvent.getValue().getCount()));
+                dump.add(String.format(" %s : %d", sessionEvent.getKey().toString(),
+                                                   sessionEvent.getValue().getCount()));
             }
         }
         return dump;
@@ -65,7 +63,8 @@ public class SessionStatistics {
     }
 
     private static final class EventCounter {
-        private final AtomicLongFieldUpdater<EventCounter> updater = AtomicLongFieldUpdater.newUpdater(EventCounter.class, "count");
+        private final AtomicLongFieldUpdater<EventCounter> updater =
+                AtomicLongFieldUpdater.newUpdater(EventCounter.class, "count");
         private volatile long count;
 
         public long getCount() {
index 73554ee59bf2d6e339f58e63640822432e05c723..c4f4382bec0bcf645fa0d20a557e37065e13e3a3 100644 (file)
@@ -36,28 +36,37 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder;
 
-public final class AggregateFlowsInTableService extends AbstractCompatibleStatService<GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput,
-        GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput, AggregateFlowStatisticsUpdate> {
+public final class AggregateFlowsInTableService extends
+        AbstractCompatibleStatService<GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput,
+                                      GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput,
+                                      AggregateFlowStatisticsUpdate> {
 
     final TranslatorLibrary translatorLibrary;
 
     public static AggregateFlowsInTableService createWithOook(final RequestContextStack requestContextStack,
                                                                                   final DeviceContext deviceContext,
                                                                                   AtomicLong compatibilityXidSeed) {
-        return new AggregateFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed, deviceContext.oook());
+        return new AggregateFlowsInTableService(requestContextStack,
+                                                deviceContext,
+                                                compatibilityXidSeed,
+                                                deviceContext.oook());
     }
 
-    public AggregateFlowsInTableService(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
-                                        AtomicLong compatibilityXidSeed, TranslatorLibrary translatorLibrary) {
+    public AggregateFlowsInTableService(final RequestContextStack requestContextStack,
+                                        final DeviceContext deviceContext,
+                                        AtomicLong compatibilityXidSeed,
+                                        TranslatorLibrary translatorLibrary) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
 
         this.translatorLibrary = translatorLibrary;
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input)
+            throws ServiceException {
         // Create multipart request body for fetch all the group stats
-        final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder = new MultipartRequestAggregateCaseBuilder();
+        final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder =
+                new MultipartRequestAggregateCaseBuilder();
         final MultipartRequestAggregateBuilder mprAggregateRequestBuilder = new MultipartRequestAggregateBuilder();
         mprAggregateRequestBuilder.setTableId(input.getTableId().getValue());
         mprAggregateRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
@@ -80,20 +89,25 @@ public final class AggregateFlowsInTableService extends AbstractCompatibleStatSe
 
     @Override
     public GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput buildTxCapableResult(TransactionId emulatedTxId) {
-        return new GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutputBuilder().setTransactionId(emulatedTxId).build();
+        return new GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutputBuilder().setTransactionId(emulatedTxId)
+                .build();
     }
 
     @Override
-    public AggregateFlowStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
+    public AggregateFlowStatisticsUpdate transformToNotification(List<MultipartReply> result,
+                                                                 TransactionId emulatedTxId) {
         final int mpSize = result.size();
         Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: {}", mpSize);
 
         MultipartReply mpReply = result.get(0);
-        final TranslatorKey translatorKey = new TranslatorKey(mpReply.getVersion(), MultipartReplyAggregateCase.class.getName());
-        final MessageTranslator<MultipartReply, AggregatedFlowStatistics> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
+        final TranslatorKey translatorKey =
+                new TranslatorKey(mpReply.getVersion(), MultipartReplyAggregateCase.class.getName());
+        final MessageTranslator<MultipartReply, AggregatedFlowStatistics> messageTranslator =
+                translatorLibrary.lookupTranslator(translatorKey);
 
         final AggregatedFlowStatistics flowStatistics = messageTranslator.translate(mpReply, getDeviceInfo(), null);
-        final AggregateFlowStatisticsUpdateBuilder notification = new AggregateFlowStatisticsUpdateBuilder(flowStatistics)
+        final AggregateFlowStatisticsUpdateBuilder notification =
+                new AggregateFlowStatisticsUpdateBuilder(flowStatistics)
                 .setId(getDeviceInfo().getNodeId())
                 .setMoreReplies(Boolean.FALSE)
                 .setTransactionId(emulatedTxId);
index 315c0799f95e2910e6000ea12b65e7937e9169cf..919f80fa61dcae70fd15bce2f97914f731747e7d 100644 (file)
@@ -32,13 +32,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder;
 
-public final class AllFlowsInAllTablesService extends AbstractCompatibleStatService<GetAllFlowsStatisticsFromAllFlowTablesInput,
-        GetAllFlowsStatisticsFromAllFlowTablesOutput, FlowsStatisticsUpdate> {
+public final class AllFlowsInAllTablesService extends
+        AbstractCompatibleStatService<GetAllFlowsStatisticsFromAllFlowTablesInput,
+                                      GetAllFlowsStatisticsFromAllFlowTablesOutput,
+                                      FlowsStatisticsUpdate> {
     private final MultipartRequestFlowCase flowCase;
     private final ConvertorExecutor convertorExecutor;
 
-    public AllFlowsInAllTablesService(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
-                                      final AtomicLong compatibilityXidSeed, final ConvertorExecutor convertorExecutor) {
+    public AllFlowsInAllTablesService(final RequestContextStack requestContextStack,
+                                      final DeviceContext deviceContext,
+                                      final AtomicLong compatibilityXidSeed,
+                                      final ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
 
@@ -56,7 +60,8 @@ public final class AllFlowsInAllTablesService extends AbstractCompatibleStatServ
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllFlowsStatisticsFromAllFlowTablesInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAllFlowsStatisticsFromAllFlowTablesInput input) throws ServiceException {
         final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPFLOW, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(flowCase);
@@ -71,6 +76,10 @@ public final class AllFlowsInAllTablesService extends AbstractCompatibleStatServ
 
     @Override
     public FlowsStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return FlowStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId, convertorExecutor);
+        return FlowStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                               getDeviceInfo(),
+                                                                               getOfVersion(),
+                                                                               emulatedTxId,
+                                                                               convertorExecutor);
     }
 }
index 19aa517cdd432d175f0d81c4a2c04784dd450e42..a4ea8124a6e6a0763880c05ff08f44528e478739 100644 (file)
@@ -36,13 +36,17 @@ public class AllFlowsInTableService extends AbstractCompatibleStatService<GetAll
 
     private final ConvertorExecutor convertorExecutor;
 
-    public AllFlowsInTableService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    public AllFlowsInTableService(final RequestContextStack requestContextStack,
+                                  final DeviceContext deviceContext,
+                                  AtomicLong compatibilityXidSeed,
+                                  ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllFlowStatisticsFromFlowTableInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAllFlowStatisticsFromFlowTableInput input) throws ServiceException {
         final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
         mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
         mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
@@ -73,6 +77,10 @@ public class AllFlowsInTableService extends AbstractCompatibleStatService<GetAll
 
     @Override
     public FlowsStatisticsUpdate transformToNotification(List<MultipartReply> mpResult, TransactionId emulatedTxId) {
-        return FlowStatisticsToNotificationTransformer.transformToNotification(mpResult, getDeviceInfo(), getOfVersion(), emulatedTxId, convertorExecutor);
+        return FlowStatisticsToNotificationTransformer.transformToNotification(mpResult,
+                                                                               getDeviceInfo(),
+                                                                               getOfVersion(),
+                                                                               emulatedTxId,
+                                                                               convertorExecutor);
     }
 }
index 547085fb082b64fd00f5751f841dbf4f11e4902d..a7a70fc49c41a46ccc66a4c549234a12957ee9e0 100644 (file)
@@ -50,12 +50,14 @@ final class AllGroupsStatsService extends
     private final ConvertorExecutor convertorExecutor;
 
 
-    public AllGroupsStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    AllGroupsStatsService(RequestContextStack requestContextStack,
+                                 DeviceContext deviceContext,
+                                 AtomicLong compatibilityXidSeed,
+                                 ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
 
-
     @Override
     protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) throws ServiceException {
         // Create multipart request header
@@ -76,6 +78,9 @@ final class AllGroupsStatsService extends
 
     @Override
     public GroupStatisticsUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return GroupStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), emulatedTxId, convertorExecutor);
+        return GroupStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                getDeviceInfo(),
+                                                                                emulatedTxId,
+                                                                                convertorExecutor);
     }
 }
index 278df7c692e476af2e89a333f824fb4b1fa03e79..220d84fd822a9b99333c3fb06cf0cfb622c34fc5 100644 (file)
@@ -40,7 +40,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter.config._case.MultipartRequestMeterConfigBuilder;
 
 final class AllMeterConfigStatsService
-        extends AbstractCompatibleStatService<GetAllMeterConfigStatisticsInput, GetAllMeterConfigStatisticsOutput, MeterConfigStatsUpdated> {
+        extends AbstractCompatibleStatService<GetAllMeterConfigStatisticsInput,
+                                              GetAllMeterConfigStatisticsOutput,
+                                              MeterConfigStatsUpdated> {
 
     private static final MultipartRequestMeterConfigCase METER_CONFIG_CASE;
 
@@ -59,14 +61,18 @@ final class AllMeterConfigStatsService
     private final ConvertorExecutor convertorExecutor;
     private final VersionConvertorData data;
 
-    public AllMeterConfigStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    AllMeterConfigStatsService(RequestContextStack requestContextStack,
+                                      DeviceContext deviceContext,
+                                      AtomicLong compatibilityXidSeed,
+                                      ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
         data = new VersionConvertorData(getVersion());
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllMeterConfigStatisticsInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAllMeterConfigStatisticsInput input) throws ServiceException {
         MultipartRequestInputBuilder mprInput = RequestInputUtils
                 .createMultipartHeader(MultipartType.OFPMPMETERCONFIG, xid.getValue(), getVersion());
         return mprInput.setMultipartRequestBody(METER_CONFIG_CASE).build();
@@ -89,7 +95,8 @@ final class AllMeterConfigStatsService
             MultipartReplyMeterConfigCase caseBody = (MultipartReplyMeterConfigCase) mpReply.getMultipartReplyBody();
             MultipartReplyMeterConfig replyBody = caseBody.getMultipartReplyMeterConfig();
 
-            final Optional<List<MeterConfigStats>> meterConfigStatsList = convertorExecutor.convert(replyBody.getMeterConfig(), data);
+            final Optional<List<MeterConfigStats>> meterConfigStatsList =
+                    convertorExecutor.convert(replyBody.getMeterConfig(), data);
 
             if (meterConfigStatsList.isPresent()) {
                 message.getMeterConfigStats().addAll(meterConfigStatsList.get());
index cb99ea6f92285045e1ba4e261d05def2627ffc6f..b72ef6133c7037402861eec163d8d01d942dd8d6 100644 (file)
@@ -33,8 +33,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder;
 
-final class AllMeterStatsService
-        extends AbstractCompatibleStatService<GetAllMeterStatisticsInput, GetAllMeterStatisticsOutput, MeterStatisticsUpdated> {
+final class AllMeterStatsService extends AbstractCompatibleStatService<GetAllMeterStatisticsInput,
+                                                                       GetAllMeterStatisticsOutput,
+                                                                       MeterStatisticsUpdated> {
     private static final MultipartRequestMeterCase METER_CASE;
 
     static {
@@ -50,7 +51,10 @@ final class AllMeterStatsService
 
     private final ConvertorExecutor convertorExecutor;
 
-    public AllMeterStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    AllMeterStatsService(RequestContextStack requestContextStack,
+                                DeviceContext deviceContext,
+                                AtomicLong compatibilityXidSeed,
+                                ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
@@ -70,6 +74,10 @@ final class AllMeterStatsService
 
     @Override
     public MeterStatisticsUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return MeterStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId, convertorExecutor);
+        return MeterStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                getDeviceInfo(),
+                                                                                getOfVersion(),
+                                                                                emulatedTxId,
+                                                                                convertorExecutor);
     }
 }
index b43925b9c39b84cb0dfb726ec983ff3dba5a5e98..c15c936eb6512f95ebc96e20d2201ec77b088dcb 100644 (file)
@@ -31,7 +31,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.G
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate;
 
 final class AllPortStatsService
-        extends AbstractCompatibleStatService<GetAllNodeConnectorsStatisticsInput, GetAllNodeConnectorsStatisticsOutput, NodeConnectorStatisticsUpdate> {
+        extends AbstractCompatibleStatService<GetAllNodeConnectorsStatisticsInput,
+                                              GetAllNodeConnectorsStatisticsOutput,
+                                              NodeConnectorStatisticsUpdate> {
 
     private static final MultipartRequestPortStatsCase PORT_STATS_CASE;
 
@@ -47,12 +49,15 @@ final class AllPortStatsService
         PORT_STATS_CASE = caseBuilder.build();
     }
 
-    public AllPortStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    AllPortStatsService(RequestContextStack requestContextStack,
+                               DeviceContext deviceContext,
+                               AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllNodeConnectorsStatisticsInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAllNodeConnectorsStatisticsInput input) throws ServiceException {
         MultipartRequestInputBuilder mprInput = RequestInputUtils
                 .createMultipartHeader(MultipartType.OFPMPPORTSTATS, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(PORT_STATS_CASE);
@@ -65,7 +70,11 @@ final class AllPortStatsService
     }
 
     @Override
-    public NodeConnectorStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return NodeConnectorStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId);
+    public NodeConnectorStatisticsUpdate transformToNotification(List<MultipartReply> result,
+                                                                 TransactionId emulatedTxId) {
+        return NodeConnectorStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                        getDeviceInfo(),
+                                                                                        getOfVersion(),
+                                                                                        emulatedTxId);
     }
 }
index 60686c97c9ffabfea83a7a5944d590c5122ec452..2ea0cd74947dcb1ab1f3cc8532e04438e2d78719 100644 (file)
@@ -30,8 +30,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate;
 
-final class AllQueuesAllPortsService
-        extends AbstractCompatibleStatService<GetAllQueuesStatisticsFromAllPortsInput, GetAllQueuesStatisticsFromAllPortsOutput, QueueStatisticsUpdate> {
+final class AllQueuesAllPortsService extends AbstractCompatibleStatService<GetAllQueuesStatisticsFromAllPortsInput,
+                                                                           GetAllQueuesStatisticsFromAllPortsOutput,
+                                                                           QueueStatisticsUpdate> {
 
     private static final MultipartRequestQueueCase QUEUE_CASE;
 
@@ -47,12 +48,15 @@ final class AllQueuesAllPortsService
         QUEUE_CASE = caseBuilder.build();
     }
 
-    public AllQueuesAllPortsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    AllQueuesAllPortsService(RequestContextStack requestContextStack,
+                                    DeviceContext deviceContext,
+                                    AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromAllPortsInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAllQueuesStatisticsFromAllPortsInput input) throws ServiceException {
         // Set request body to main multipart request
         MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPQUEUE, xid.getValue(), getVersion());
@@ -67,6 +71,9 @@ final class AllQueuesAllPortsService
 
     @Override
     public QueueStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return QueueStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId);
+        return QueueStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                getDeviceInfo(),
+                                                                                getOfVersion(),
+                                                                                emulatedTxId);
     }
 }
index e73411ce28b85b370db9246805ddc5877ea471ac..dee26eb3b7dcfbd76ede514883b221a8a31c1b9a 100644 (file)
@@ -31,15 +31,19 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate;
 
-final class AllQueuesOnePortService
-        extends AbstractCompatibleStatService<GetAllQueuesStatisticsFromGivenPortInput, GetAllQueuesStatisticsFromGivenPortOutput, QueueStatisticsUpdate> {
+final class AllQueuesOnePortService extends AbstractCompatibleStatService<GetAllQueuesStatisticsFromGivenPortInput,
+                                                                          GetAllQueuesStatisticsFromGivenPortOutput,
+                                                                          QueueStatisticsUpdate> {
 
-    public AllQueuesOnePortService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    AllQueuesOnePortService(RequestContextStack requestContextStack,
+                                   DeviceContext deviceContext,
+                                   AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromGivenPortInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAllQueuesStatisticsFromGivenPortInput input) throws ServiceException {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
         // Select all queues
@@ -66,6 +70,9 @@ final class AllQueuesOnePortService
 
     @Override
     public QueueStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return QueueStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId);
+        return QueueStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                getDeviceInfo(),
+                                                                                getOfVersion(),
+                                                                                emulatedTxId);
     }
 }
index a875c0d6e316a5785becf5cb4b40806b599778e4..c9f04eed90c78072f354ef0bc060a4f31fca8799 100644 (file)
@@ -36,13 +36,17 @@ public final class FlowsInTableService extends AbstractCompatibleStatService<Get
 
     private final ConvertorExecutor convertorExecutor;
 
-    public FlowsInTableService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    public FlowsInTableService(final RequestContextStack requestContextStack,
+                               final DeviceContext deviceContext,
+                               AtomicLong compatibilityXidSeed,
+                               ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsFromFlowTableInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetFlowStatisticsFromFlowTableInput input) throws ServiceException {
         final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
         final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
 
@@ -96,6 +100,10 @@ public final class FlowsInTableService extends AbstractCompatibleStatService<Get
 
     @Override
     public FlowsStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return FlowStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId, convertorExecutor);
+        return FlowStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                               getDeviceInfo(),
+                                                                               getOfVersion(),
+                                                                               emulatedTxId,
+                                                                               convertorExecutor);
     }
 }
index c1c79e44bf6d68dd6934253c4c455ed98861d3d6..12f12b4133e3ae3e7dcc4a32477d10e36ae04ac0 100644 (file)
@@ -36,11 +36,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupDescCaseBuilder;
 
 final class GroupDescriptionService
-        extends AbstractCompatibleStatService<GetGroupDescriptionInput, GetGroupDescriptionOutput, GroupDescStatsUpdated> {
-    private static final MultipartRequestGroupDescCase GROUP_DESC_CASE = new MultipartRequestGroupDescCaseBuilder().build();
+        extends AbstractCompatibleStatService<GetGroupDescriptionInput,
+                                              GetGroupDescriptionOutput,
+                                              GroupDescStatsUpdated> {
+    private static final MultipartRequestGroupDescCase GROUP_DESC_CASE =
+            new MultipartRequestGroupDescCaseBuilder().build();
     private final ConvertorExecutor convertorExecutor;
 
-    public GroupDescriptionService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    GroupDescriptionService(RequestContextStack requestContextStack,
+                            DeviceContext deviceContext,
+                            AtomicLong compatibilityXidSeed,
+                            ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
index fbd98649e1701676b41b86c4dd23daafae89c94a..ed8ef145b187baaa0232607c447c73c1677fb8ce 100644 (file)
@@ -52,7 +52,9 @@ final class GroupFeaturesService
     private static final MultipartRequestGroupFeaturesCase GROUP_FEAT_CASE =
             new MultipartRequestGroupFeaturesCaseBuilder().build();
 
-    public GroupFeaturesService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    GroupFeaturesService(RequestContextStack requestContextStack,
+                                DeviceContext deviceContext,
+                                AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
@@ -79,7 +81,8 @@ final class GroupFeaturesService
         notification.setMoreReplies(Boolean.FALSE);
         notification.setTransactionId(emulatedTxId);
 
-        MultipartReplyGroupFeaturesCase caseBody = (MultipartReplyGroupFeaturesCase) result.get(0).getMultipartReplyBody();
+        MultipartReplyGroupFeaturesCase caseBody =
+                (MultipartReplyGroupFeaturesCase) result.get(0).getMultipartReplyBody();
         MultipartReplyGroupFeatures replyBody = caseBody.getMultipartReplyGroupFeatures();
 
         notification.setGroupTypesSupported(extractSupportedGroupTypes(replyBody.getTypes()));
index 1ffb55533adafec42023174dd2ee5129b56228fe..7845e0e7b259bf91d0719c85a282d315c3dbe514 100644 (file)
@@ -30,12 +30,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroupBuilder;
 
-final class GroupStatsService
-        extends AbstractCompatibleStatService<GetGroupStatisticsInput, GetGroupStatisticsOutput, GroupStatisticsUpdated> {
+final class GroupStatsService extends AbstractCompatibleStatService<GetGroupStatisticsInput,
+                                                                    GetGroupStatisticsOutput,
+                                                                    GroupStatisticsUpdated> {
 
     private final ConvertorExecutor convertorExecutor;
 
-    public GroupStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    GroupStatsService(RequestContextStack requestContextStack,
+                             DeviceContext deviceContext,
+                             AtomicLong compatibilityXidSeed,
+                             ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
@@ -61,6 +65,9 @@ final class GroupStatsService
 
     @Override
     public GroupStatisticsUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return GroupStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), emulatedTxId, convertorExecutor);
+        return GroupStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                getDeviceInfo(),
+                                                                                emulatedTxId,
+                                                                                convertorExecutor);
     }
 }
index f41e1a72f39a32323757962b0a17446e4814cbc0..9dd8f6ad31d8990b9b212dbef99b6731fcb833bf 100644 (file)
@@ -46,9 +46,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 
 final class MeterFeaturesService
         extends AbstractCompatibleStatService<GetMeterFeaturesInput, GetMeterFeaturesOutput, MeterFeaturesUpdated> {
-    private static final MultipartRequestMeterFeaturesCase METER_FEATURES_CASE = new MultipartRequestMeterFeaturesCaseBuilder().build();
+    private static final MultipartRequestMeterFeaturesCase METER_FEATURES_CASE =
+            new MultipartRequestMeterFeaturesCaseBuilder().build();
 
-    public MeterFeaturesService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    MeterFeaturesService(RequestContextStack requestContextStack,
+                                DeviceContext deviceContext,
+                                AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
@@ -75,7 +78,8 @@ final class MeterFeaturesService
         notification.setMoreReplies(Boolean.FALSE);
         notification.setTransactionId(emulatedTxId);
 
-        MultipartReplyMeterFeaturesCase caseBody = (MultipartReplyMeterFeaturesCase) result.get(0).getMultipartReplyBody();
+        MultipartReplyMeterFeaturesCase caseBody =
+                (MultipartReplyMeterFeaturesCase) result.get(0).getMultipartReplyBody();
         MultipartReplyMeterFeatures replyBody = caseBody.getMultipartReplyMeterFeatures();
         notification.setMaxBands(replyBody.getMaxBands());
         notification.setMaxColor(replyBody.getMaxColor());
@@ -87,7 +91,8 @@ final class MeterFeaturesService
     }
 
     @VisibleForTesting
-    protected List<Class<? extends MeterBand>> extractSupportedMeterBand(MultipartReplyMeterFeatures replyBody, MeterBandTypeBitmap bandTypes) {
+    protected List<Class<? extends MeterBand>> extractSupportedMeterBand(MultipartReplyMeterFeatures replyBody,
+                                                                         MeterBandTypeBitmap bandTypes) {
         List<Class<? extends MeterBand>> supportedMeterBand = new ArrayList<>();
         if (bandTypes.isOFPMBTDROP()) {
             supportedMeterBand.add(MeterBandDrop.class);
index 5a0d8ef2c815298097caceee31aae2810631c3e2..4e0c7de496ea92ac55c216d01b259ac28d6990e0 100644 (file)
@@ -30,12 +30,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder;
 
-final class MeterStatsService
-        extends AbstractCompatibleStatService<GetMeterStatisticsInput, GetMeterStatisticsOutput, MeterStatisticsUpdated> {
+final class MeterStatsService extends AbstractCompatibleStatService<GetMeterStatisticsInput,
+                                                                    GetMeterStatisticsOutput,
+                                                                    MeterStatisticsUpdated> {
 
     private final ConvertorExecutor convertorExecutor;
 
-    public MeterStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) {
+    MeterStatsService(RequestContextStack requestContextStack,
+                             DeviceContext deviceContext,
+                             AtomicLong compatibilityXidSeed,
+                             ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
         this.convertorExecutor = convertorExecutor;
     }
@@ -62,6 +66,10 @@ final class MeterStatsService
 
     @Override
     public MeterStatisticsUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return MeterStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId, convertorExecutor);
+        return MeterStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                getDeviceInfo(),
+                                                                                getOfVersion(),
+                                                                                emulatedTxId,
+                                                                                convertorExecutor);
     }
 }
index 139f9b5d2027a6168b84bd9677526b890a7b0805..93d049756e52cacf54d28f07f4302e15e23478c0 100644 (file)
@@ -31,14 +31,19 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate;
 
 final class OneQueueOnePortService
-        extends AbstractCompatibleStatService<GetQueueStatisticsFromGivenPortInput, GetQueueStatisticsFromGivenPortOutput, QueueStatisticsUpdate> {
+        extends AbstractCompatibleStatService<GetQueueStatisticsFromGivenPortInput,
+                                              GetQueueStatisticsFromGivenPortOutput,
+                                              QueueStatisticsUpdate> {
 
-    public OneQueueOnePortService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    OneQueueOnePortService(RequestContextStack requestContextStack,
+                                  DeviceContext deviceContext,
+                                  AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetQueueStatisticsFromGivenPortInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetQueueStatisticsFromGivenPortInput input) throws ServiceException {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
         // Select specific queue
@@ -63,6 +68,7 @@ final class OneQueueOnePortService
 
     @Override
     public QueueStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return QueueStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId);
+        return QueueStatisticsToNotificationTransformer
+                .transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId);
     }
 }
index 68391db245e34f6fc9f828191d33b16d665bd71a..b9debdd8b890cfa960f09607af8dcdbeec8d7283 100644 (file)
@@ -28,18 +28,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.G
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-/**
- * @author joe
- */
-public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowStatisticsService, Delegator<OpendaylightFlowStatisticsService> {
+public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowStatisticsService,
+                                                              Delegator<OpendaylightFlowStatisticsService> {
 
     private final SingleLayerAggregateFlowMultipartService singleLayerService;
     private final MultiLayerAggregateFlowMultipartService multiLayerService;
     private OpendaylightFlowStatisticsService delegate;
 
     public static OpendaylightFlowStatisticsServiceImpl createWithOook(final RequestContextStack requestContextStack,
-                                                              final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor) {
-        return new OpendaylightFlowStatisticsServiceImpl(requestContextStack, deviceContext, deviceContext.oook(), convertorExecutor);
+                                                                       final DeviceContext deviceContext,
+                                                                       final ConvertorExecutor convertorExecutor) {
+        return new OpendaylightFlowStatisticsServiceImpl(requestContextStack,
+                                                         deviceContext,
+                                                         deviceContext.oook(),
+                                                         convertorExecutor);
     }
 
     public OpendaylightFlowStatisticsServiceImpl(final RequestContextStack requestContextStack,
@@ -57,12 +59,15 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
     }
 
     /**
-     * @deprecated provided for Be-release as backward compatibility relic
+     * Get aggregate statistics.
+     *
+     * @deprecated provided for Be-release as backward compatibility relic.
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> getAggregateFlowStatisticsFromFlowTableForAllFlows(
-            final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
+    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>>
+        getAggregateFlowStatisticsFromFlowTableForAllFlows(
+                final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
         if (delegate != null) {
             return delegate.getAggregateFlowStatisticsFromFlowTableForAllFlows(input);
         } else {
@@ -71,15 +76,18 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> getAggregateFlowStatisticsFromFlowTableForGivenMatch(
-            final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
+    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
+        getAggregateFlowStatisticsFromFlowTableForGivenMatch(
+                final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
         return singleLayerService.canUseSingleLayerSerialization()
             ? singleLayerService.handleAndReply(input)
             : multiLayerService.handleAndReply(input);
     }
 
     /**
-     * @deprecated provided for Be-release as backward compatibility relic
+     * Get flow statistics.
+     *
+     * @deprecated provided for Be-release as backward compatibility relic.
      */
     @Override
     @Deprecated
@@ -93,7 +101,9 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
     }
 
     /**
-     * @deprecated provided for Be-release as backward compatibility relic
+     * Get flow statistics.
+     *
+     * @deprecated provided for Be-release as backward compatibility relic.
      */
     @Override
     @Deprecated
@@ -107,7 +117,9 @@ public class OpendaylightFlowStatisticsServiceImpl implements OpendaylightFlowSt
     }
 
     /**
-     * @deprecated provided for Be-release as backward compatibility relic
+     * Get flow statistics.
+     *
+     * @deprecated provided for Be-release as backward compatibility relic.
      */
     @Override
     @Deprecated
index 01d54e0883eb0d0976975a9231da8ff681548d68..9249109c63e090cdd676a2856872348b86eddfaf 100644 (file)
@@ -42,7 +42,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Table
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public final class OpendaylightFlowTableStatisticsServiceImpl extends
-        AbstractCompatibleStatService<GetFlowTablesStatisticsInput, GetFlowTablesStatisticsOutput, FlowTableStatisticsUpdate> implements
+        AbstractCompatibleStatService<GetFlowTablesStatisticsInput,
+        GetFlowTablesStatisticsOutput,
+        FlowTableStatisticsUpdate> implements
         OpendaylightFlowTableStatisticsService {
 
     private final NotificationPublishService notificationPublishService;
@@ -64,7 +66,8 @@ public final class OpendaylightFlowTableStatisticsServiceImpl extends
     @Override
     protected OfHeader buildRequest(final Xid xid, final GetFlowTablesStatisticsInput input) throws ServiceException {
         // Create multipart request body for fetch all the group stats
-        final MultipartRequestTableCaseBuilder multipartRequestTableCaseBuilder = new MultipartRequestTableCaseBuilder();
+        final MultipartRequestTableCaseBuilder multipartRequestTableCaseBuilder =
+                new MultipartRequestTableCaseBuilder();
         final MultipartRequestTableBuilder multipartRequestTableBuilder = new MultipartRequestTableBuilder();
         multipartRequestTableBuilder.setEmpty(true);
         multipartRequestTableCaseBuilder.setMultipartRequestTable(multipartRequestTableBuilder.build());
@@ -84,7 +87,8 @@ public final class OpendaylightFlowTableStatisticsServiceImpl extends
     }
 
     @Override
-    public FlowTableStatisticsUpdate transformToNotification(List<MultipartReply> mpReplyList, TransactionId emulatedTxId) {
+    public FlowTableStatisticsUpdate transformToNotification(List<MultipartReply> mpReplyList,
+                                                             TransactionId emulatedTxId) {
         FlowTableStatisticsUpdateBuilder notification = new FlowTableStatisticsUpdateBuilder();
         notification.setId(getDeviceInfo().getNodeId());
         notification.setMoreReplies(Boolean.FALSE);
index b428aa7182992b1128d1601db6d45bfa2ba7f7fe..5b75ecc7a42bb1e1fd4fbc464123965ffdca7d93 100644 (file)
@@ -24,9 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-/**
- * @author joe
- */
 public class OpendaylightGroupStatisticsServiceImpl implements OpendaylightGroupStatisticsService {
     private final AllGroupsStatsService allGroups;
     private final GroupDescriptionService groupDesc;
@@ -34,19 +31,25 @@ public class OpendaylightGroupStatisticsServiceImpl implements OpendaylightGroup
     private final GroupStatsService groupStats;
     private final NotificationPublishService notificationPublishService;
 
-    public OpendaylightGroupStatisticsServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
+    public OpendaylightGroupStatisticsServiceImpl(final RequestContextStack requestContextStack,
+                                                  final DeviceContext deviceContext,
                                                   final AtomicLong compatibilityXidSeed,
                                                   final NotificationPublishService notificationPublishService,
                                                   final ConvertorExecutor convertorExecutor) {
         this.notificationPublishService = notificationPublishService;
-        allGroups = new AllGroupsStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
-        groupDesc = new GroupDescriptionService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
+        allGroups =
+                new AllGroupsStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
+        groupDesc = new GroupDescriptionService(requestContextStack,
+                                                deviceContext,
+                                                compatibilityXidSeed,
+                                                convertorExecutor);
         groupFeat = new GroupFeaturesService(requestContextStack, deviceContext, compatibilityXidSeed);
         groupStats = new GroupStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
     }
 
     @Override
-    public Future<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(final GetAllGroupStatisticsInput input) {
+    public Future<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(
+            final GetAllGroupStatisticsInput input) {
         return allGroups.handleAndNotify(input, notificationPublishService);
     }
 
index 4087e88282ccbb1f57d61c74f54b35862cb98763..03513d001aafa021b15405268abd7bc778112ee6 100644 (file)
@@ -38,8 +38,14 @@ public class OpendaylightMeterStatisticsServiceImpl implements OpendaylightMeter
                                                   final ConvertorExecutor convertorExecutor) {
         this.notificationPublishService = notificationPublishService;
 
-        allMeterConfig = new AllMeterConfigStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
-        allMeterStats = new AllMeterStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
+        allMeterConfig = new AllMeterConfigStatsService(requestContextStack,
+                                                        deviceContext,
+                                                        compatibilityXidSeed,
+                                                        convertorExecutor);
+        allMeterStats = new AllMeterStatsService(requestContextStack,
+                                                 deviceContext,
+                                                 compatibilityXidSeed,
+                                                 convertorExecutor);
         meterFeatures = new MeterFeaturesService(requestContextStack, deviceContext, compatibilityXidSeed);
         meterStats = new MeterStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
     }
@@ -51,7 +57,8 @@ public class OpendaylightMeterStatisticsServiceImpl implements OpendaylightMeter
     }
 
     @Override
-    public Future<RpcResult<GetAllMeterStatisticsOutput>> getAllMeterStatistics(final GetAllMeterStatisticsInput input) {
+    public Future<RpcResult<GetAllMeterStatisticsOutput>> getAllMeterStatistics(
+                                                                      final GetAllMeterStatisticsInput input) {
         return allMeterStats.handleAndNotify(input, notificationPublishService);
     }
 
index f4686c831bb15b65d2022a3875c1055182ae815b..36d8a7d429287da3d2b93d695a8ba44dcbdff38e 100644 (file)
@@ -30,15 +30,19 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.G
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate;
 
-final class PortStatsService
-        extends AbstractCompatibleStatService<GetNodeConnectorStatisticsInput, GetNodeConnectorStatisticsOutput, NodeConnectorStatisticsUpdate> {
+final class PortStatsService extends AbstractCompatibleStatService<GetNodeConnectorStatisticsInput,
+                                                                   GetNodeConnectorStatisticsOutput,
+                                                                   NodeConnectorStatisticsUpdate> {
 
-    public PortStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    PortStatsService(RequestContextStack requestContextStack,
+                            DeviceContext deviceContext,
+                            AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext, compatibilityXidSeed);
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetNodeConnectorStatisticsInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetNodeConnectorStatisticsInput input) throws ServiceException {
         MultipartRequestPortStatsCaseBuilder caseBuilder =
                 new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder mprPortStatsBuilder =
@@ -64,7 +68,11 @@ final class PortStatsService
     }
 
     @Override
-    public NodeConnectorStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
-        return NodeConnectorStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId);
+    public NodeConnectorStatisticsUpdate transformToNotification(List<MultipartReply> result,
+                                                                 TransactionId emulatedTxId) {
+        return NodeConnectorStatisticsToNotificationTransformer.transformToNotification(result,
+                                                                                        getDeviceInfo(),
+                                                                                        getOfVersion(),
+                                                                                        emulatedTxId);
     }
 }
index e0340bac59a7275218eda8f7f568aa3a5e68af04..2695ecb1ed6171e29ef50b18ec49590b674dd3fa 100644 (file)
@@ -31,16 +31,19 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * pulled up common functionality of notification emitting stats services (backward compatibility relic)
+ * Pulled up common functionality of notification emitting stats services (backward compatibility relic).
  */
-public abstract class AbstractCompatibleStatService<I extends DataContainer, O, N extends Notification> extends AbstractMultipartService<I, MultipartReply> implements BackwardCompatibleAtomicService<I, O> {
+public abstract class AbstractCompatibleStatService<I extends DataContainer, O, N extends Notification> extends
+        AbstractMultipartService<I, MultipartReply> implements BackwardCompatibleAtomicService<I, O> {
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractCompatibleStatService.class);
 
     private final AtomicLong compatibilityXidSeed;
     private final OpenflowVersion ofVersion;
 
-    public AbstractCompatibleStatService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+    public AbstractCompatibleStatService(RequestContextStack requestContextStack,
+                                         DeviceContext deviceContext,
+                                         AtomicLong compatibilityXidSeed) {
         super(requestContextStack, deviceContext);
         this.compatibilityXidSeed = compatibilityXidSeed;
         ofVersion = OpenflowVersion.get(getVersion());
@@ -51,7 +54,8 @@ public abstract class AbstractCompatibleStatService<I extends DataContainer, O,
     }
 
     @Override
-    public ListenableFuture<RpcResult<O>> handleAndNotify(final I input, final NotificationPublishService notificationPublishService) {
+    public ListenableFuture<RpcResult<O>> handleAndNotify(final I input,
+                                                          final NotificationPublishService notificationPublishService) {
         // prepare emulated xid
         final long emulatedXid = compatibilityXidSeed.incrementAndGet();
         final TransactionId emulatedTxId = new TransactionId(BigInteger.valueOf(emulatedXid));
@@ -68,13 +72,15 @@ public abstract class AbstractCompatibleStatService<I extends DataContainer, O,
                     final N flowNotification = transformToNotification(result.getResult(), emulatedTxId);
                     notificationPublishService.offerNotification(flowNotification);
                 } else {
-                    LOG.debug("compatibility callback failed - NOT emitting notification: {}", input.getClass().getSimpleName());
+                    LOG.debug("compatibility callback failed - NOT emitting notification: {}",
+                            input.getClass().getSimpleName());
                 }
             }
 
             @Override
-            public void onFailure(Throwable t) {
-                LOG.debug("compatibility callback crashed - NOT emitting notification: {}", input.getClass().getSimpleName(), t);
+            public void onFailure(Throwable throwable) {
+                LOG.debug("compatibility callback crashed - NOT emitting notification: {}",
+                        input.getClass().getSimpleName(), throwable);
             }
         });
 
index bf843165716d7035606263991615538e6c93670a..bf1d21dbc50f80ab330cb6abb45d4c5fc03578f6 100644 (file)
@@ -27,7 +27,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.MultipartReplyFlow;
 
 /**
- * pulled out flow stats to notification transformation
+ * Pulled out flow stats to notification transformation.
  */
 public class FlowStatisticsToNotificationTransformer {
 
@@ -36,11 +36,13 @@ public class FlowStatisticsToNotificationTransformer {
     }
 
     /**
+     * Transform to notification.
+     *
      * @param mpResult      raw multipart response from device
-     * @param deviceInfo   device state
+     * @param deviceInfo    device state
      * @param ofVersion     device version
-     * @param emulatedTxId
-     * @param convertorExecutor
+     * @param emulatedTxId  emulated transaction Id
+     * @param convertorExecutor convertor executor
      * @return notification containing flow stats
      */
     public static FlowsStatisticsUpdate transformToNotification(final List<MultipartReply> mpResult,
index a0a842a12060e6aab11b1996279f6522faf74564..f98a3bcba4a20751bd49cfc76494a507bf05a19e 100644 (file)
@@ -23,17 +23,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.MultipartReplyGroup;
 
 /**
- * pulled out group stats to notification transformation
+ * Pulled out group stats to notification transformation.
  */
 public class GroupStatisticsToNotificationTransformer {
+
     private GroupStatisticsToNotificationTransformer() {
         // Hide implicit constructor
     }
+
     /**
+     * Transform statistics to notification.
      * @param mpReplyList   raw multipart response from device
      * @param deviceInfo   device state
-     * @param emulatedTxId
-     * @param convertorExecutor
+     * @param emulatedTxId emulated transaction id
+     * @param convertorExecutor convertor executor
      * @return notification containing flow stats
      */
     public static GroupStatisticsUpdated transformToNotification(final List<MultipartReply> mpReplyList,
index ed84bf9355d0d90766113112645388d2ca0973eb..7f3d3941737fe6fdb0bd488abd55d415245c5c1b 100644 (file)
@@ -24,19 +24,22 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.MultipartReplyMeter;
 
 /**
- * pulled out meter stats to notification transformation
+ * Pulled out meter stats to notification transformation.
  */
 public class MeterStatisticsToNotificationTransformer {
 
     private MeterStatisticsToNotificationTransformer() {
         // Hide implicit constructor
     }
+
     /**
+     * Transform statistics to notification.
+     *
      * @param mpReplyList   raw multipart response from device
-     * @param deviceInfo   device state
+     * @param deviceInfo    device state
      * @param ofVersion     device version
-     * @param emulatedTxId
-     * @param convertorExecutor
+     * @param emulatedTxId  emulated transaction Id
+     * @param convertorExecutor convertor executor
      * @return notification containing flow stats
      */
     public static MeterStatisticsUpdated transformToNotification(final List<MultipartReply> mpReplyList,
@@ -55,7 +58,8 @@ public class MeterStatisticsToNotificationTransformer {
         for (MultipartReply mpReply : mpReplyList) {
             MultipartReplyMeterCase caseBody = (MultipartReplyMeterCase) mpReply.getMultipartReplyBody();
             MultipartReplyMeter replyBody = caseBody.getMultipartReplyMeter();
-            final Optional<List<MeterStats>> meterStatsList = convertorExecutor.convert(replyBody.getMeterStats(), data);
+            final Optional<List<MeterStats>> meterStatsList =
+                    convertorExecutor.convert(replyBody.getMeterStats(), data);
 
             if (meterStatsList.isPresent()) {
                 notification.getMeterStats().addAll(meterStatsList.get());
index d0eb39ce5ec9c99b943a5279162bf98fd1d2df09..fdf42c8cf23371d1a4768e2271b9e782237be323 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.n
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapKey;
 
 /**
- * pulled out port stats to notification transformation
+ * Pulled out port stats to notification transformation.
  */
 public class NodeConnectorStatisticsToNotificationTransformer {
 
@@ -39,10 +39,12 @@ public class NodeConnectorStatisticsToNotificationTransformer {
     }
 
     /**
+     * Transform statistics to notification.
+     *
      * @param mpReplyList   raw multipart response from device
      * @param deviceInfo    device basic info
      * @param ofVersion     device version
-     * @param emulatedTxId
+     * @param emulatedTxId  emulated transaction Id
      * @return notification containing flow stats
      */
     public static NodeConnectorStatisticsUpdate transformToNotification(final List<MultipartReply> mpReplyList,
@@ -55,7 +57,8 @@ public class NodeConnectorStatisticsToNotificationTransformer {
         notification.setMoreReplies(Boolean.FALSE);
         notification.setTransactionId(emulatedTxId);
 
-        notification.setNodeConnectorStatisticsAndPortNumberMap(new ArrayList<NodeConnectorStatisticsAndPortNumberMap>());
+        notification
+                .setNodeConnectorStatisticsAndPortNumberMap(new ArrayList<NodeConnectorStatisticsAndPortNumberMap>());
         for (MultipartReply mpReply : mpReplyList) {
             MultipartReplyPortStatsCase caseBody = (MultipartReplyPortStatsCase) mpReply.getMultipartReplyBody();
 
@@ -70,7 +73,9 @@ public class NodeConnectorStatisticsToNotificationTransformer {
     }
 
     @VisibleForTesting
-    static NodeConnectorStatisticsAndPortNumberMapBuilder processSingleNodeConnectorStats(DeviceInfo deviceInfo, OpenflowVersion ofVersion, PortStats portStats) {
+    static NodeConnectorStatisticsAndPortNumberMapBuilder processSingleNodeConnectorStats(DeviceInfo deviceInfo,
+                                                                                          OpenflowVersion ofVersion,
+                                                                                          PortStats portStats) {
         NodeConnectorStatisticsAndPortNumberMapBuilder statsBuilder =
                 new NodeConnectorStatisticsAndPortNumberMapBuilder();
         statsBuilder.setNodeConnectorId(
index afd42d2e0f544f4c6ac4bd05e84ee824a24d79cf..f172802608175b4817d117ffd040dfce9ab47728 100644 (file)
@@ -32,9 +32,6 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * @author joe
- */
 public class OpendaylightFlowStatisticsServiceDelegateImpl implements OpendaylightFlowStatisticsService {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpendaylightFlowStatisticsServiceDelegateImpl.class);
@@ -51,25 +48,35 @@ public class OpendaylightFlowStatisticsServiceDelegateImpl implements Opendaylig
                                                          final AtomicLong compatibilityXidSeed,
                                                          final ConvertorExecutor convertorExecutor) {
         this.notificationService = notificationService;
-        aggregateFlowsInTable = AggregateFlowsInTableService.createWithOook(requestContextStack, deviceContext, compatibilityXidSeed);
-        allFlowsInAllTables = new AllFlowsInAllTablesService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
-        allFlowsInTable = new AllFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
-        flowsInTable = new FlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
+        aggregateFlowsInTable =
+                AggregateFlowsInTableService.createWithOook(requestContextStack, deviceContext, compatibilityXidSeed);
+        allFlowsInAllTables = new AllFlowsInAllTablesService(requestContextStack,
+                                                             deviceContext,
+                                                             compatibilityXidSeed,
+                                                             convertorExecutor);
+        allFlowsInTable =
+                new AllFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
+        flowsInTable =
+                new FlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
     }
 
     /**
-     * @deprecated this is the only method with real implementation provided, in delegate it makes no sense
+     * Get statistics for the given match.
+     *
+     * @deprecated this is the only method with real implementation provided, in delegate it makes no sense.
      */
     @Override
     @Deprecated
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> getAggregateFlowStatisticsFromFlowTableForGivenMatch(
+    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
+        getAggregateFlowStatisticsFromFlowTableForGivenMatch(
             final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
-        throw new IllegalAccessError("unsupported by backward compatibility delegate service " +
-                "- this rpc is always provided by default service implementation");
+        throw new IllegalAccessError("unsupported by backward compatibility delegate service "
+                "- this rpc is always provided by default service implementation");
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> getAggregateFlowStatisticsFromFlowTableForAllFlows(
+    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>>
+        getAggregateFlowStatisticsFromFlowTableForAllFlows(
             final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
         return aggregateFlowsInTable.handleAndNotify(input, notificationService);
     }
index 1ba12e9d1cea5b63f31c60c15ab9bb474efb1497..a431175f870b006687e6bf8a5903da5b27755daa 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder;
 
 /**
- * pulled out queue stats to notification transformation
+ * Pulled out queue stats to notification transformation.
  */
 public class QueueStatisticsToNotificationTransformer {
 
@@ -37,10 +37,12 @@ public class QueueStatisticsToNotificationTransformer {
     }
 
     /**
+     * Transform statistics to notification.
+     *
      * @param mpReplyList   raw multipart response from device
-     * @param deviceInfo   device state
+     * @param deviceInfo    device state
      * @param ofVersion     device version
-     * @param emulatedTxId
+     * @param emulatedTxId  emulated transaction Id
      * @return notification containing flow stats
      */
     public static QueueStatisticsUpdate transformToNotification(final List<MultipartReply> mpReplyList,
@@ -83,6 +85,4 @@ public class QueueStatisticsToNotificationTransformer {
         }
         return notification.build();
     }
-
-
 }
index 8e2837aa7212c617e5f0ed7864ba38461489f4c6..dfad1b9ccbe45e5e543ab99a47ac2aa995358f42 100644 (file)
@@ -16,9 +16,9 @@ import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.StatisticsGatherer;
 import org.opendaylight.openflowplugin.impl.common.MultipartRequestInputFactory;
+import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
 import org.opendaylight.openflowplugin.impl.services.AbstractMultipartOnTheFlyService;
 import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
-import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
 import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
@@ -28,7 +28,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * collects statistics and processes them on the fly
+ * Collects statistics and processes them on the fly.
  */
 public class StatisticsGatheringOnTheFlyService<T extends OfHeader>
     extends AbstractMultipartOnTheFlyService<MultipartType, T>
@@ -44,7 +44,8 @@ public class StatisticsGatheringOnTheFlyService<T extends OfHeader>
     }
 
     @Override
-    public ListenableFuture<RpcResult<List<T>>> getStatisticsOfType(final EventIdentifier eventIdentifier, final MultipartType type) {
+    public ListenableFuture<RpcResult<List<T>>> getStatisticsOfType(final EventIdentifier eventIdentifier,
+                                                                    final MultipartType type) {
         LOG.debug("Getting statistics (onTheFly) for node {} of type {}", getDeviceInfo().getNodeId(), type);
         EventsTimeCounter.markStart(eventIdentifier);
         setEventIdentifier(eventIdentifier);
@@ -53,7 +54,9 @@ public class StatisticsGatheringOnTheFlyService<T extends OfHeader>
 
     @Override
     protected OfHeader buildRequest(final Xid xid, final MultipartType input) throws ServiceException {
-        return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(), getVersion(), input, canUseSingleLayerSerialization());
+        return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(),
+                                                                 getVersion(),
+                                                                 input,
+                                                                 canUseSingleLayerSerialization());
     }
-
 }
index bb4a3da7d5dfcf9624cab0a6724103144b232af5..ade408bf9d5fdb9def2da260c9e1fa0c6ded73b7 100644 (file)
@@ -31,12 +31,14 @@ public class StatisticsGatheringService<T extends OfHeader>
 
     private static final Logger LOG = LoggerFactory.getLogger(StatisticsGatheringService.class);
 
-    public StatisticsGatheringService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    public StatisticsGatheringService(final RequestContextStack requestContextStack,
+                                      final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
 
     @Override
-    public ListenableFuture<RpcResult<List<T>>> getStatisticsOfType(final EventIdentifier eventIdentifier, final MultipartType type) {
+    public ListenableFuture<RpcResult<List<T>>> getStatisticsOfType(final EventIdentifier eventIdentifier,
+                                                                    final MultipartType type) {
         LOG.debug("Getting statistics for node {} of type {}", getDeviceInfo().getNodeId(), type);
         EventsTimeCounter.markStart(eventIdentifier);
         setEventIdentifier(eventIdentifier);
@@ -45,7 +47,9 @@ public class StatisticsGatheringService<T extends OfHeader>
 
     @Override
     protected OfHeader buildRequest(final Xid xid, final MultipartType input) throws ServiceException {
-        return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(), getVersion(), input, canUseSingleLayerSerialization());
+        return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(),
+                                                                 getVersion(),
+                                                                 input,
+                                                                 canUseSingleLayerSerialization());
     }
-
 }
index 221e37855e1d8f2e612d941595135372bdc98413..0ed379ec45d2267c8a570dce06ef666abb915184 100644 (file)
@@ -33,7 +33,9 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
  * @param <I> the input type parameter
  * @param <O> the output type parameter
  */
-abstract class AbstractDirectStatisticsService<I extends StoreStatsGrouping, O extends DataContainer, T extends OfHeader>
+abstract class AbstractDirectStatisticsService<I extends StoreStatsGrouping,
+                                               O extends DataContainer,
+                                               T extends OfHeader>
         extends AbstractMultipartService<I, T> {
 
     private final MultipartType multipartType;
@@ -97,7 +99,7 @@ abstract class AbstractDirectStatisticsService<I extends StoreStatsGrouping, O e
     }
 
     /**
-     * Get multipart type
+     * Get multipart type.
      * @return multipart type
      */
     protected MultipartType getMultipartType() {
@@ -105,7 +107,7 @@ abstract class AbstractDirectStatisticsService<I extends StoreStatsGrouping, O e
     }
 
     /**
-     * Get convertor executor
+     * Get convertor executor.
      * @return convertor executor
      */
     protected ConvertorExecutor getConvertorExecutor() {
index 6f2dc67ad05b66f138e26dac49aba2f4addb7eb2..fb8181797a3dde9cef4d0dccacf7b629f17b371d 100644 (file)
@@ -40,7 +40,7 @@ public abstract class AbstractFlowDirectStatisticsService<T extends OfHeader>
 
     /**
      * Get flow ID from #{@link org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry} or
-     * create alien ID
+     * create alien ID.
      * @param flowStatistics flow statistics
      * @return generated flow ID
      */
index da900d543963f3bbe97557028678a7ee4d414e35..08f753a46adbca119559dfb1c71cf4c9102796c6 100644 (file)
@@ -27,7 +27,10 @@ public abstract class AbstractGroupDirectStatisticsService<T extends OfHeader>
                                                    final DeviceContext deviceContext,
                                                    final ConvertorExecutor convertorExecutor,
                                                    final MultipartWriterProvider statisticsWriterProvider) {
-        super(MultipartType.OFPMPGROUP, requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
+        super(MultipartType.OFPMPGROUP,
+                requestContextStack,
+                deviceContext,
+                convertorExecutor,
+                statisticsWriterProvider);
     }
-
 }
index cd7fdfe3f72a16c322f1061df40740ea2928c8f2..4b94417cb9da46dfa31412f89db361d1140f8d81 100644 (file)
@@ -27,7 +27,8 @@ public abstract class AbstractMeterDirectStatisticsService<T extends OfHeader> e
                                                 final DeviceContext deviceContext,
                                                 final ConvertorExecutor convertorExecutor,
                                                 final MultipartWriterProvider statisticsWriterProvider) {
-        super(MultipartType.OFPMPMETER, requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
+        super(MultipartType.OFPMPMETER, requestContextStack, deviceContext, convertorExecutor,
+                statisticsWriterProvider);
     }
 
 }
index e4e8142d483c31561ce99860ed23f0d4b21a9073..3b5dd725dfba20de0e1b247bb8fb362150ef8de9 100644 (file)
@@ -27,7 +27,11 @@ public abstract class AbstractPortDirectStatisticsService<T extends OfHeader>
                                                final DeviceContext deviceContext,
                                                final ConvertorExecutor convertorExecutor,
                                                final MultipartWriterProvider statisticsWriterProvider) {
-        super(MultipartType.OFPMPPORTSTATS, requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
+        super(MultipartType.OFPMPPORTSTATS,
+                requestContextStack,
+                deviceContext,
+                convertorExecutor,
+                statisticsWriterProvider);
     }
 
 }
index a3813dc347c1088cdacf9b963cfe233a3232d07b..67edb3eec69a4ed15692e9e96642b5ce2cb2b1ba 100644 (file)
@@ -27,7 +27,7 @@ public abstract class AbstractQueueDirectStatisticsService<T extends OfHeader>
                                                 final DeviceContext deviceContext,
                                                 final ConvertorExecutor convertorExecutor,
                                                 final MultipartWriterProvider statisticsWriterProvider) {
-        super(MultipartType.OFPMPQUEUE, requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
+        super(MultipartType.OFPMPQUEUE, requestContextStack, deviceContext, convertorExecutor,
+                statisticsWriterProvider);
     }
-
 }
index 8e2cea384a479b0d107f17380952cd87c9efc911..d9f1f85aef8a790cf5b17241ad5c6d0b2942aba7 100644 (file)
@@ -75,7 +75,8 @@ public class OpendaylightDirectStatisticsServiceImpl implements OpendaylightDire
 
     @Override
     @SuppressWarnings("unchecked")
-    public Future<RpcResult<GetNodeConnectorStatisticsOutput>> getNodeConnectorStatistics(GetNodeConnectorStatisticsInput input) {
+    public Future<RpcResult<GetNodeConnectorStatisticsOutput>>
+            getNodeConnectorStatistics(GetNodeConnectorStatisticsInput input) {
         return provider.lookup(AbstractPortDirectStatisticsService.class)
                 .map(service -> service.handleAndReply(input))
                 .orElse(missingImplementation(AbstractPortDirectStatisticsService.class));
index 96b9b03758e4f256e66a235dda7bbcc9e0de72b0..303cc2ca0d358d4c0d169b9dd97f23e671c17cb2 100644 (file)
@@ -16,7 +16,8 @@ import java.util.Optional;
  * The Opendaylight direct statistics service provider.
  */
 public class OpendaylightDirectStatisticsServiceProvider {
-    private Map<Class<? extends AbstractDirectStatisticsService>, AbstractDirectStatisticsService> services = new HashMap<>();
+    private Map<Class<? extends AbstractDirectStatisticsService>, AbstractDirectStatisticsService> services =
+            new HashMap<>();
 
     /**
      * Register direct statistics service.
@@ -24,7 +25,8 @@ public class OpendaylightDirectStatisticsServiceProvider {
      * @param type    the service type
      * @param service the service instance
      */
-    public void register(Class<? extends AbstractDirectStatisticsService> type, AbstractDirectStatisticsService service) {
+    public void register(Class<? extends AbstractDirectStatisticsService> type,
+                               AbstractDirectStatisticsService service) {
         services.put(type, service);
     }
 
@@ -34,7 +36,8 @@ public class OpendaylightDirectStatisticsServiceProvider {
      * @param type the service type
      * @return the service instance
      */
-    public Optional<? extends AbstractDirectStatisticsService> lookup(Class<? extends AbstractDirectStatisticsService> type) {
+    public Optional<? extends AbstractDirectStatisticsService>
+            lookup(Class<? extends AbstractDirectStatisticsService> type) {
         return Optional.ofNullable(services.get(type)).map(type::cast);
     }
 }
index 3639ba9b11f6b3690167f50106b7209adefdc2b4..47abf2824d79a2b295df1ff1bf0f2c43ba49b20d 100644 (file)
@@ -112,7 +112,10 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer
             mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
         }
 
-        MatchReactor.getInstance().convert(input.getMatch(), getVersion(), mprFlowRequestBuilder, getConvertorExecutor());
+        MatchReactor.getInstance().convert(input.getMatch(),
+                                           getVersion(),
+                                           mprFlowRequestBuilder,
+                                           getConvertorExecutor());
 
         return RequestInputUtils.createMultipartHeader(getMultipartType(), xid.getValue(), getVersion())
             .setMultipartRequestBody(new MultipartRequestFlowCaseBuilder()
@@ -120,5 +123,4 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer
                 .build())
             .build();
     }
-
 }
index 140a2e6336ac9fb04f7ff5ed61229b7e4ce86e4c..a0d2b5310c964feb295b6e7c10e40c0d5c19e6a8 100644 (file)
@@ -52,7 +52,8 @@ public class MeterDirectStatisticsService extends AbstractMeterDirectStatisticsS
             for (final MultipartReply mpReply : input) {
                 final MultipartReplyMeterCase caseBody = (MultipartReplyMeterCase) mpReply.getMultipartReplyBody();
                 final MultipartReplyMeter replyBody = caseBody.getMultipartReplyMeter();
-                final Optional<List<MeterStats>> meterStatsList = getConvertorExecutor().convert(replyBody.getMeterStats(), data);
+                final Optional<List<MeterStats>> meterStatsList =
+                        getConvertorExecutor().convert(replyBody.getMeterStats(), data);
                 meterStatsList.ifPresent(meterStats::addAll);
             }
         }
index a523a35ffa59ebb2c69fda7fe8c09a5aa255eb5d..0f15aca5bcfb0512be95808c73328ab0754dc5e8 100644 (file)
@@ -20,8 +20,9 @@ import org.opendaylight.openflowplugin.impl.statistics.services.direct.Opendayli
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 
 /**
- * Utility class for instantiating #{@link org.opendaylight.openflowplugin.impl.statistics.services.direct.OpendaylightDirectStatisticsServiceProvider}
- * with all multi-layer services already in
+ * Utility class for instantiating
+ * #{@link org.opendaylight.openflowplugin.impl.statistics.services.direct.OpendaylightDirectStatisticsServiceProvider}
+ * with all multi-layer services already in.
  */
 public class MultiLayerDirectStatisticsProviderInitializer {
 
@@ -46,5 +47,4 @@ public class MultiLayerDirectStatisticsProviderInitializer {
 
         return provider;
     }
-
 }
index 8aedb0db293a3c2bf76c0b20e717ad1cdc751997..61b472725449c407aba73ea12ace3c2a0161731b 100644 (file)
@@ -53,7 +53,8 @@ public class PortDirectStatisticsService extends AbstractPortDirectStatisticsSer
 
         if (success) {
             for (final MultipartReply mpReply : input) {
-                final MultipartReplyPortStatsCase caseBody = (MultipartReplyPortStatsCase) mpReply.getMultipartReplyBody();
+                final MultipartReplyPortStatsCase caseBody =
+                        (MultipartReplyPortStatsCase) mpReply.getMultipartReplyBody();
                 final MultipartReplyPortStats replyBody = caseBody.getMultipartReplyPortStats();
 
                 for (final PortStats portStats : replyBody.getPortStats()) {
@@ -78,7 +79,8 @@ public class PortDirectStatisticsService extends AbstractPortDirectStatisticsSer
                         durationBuilder.setNanosecond(new Counter32(portStats.getDurationNsec()));
                     }
 
-                    final NodeConnectorStatisticsAndPortNumberMap stats = new NodeConnectorStatisticsAndPortNumberMapBuilder()
+                    final NodeConnectorStatisticsAndPortNumberMap stats =
+                            new NodeConnectorStatisticsAndPortNumberMapBuilder()
                         .setBytes(bytesBuilder.build())
                         .setPackets(packetsBuilder.build())
                         .setNodeConnectorId(nodeConnectorId)
@@ -108,7 +110,8 @@ public class PortDirectStatisticsService extends AbstractPortDirectStatisticsSer
         final MultipartRequestPortStatsBuilder mprPortStatsBuilder = new MultipartRequestPortStatsBuilder();
 
         if (input.getNodeConnectorId() != null) {
-            mprPortStatsBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(getOfVersion(), input.getNodeConnectorId()));
+            mprPortStatsBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(getOfVersion(),
+                    input.getNodeConnectorId()));
         } else {
             mprPortStatsBuilder.setPortNo(OFConstants.OFPP_ANY);
         }
@@ -119,5 +122,4 @@ public class PortDirectStatisticsService extends AbstractPortDirectStatisticsSer
                 .build())
             .build();
     }
-
 }
index dc32e3580b73598d8c6a5f7896953fcf95acdf77..ee4fc5f725c82581598ab7fad9b0c2985f4c43bb 100644 (file)
@@ -95,7 +95,8 @@ public class QueueDirectStatisticsService extends AbstractQueueDirectStatisticsS
         }
 
         if (input.getNodeConnectorId() != null) {
-            mprQueueBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(getOfVersion(), input.getNodeConnectorId()));
+            mprQueueBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(getOfVersion(),
+                    input.getNodeConnectorId()));
         } else {
             mprQueueBuilder.setPortNo(OFConstants.OFPP_ANY);
         }
index 53702ffd7afb6ae4b2a42026b0693d65668b97af..79a57adfaa3f97377fefd50d1ee1ebab36262fce 100644 (file)
@@ -35,7 +35,8 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer
                                        final DeviceContext deviceContext,
                                        final ConvertorExecutor convertorExecutor,
                                        final MultipartWriterProvider statisticsWriterProvider) {
-        super(requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);    }
+        super(requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
+    }
 
     @Override
     protected GetFlowStatisticsOutput buildReply(List<MultipartReply> input, boolean success) {
index 4daab72690bd779746a6824141a8f1a15f607a78..f6e886a4606e43f4864cc61b92c86321360a32e2 100644 (file)
@@ -49,7 +49,8 @@ public class PortDirectStatisticsService extends AbstractPortDirectStatisticsSer
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetNodeConnectorStatisticsInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetNodeConnectorStatisticsInput input) throws ServiceException {
         return new MultipartRequestBuilder()
             .setXid(xid.getValue())
             .setVersion(getVersion())
index d6222dd819ff66efd452781ff102c2b567286bc3..60cb5e2e27925b4831ca4c501524d5c11e2ad1e9 100644 (file)
@@ -20,8 +20,9 @@ import org.opendaylight.openflowplugin.impl.statistics.services.direct.Opendayli
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 
 /**
- * Utility class for instantiating #{@link org.opendaylight.openflowplugin.impl.statistics.services.direct.OpendaylightDirectStatisticsServiceProvider}
- * with all multi-layer services already in
+ * Utility class for instantiating
+ * #{@link org.opendaylight.openflowplugin.impl.statistics.services.direct.OpendaylightDirectStatisticsServiceProvider}
+ * with all multi-layer services already in.
  */
 public class SingleLayerDirectStatisticsProviderInitializer {
 
index 107a78574e857a0bba4f41ab3eb9a67c47848ace..a61a3068d2d69fbdd059d5a6fb26dbf1fa958e0a 100644 (file)
@@ -83,7 +83,7 @@ public class MultipartReplyTranslatorTest {
     private static final Long DUMMY_REF_COUNT = 1234L;
     private static final GroupTypes DUMMY_GROUPS_TYPE = GroupTypes.GroupAll;
     private static final GroupType DUMMY_GROUP_TYPE = GroupType.OFPGTALL;
-    private static final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
+    private static final ConvertorManager CONVERTOR_MANAGER = ConvertorManagerFactory.createDefaultManager();
 
     @Before
     public void setUp() {
@@ -93,12 +93,13 @@ public class MultipartReplyTranslatorTest {
     public void testTranslateFlow() {
         DeviceContext mockedDeviceContext = mock(DeviceContext.class);
 
-        MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyFlow(), MultipartType.OFPMPFLOW);
+        MultipartReplyMessage multipartReplyMessage =
+                prepareMocks(mockedDeviceContext, prepareMultipartReplyFlow(), MultipartType.OFPMPFLOW);
 
         DataContainer result = MultipartReplyTranslatorUtil.translate(
             multipartReplyMessage,
             mockedDeviceContext.getDeviceInfo(),
-            convertorManager,
+                CONVERTOR_MANAGER,
             mockedDeviceContext.oook()).get();
 
         DataContainer dataObject = validateOutput(result);
@@ -109,12 +110,13 @@ public class MultipartReplyTranslatorTest {
     public void testTranslateAggregate() {
         DeviceContext mockedDeviceContext = mock(DeviceContext.class);
 
-        MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyAggregate(), MultipartType.OFPMPAGGREGATE);
+        MultipartReplyMessage multipartReplyMessage =
+                prepareMocks(mockedDeviceContext, prepareMultipartReplyAggregate(), MultipartType.OFPMPAGGREGATE);
 
         DataContainer result = MultipartReplyTranslatorUtil.translate(
             multipartReplyMessage,
             mockedDeviceContext.getDeviceInfo(),
-            convertorManager,
+                CONVERTOR_MANAGER,
             mockedDeviceContext.oook()).get();
 
         DataContainer dataObject = validateOutput(result);
@@ -129,21 +131,28 @@ public class MultipartReplyTranslatorTest {
     public void testTranslatePortStats() {
         DeviceContext mockedDeviceContext = mock(DeviceContext.class);
 
-        MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyPortStats(), MultipartType.OFPMPPORTSTATS);
+        MultipartReplyMessage multipartReplyMessage =
+                prepareMocks(mockedDeviceContext, prepareMultipartReplyPortStats(), MultipartType.OFPMPPORTSTATS);
 
         DataContainer result = MultipartReplyTranslatorUtil.translate(
             multipartReplyMessage,
             mockedDeviceContext.getDeviceInfo(),
-            convertorManager,
+                CONVERTOR_MANAGER,
             mockedDeviceContext.oook()).get();
 
         DataContainer dataObject = validateOutput(result);
-        assertTrue(dataObject instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsAndPortNumberMap);
-        org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatisticsUpdate = (org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsAndPortNumberMap)dataObject;
-        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatisticsAndPortNumberMaps = nodeConnectorStatisticsUpdate.getNodeConnectorStatisticsAndPortNumberMap();
+        assertTrue(dataObject instanceof org.opendaylight.yang.gen.v1.urn
+                .opendaylight.port.statistics.rev131214.NodeConnectorStatisticsAndPortNumberMap);
+        org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsAndPortNumberMap
+                nodeConnectorStatisticsUpdate = (org.opendaylight.yang.gen.v1.urn
+                .opendaylight.port.statistics.rev131214.NodeConnectorStatisticsAndPortNumberMap) dataObject;
+        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatisticsAndPortNumberMaps =
+                nodeConnectorStatisticsUpdate.getNodeConnectorStatisticsAndPortNumberMap();
         assertEquals(1, nodeConnectorStatisticsAndPortNumberMaps.size());
-        NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatisticsAndPortNumberMap = nodeConnectorStatisticsAndPortNumberMaps.get(0);
-        assertEquals("openflow:"+DUMMY_DATAPATH_ID +":"+ DUMMY_PORT_NO, nodeConnectorStatisticsAndPortNumberMap.getNodeConnectorId().getValue());
+        NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatisticsAndPortNumberMap =
+                nodeConnectorStatisticsAndPortNumberMaps.get(0);
+        assertEquals("openflow:" + DUMMY_DATAPATH_ID + ":" + DUMMY_PORT_NO,
+                nodeConnectorStatisticsAndPortNumberMap.getNodeConnectorId().getValue());
         assertEquals(DUMMY_RX_BYTES, nodeConnectorStatisticsAndPortNumberMap.getBytes().getReceived());
         assertEquals(DUMMY_TX_BYTES, nodeConnectorStatisticsAndPortNumberMap.getBytes().getTransmitted());
         assertEquals(DUMMY_RX_PACKETS, nodeConnectorStatisticsAndPortNumberMap.getPackets().getReceived());
@@ -162,20 +171,24 @@ public class MultipartReplyTranslatorTest {
     public void testTranslateGroup() {
         DeviceContext mockedDeviceContext = mock(DeviceContext.class);
 
-        MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyGroup(), MultipartType.OFPMPGROUP);
+        MultipartReplyMessage multipartReplyMessage =
+                prepareMocks(mockedDeviceContext, prepareMultipartReplyGroup(), MultipartType.OFPMPGROUP);
 
         DataContainer result = MultipartReplyTranslatorUtil.translate(
             multipartReplyMessage,
             mockedDeviceContext.getDeviceInfo(),
-            convertorManager,
+                CONVERTOR_MANAGER,
             mockedDeviceContext.oook()).get();
 
         DataContainer dataObject = validateOutput(result);
         assertTrue(dataObject instanceof GroupStatisticsReply);
         GroupStatisticsReply groupStatisticsUpdate = (GroupStatisticsReply)dataObject;
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> groupStats = groupStatisticsUpdate.getGroupStats();
+        List<org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> groupStats =
+                groupStatisticsUpdate.getGroupStats();
         assertEquals(1, groupStats.size());
-        org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats groupStat = groupStats.get(0);
+        org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats groupStat = groupStats.get(0);
 
         assertEquals(DUMMY_BYTE_COUNT, groupStat.getByteCount().getValue());
         assertEquals(DUMMY_DURATION_SEC, groupStat.getDuration().getSecond().getValue());
@@ -189,12 +202,13 @@ public class MultipartReplyTranslatorTest {
     public void testTranslateGroupDesc() {
         DeviceContext mockedDeviceContext = mock(DeviceContext.class);
 
-        MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyGroupDesc(), MultipartType.OFPMPGROUPDESC);
+        MultipartReplyMessage multipartReplyMessage =
+                prepareMocks(mockedDeviceContext, prepareMultipartReplyGroupDesc(), MultipartType.OFPMPGROUPDESC);
 
         DataContainer result = MultipartReplyTranslatorUtil.translate(
             multipartReplyMessage,
             mockedDeviceContext.getDeviceInfo(),
-            convertorManager,
+                CONVERTOR_MANAGER,
             mockedDeviceContext.oook()).get();
 
         DataContainer dataObject = validateOutput(result);
@@ -204,24 +218,23 @@ public class MultipartReplyTranslatorTest {
         assertEquals(1, groupDescStats.size());
         GroupDescStats groupDescStat = groupDescStats.get(0);
         assertEquals(DUMMY_GROUP_ID.getValue(),groupDescStat.getGroupId().getValue());
-        assertEquals(DUMMY_GROUPS_TYPE,groupDescStat.getGroupType() );
+        assertEquals(DUMMY_GROUPS_TYPE,groupDescStat.getGroupType());
     }
 
     private MultipartReplyBody prepareMultipartReplyGroupDesc() {
-        MultipartReplyGroupDescCaseBuilder multipartReplyGroupDescCaseBuilder = new MultipartReplyGroupDescCaseBuilder();
-        MultipartReplyGroupDescBuilder multipartReplyGroupDescBuilder = new MultipartReplyGroupDescBuilder();
         GroupDescBuilder groupDescBuilder = new GroupDescBuilder();
         groupDescBuilder.setGroupId(DUMMY_GROUP_ID);
         groupDescBuilder.setBucketsList(Collections.<BucketsList>emptyList());
         groupDescBuilder.setType(DUMMY_GROUP_TYPE);
+        MultipartReplyGroupDescBuilder multipartReplyGroupDescBuilder = new MultipartReplyGroupDescBuilder();
         multipartReplyGroupDescBuilder.setGroupDesc(Lists.newArrayList(groupDescBuilder.build()));
+        MultipartReplyGroupDescCaseBuilder multipartReplyGroupDescCaseBuilder =
+                new MultipartReplyGroupDescCaseBuilder();
         multipartReplyGroupDescCaseBuilder.setMultipartReplyGroupDesc(multipartReplyGroupDescBuilder.build());
         return multipartReplyGroupDescCaseBuilder.build();
     }
 
     private MultipartReplyBody prepareMultipartReplyGroup() {
-        MultipartReplyGroupCaseBuilder multipartReplyGroupCaseBuilder = new MultipartReplyGroupCaseBuilder();
-        MultipartReplyGroupBuilder multipartReplyGroupBuilder = new MultipartReplyGroupBuilder();
         GroupStatsBuilder groupStatsBuilder = new GroupStatsBuilder();
         groupStatsBuilder.setByteCount(DUMMY_BYTE_COUNT);
         groupStatsBuilder.setBucketStats(Collections.<BucketStats>emptyList());
@@ -230,16 +243,14 @@ public class MultipartReplyTranslatorTest {
         groupStatsBuilder.setGroupId(DUMMY_GROUP_ID);
         groupStatsBuilder.setPacketCount(DUMMY_PACKET_COUNT);
         groupStatsBuilder.setRefCount(DUMMY_REF_COUNT);
-
-
+        MultipartReplyGroupBuilder multipartReplyGroupBuilder = new MultipartReplyGroupBuilder();
         multipartReplyGroupBuilder.setGroupStats(Lists.newArrayList(groupStatsBuilder.build()));
+        MultipartReplyGroupCaseBuilder multipartReplyGroupCaseBuilder = new MultipartReplyGroupCaseBuilder();
         multipartReplyGroupCaseBuilder.setMultipartReplyGroup(multipartReplyGroupBuilder.build());
         return multipartReplyGroupCaseBuilder.build();
     }
 
     private MultipartReplyBody prepareMultipartReplyPortStats() {
-        MultipartReplyPortStatsCaseBuilder multipartReplyPortStatsCaseBuilder = new MultipartReplyPortStatsCaseBuilder();
-        MultipartReplyPortStatsBuilder multipartReplyPortStatsBuilder = new MultipartReplyPortStatsBuilder();
         PortStatsBuilder dummyPortStatBuilder = new PortStatsBuilder();
         dummyPortStatBuilder.setPortNo(DUMMY_PORT_NO);
         dummyPortStatBuilder.setRxBytes(DUMMY_RX_BYTES);
@@ -254,19 +265,22 @@ public class MultipartReplyTranslatorTest {
         dummyPortStatBuilder.setRxOverErr(DUMMY_OVER_ERR);
         dummyPortStatBuilder.setTxDropped(DUMMY_TX_DROPPED);
         dummyPortStatBuilder.setTxErrors(DUMMY_TX_ERRORS);
-
+        MultipartReplyPortStatsBuilder multipartReplyPortStatsBuilder = new MultipartReplyPortStatsBuilder();
         multipartReplyPortStatsBuilder.setPortStats(Lists.newArrayList(dummyPortStatBuilder.build()));
+        MultipartReplyPortStatsCaseBuilder multipartReplyPortStatsCaseBuilder =
+                new MultipartReplyPortStatsCaseBuilder();
         multipartReplyPortStatsCaseBuilder.setMultipartReplyPortStats(multipartReplyPortStatsBuilder.build());
         return multipartReplyPortStatsCaseBuilder.build();
     }
 
 
     private MultipartReplyBody prepareMultipartReplyAggregate() {
-        MultipartReplyAggregateCaseBuilder multipartReplyAggregateCaseBuilder = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder multipartReplyAggregateBuilder = new MultipartReplyAggregateBuilder();
         multipartReplyAggregateBuilder.setByteCount(DUMMY_BYTE_COUNT);
         multipartReplyAggregateBuilder.setPacketCount(DUMMY_PACKET_COUNT);
         multipartReplyAggregateBuilder.setFlowCount(DUMMY_FLOW_COUNT);
+        MultipartReplyAggregateCaseBuilder multipartReplyAggregateCaseBuilder =
+                new MultipartReplyAggregateCaseBuilder();
         multipartReplyAggregateCaseBuilder.setMultipartReplyAggregate(multipartReplyAggregateBuilder.build());
         return multipartReplyAggregateCaseBuilder.build();
     }
@@ -279,7 +293,9 @@ public class MultipartReplyTranslatorTest {
         return multipartReplyFlowCaseBuilder.build();
     }
 
-    private MultipartReplyMessage prepareMocks(DeviceContext mockedDeviceContext, MultipartReplyBody multipartReplyBody, final MultipartType multipartType) {
+    private MultipartReplyMessage prepareMocks(DeviceContext mockedDeviceContext,
+                                               MultipartReplyBody multipartReplyBody,
+                                               final MultipartType multipartType) {
         ConnectionContext mockedConnectionContext = mock(ConnectionContext.class);
         FeaturesReply mockedFeaturesReply = mock(FeaturesReply.class);
         when(mockedFeaturesReply.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
@@ -302,7 +318,6 @@ public class MultipartReplyTranslatorTest {
         return multipartReplyMessage;
     }
 
-
     private DataContainer validateOutput(DataContainer dataObject) {
         return dataObject;
     }
index df717d90d33a6ceb5de23dcc348b7b15a8b7cb50..ea76e8c5c65989d1f66f35857fff5c281fa913c9 100644 (file)
@@ -50,7 +50,7 @@ class StatisticsContextImpMockInitiation {
     DeviceInfo mockedDeviceInfo;
     StatisticsManager mockedStatisticsManager;
 
-    static final KeyedInstanceIdentifier<Node, NodeKey> dummyNodeII = InstanceIdentifier.create(Nodes.class)
+    static final KeyedInstanceIdentifier<Node, NodeKey> DUMMY_NODE_ID = InstanceIdentifier.create(Nodes.class)
             .child(Node.class, new NodeKey(new NodeId("dummyNodeId")));
 
     @Before
@@ -79,16 +79,16 @@ class StatisticsContextImpMockInitiation {
         when(mockedDeviceState.isMetersAvailable()).thenReturn(isMeter);
         when(mockedDeviceState.isPortStatisticsAvailable()).thenReturn(isPort);
         when(mockedDeviceState.isQueueStatisticsAvailable()).thenReturn(isQueue);
-        when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(dummyNodeII);
+        when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_NODE_ID);
         when(mockedDeviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
 
         when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
         when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
         when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedConnectionContext);
         when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessageSpy);
-        when(mockedDeviceInfo.getNodeId()).thenReturn(dummyNodeII.getKey().getId());
+        when(mockedDeviceInfo.getNodeId()).thenReturn(DUMMY_NODE_ID.getKey().getId());
 
-        when(mockedConnectionContext.getNodeId()).thenReturn(dummyNodeII.getKey().getId());
+        when(mockedConnectionContext.getNodeId()).thenReturn(DUMMY_NODE_ID.getKey().getId());
         when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeatures);
         when(mockedConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
         when(mockedConnectionContext.getOutboundQueueProvider()).thenReturn(mockedOutboundQueue);
index 234b5e4d2a93b2d95a0167538b15caef064c3c12..a33bef424663f50b77b550171acd514941024371 100644 (file)
@@ -34,8 +34,11 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 @RunWith(Parameterized.class)
 public class StatisticsContextImplParamTest extends StatisticsContextImpMockInitiation {
 
-
-    public StatisticsContextImplParamTest(final boolean isTable, final boolean isFlow, final boolean isGroup, final boolean isMeter, final boolean isPort,
+    public StatisticsContextImplParamTest(final boolean isTable,
+                                          final boolean isFlow,
+                                          final boolean isGroup,
+                                          final boolean isMeter,
+                                          final boolean isPort,
                                           final boolean isQueue) {
         super();
         this.isTable = isTable;
@@ -58,9 +61,6 @@ public class StatisticsContextImplParamTest extends StatisticsContextImpMockInit
         });
     }
 
-
-
-
     @Test
     public void gatherDynamicDataTest() {
 
@@ -72,7 +72,8 @@ public class StatisticsContextImplParamTest extends StatisticsContextImpMockInit
                 MultipartWriterProviderFactory.createDefaultProvider(mockedDeviceContext),
                 false);
 
-        final ListenableFuture<RpcResult<List<MultipartReply>>> rpcResult = immediateFuture(RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build());
+        final ListenableFuture<RpcResult<List<MultipartReply>>> rpcResult =
+                immediateFuture(RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build());
         when(mockedStatisticsGatheringService.getStatisticsOfType(any(EventIdentifier.class), any(MultipartType
                 .class))).thenReturn(rpcResult);
         when(mockedStatisticsOnFlyGatheringService.getStatisticsOfType(any(EventIdentifier.class), any(MultipartType
@@ -88,7 +89,5 @@ public class StatisticsContextImplParamTest extends StatisticsContextImpMockInit
         } catch (InterruptedException | ExecutionException e) {
             fail("Exception wasn't expected.");
         }
-
     }
-
 }
\ No newline at end of file
index 9b73c75b551e0f9a537fcbf1b417923babf75af6..b83a5d528c33c4c965b59eb288ba4b88b558c10d 100644 (file)
@@ -74,7 +74,7 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
     }
 
     /**
-     * There is nothing to check in close method
+     * There is nothing to check in close method.
      */
     @Test
     public void testClose() throws Exception {
@@ -89,8 +89,7 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
             Assert.assertTrue(requestContext.getFuture().isDone());
             final RpcResult<?> rpcResult = requestContext.getFuture().get();
             Assert.assertFalse(rpcResult.isSuccessful());
-            Assert.assertFalse(rpcResult.isSuccessful());
-        } catch (final Exception e) {
+        } catch (final ExecutionException e) {
             LOG.error("request future value should be finished", e);
             Assert.fail("request context closing failed");
         }
@@ -113,17 +112,19 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
         when(mockedDeviceState.isMetersAvailable()).thenReturn(Boolean.TRUE);
         when(mockedDeviceState.isPortStatisticsAvailable()).thenReturn(Boolean.TRUE);
         when(mockedDeviceState.isQueueStatisticsAvailable()).thenReturn(Boolean.TRUE);
-        when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(dummyNodeII);
+        when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_NODE_ID);
         initStatisticsContext();
 
-        when(mockedStatisticsGatheringService.getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class)))
+        when(mockedStatisticsGatheringService
+                .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class)))
                 .thenReturn(
-                        Futures.immediateFuture(RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build())
-                );
-        when(mockedStatisticsOnFlyGatheringService.getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class)))
+                    Futures.immediateFuture(RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build())
+            );
+        when(mockedStatisticsOnFlyGatheringService
+                .getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.any(MultipartType.class)))
                 .thenReturn(
-                        Futures.immediateFuture(RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build())
-                );
+                    Futures.immediateFuture(RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build())
+            );
 
         final ListenableFuture<Boolean> gatheringResult = statisticsContext.gatherDynamicData();
         Assert.assertTrue(gatheringResult.isDone());
@@ -136,13 +137,13 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
     }
 
     @Test
-    public void testDeviceConnectionCheck_WORKING() throws Exception {
+    public void testDeviceConnectionCheckWorking() throws Exception {
         final ListenableFuture<Boolean> deviceConnectionCheckResult = statisticsContext.deviceConnectionCheck();
         Assert.assertTrue(deviceConnectionCheckResult.get());
     }
 
     @Test
-    public void testDeviceConnectionCheck_RIP() throws Exception {
+    public void testDeviceConnectionCheckRip() throws Exception {
         Mockito.reset(mockedConnectionContext);
         when(mockedConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.RIP);
         final ListenableFuture<Boolean> deviceConnectionCheckResult = statisticsContext.deviceConnectionCheck();
@@ -150,14 +151,14 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
         try {
             deviceConnectionCheckResult.get();
             Assert.fail("connection in state RIP should have caused exception here");
-        } catch (final Exception e) {
+        } catch (final ExecutionException e) {
             LOG.debug("expected behavior for RIP connection achieved");
             Assert.assertTrue(e instanceof ExecutionException);
         }
     }
 
     @Test
-    public void testDeviceConnectionCheck_HANSHAKING() throws Exception {
+    public void testDeviceConnectionCheckHandshaking() throws Exception {
         Mockito.reset(mockedConnectionContext);
         when(mockedConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.HANDSHAKING);
         final ListenableFuture<Boolean> deviceConnectionCheckResult = statisticsContext.deviceConnectionCheck();
@@ -165,7 +166,7 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
         try {
             final Boolean checkPositive = deviceConnectionCheckResult.get();
             Assert.assertTrue(checkPositive);
-        } catch (final Exception e) {
+        } catch (final ExecutionException e) {
             Assert.fail("connection in state HANDSHAKING should NOT have caused exception here");
         }
     }
index c385692930632fcb3629129e655323cb3f9781d9..b65145a4bf4d0e7d841f9bff7b55a059442e67e0 100644 (file)
@@ -244,7 +244,8 @@ public class StatisticsGatheringUtilsTest {
         fireAndCheck(type, statsData);
 
         final InstanceIdentifier<GroupStatistics> groupPath = dummyNodePath.augmentation(FlowCapableNode.class)
-                .child(Group.class, new GroupKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId(groupIdValue)))
+                .child(Group.class, new GroupKey(new org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.group.types.rev131018.GroupId(groupIdValue)))
                 .augmentation(NodeGroupStatistics.class)
                 .child(GroupStatistics.class);
         verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
@@ -272,14 +273,17 @@ public class StatisticsGatheringUtilsTest {
 
         fireAndCheck(type, statsData);
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId storedGroupId = new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId(groupIdValue);
-        final KeyedInstanceIdentifier<Group, GroupKey> groupPath = dummyNodePath.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(storedGroupId));
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId storedGroupId =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId(groupIdValue);
+        final KeyedInstanceIdentifier<Group, GroupKey> groupPath =
+                dummyNodePath.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(storedGroupId));
 
-        verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.<InstanceIdentifier<?>> any());
+        verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+                                                                  Matchers.<InstanceIdentifier<?>>any());
         verify(deviceGroupRegistry).processMarks();
         verify(deviceGroupRegistry).store(storedGroupId);
-        verify(deviceContext).writeToTransaction(
-                Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.eq(groupPath), Matchers.any(Group.class));
+        verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+                                                 Matchers.eq(groupPath), Matchers.any(Group.class));
     }
 
     @Test
@@ -309,7 +313,8 @@ public class StatisticsGatheringUtilsTest {
         fireAndCheck(type, statsData);
 
         final InstanceIdentifier<MeterStatistics> meterPath = dummyNodePath.augmentation(FlowCapableNode.class)
-                .child(Meter.class, new MeterKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId(meterIdValue)))
+                .child(Meter.class, new MeterKey(new org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.meter.types.rev130918.MeterId(meterIdValue)))
                 .augmentation(NodeMeterStatistics.class)
                 .child(MeterStatistics.class);
         verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
@@ -333,7 +338,8 @@ public class StatisticsGatheringUtilsTest {
         fireAndCheck(type, statsData);
 
         final InstanceIdentifier<FlowCapableNodeConnectorStatistics> portPath = dummyNodePath
-                .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("openflow:" + DUMMY_NODE_ID_VALUE + ":11")))
+                .child(NodeConnector.class,
+                        new NodeConnectorKey(new NodeConnectorId("openflow:" + DUMMY_NODE_ID_VALUE + ":11")))
                 .augmentation(FlowCapableNodeConnectorStatisticsData.class)
                 .child(FlowCapableNodeConnectorStatistics.class);
         verify(deviceContext).writeToTransaction(
@@ -397,7 +403,8 @@ public class StatisticsGatheringUtilsTest {
         fireAndCheck(type, statsData);
 
         final KeyedInstanceIdentifier<Queue, QueueKey> queuePath = dummyNodePath
-                .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("openflow:" + DUMMY_NODE_ID_VALUE + ":11")))
+                .child(NodeConnector.class,
+                        new NodeConnectorKey(new NodeConnectorId("openflow:" + DUMMY_NODE_ID_VALUE + ":11")))
                 .augmentation(FlowCapableNodeConnector.class)
                 .child(Queue.class, new QueueKey(new QueueId(queueIdValue)));
         verify(deviceContext).writeToTransaction(
@@ -411,17 +418,20 @@ public class StatisticsGatheringUtilsTest {
         final short tableId = 0;
         final MultipartType type = MultipartType.OFPMPFLOW;
 
-        final InstanceIdentifier<FlowCapableNode> nodePath = deviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
+        final InstanceIdentifier<FlowCapableNode> nodePath =
+                deviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
         final TableBuilder tableDataBld = new TableBuilder();
         tableDataBld.setId(tableId);
         final FlowCapableNodeBuilder flowNodeBuilder = new FlowCapableNodeBuilder();
         flowNodeBuilder.setTable(Collections.singletonList(tableDataBld.build()));
         final Optional<FlowCapableNode> flowNodeOpt = Optional.of(flowNodeBuilder.build());
-        final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture = Futures.immediateCheckedFuture(flowNodeOpt);
+        final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture =
+                Futures.immediateCheckedFuture(flowNodeOpt);
         when(readTx.read(LogicalDatastoreType.OPERATIONAL, nodePath)).thenReturn(flowNodeFuture);
         when(flowDescriptor.getFlowId()).thenReturn(flowId);
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder matchBld =
+        final org.opendaylight.yang.gen.v1.urn
+                .opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder matchBld =
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder()
                         .setMatchEntry(Collections.<MatchEntry>emptyList());
         final FlowStatsBuilder flowStatsBld = new FlowStatsBuilder()
@@ -449,10 +459,13 @@ public class StatisticsGatheringUtilsTest {
                 .child(Table.class, new TableKey((short) 0));
         final KeyedInstanceIdentifier<Flow, FlowKey> flowPath =  tablePath.child(Flow.class, new FlowKey(flowId));
 
-        verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.<InstanceIdentifier<?>>any());
+        verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+                                                                  Matchers.<InstanceIdentifier<?>>any());
 
         final InOrder inOrder = Mockito.inOrder(deviceContext);
-        inOrder.verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),Matchers.any(), Matchers.any());
+        inOrder.verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+                                                         Matchers.any(),
+                                                         Matchers.any());
     }
 
     @Test
@@ -467,7 +480,8 @@ public class StatisticsGatheringUtilsTest {
 
         final MultipartReplyMeterConfigBuilder mpReplyMeterConfigBld = new MultipartReplyMeterConfigBuilder();
         mpReplyMeterConfigBld.setMeterConfig(Lists.newArrayList(meterConfigBld.build()));
-        final MultipartReplyMeterConfigCaseBuilder mpReplyMeterConfigCaseBld = new MultipartReplyMeterConfigCaseBuilder();
+        final MultipartReplyMeterConfigCaseBuilder mpReplyMeterConfigCaseBld =
+                new MultipartReplyMeterConfigCaseBuilder();
         mpReplyMeterConfigCaseBld.setMultipartReplyMeterConfig(mpReplyMeterConfigBld.build());
 
         final MultipartReply meterConfigUpdated = assembleMPReplyMessage(type, mpReplyMeterConfigCaseBld.build());
@@ -479,12 +493,15 @@ public class StatisticsGatheringUtilsTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId(meterIdValue);
         final KeyedInstanceIdentifier<Meter, MeterKey> meterPath = dummyNodePath.augmentation(FlowCapableNode.class)
                 .child(Meter.class, new MeterKey(meterId));
-        verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.<InstanceIdentifier<?>>any());
+        verify(deviceContext, Mockito.never()).addDeleteToTxChain(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+                                                                  Matchers.<InstanceIdentifier<?>>any());
         verify(deviceMeterRegistry).store(meterId);
-        verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.eq(meterPath), Matchers.any(Meter.class));
+        verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+                                                 Matchers.eq(meterPath), Matchers.any(Meter.class));
     }
 
-    private void fireAndCheck(final MultipartType type, final List<MultipartReply> statsData) throws InterruptedException, ExecutionException, TimeoutException {
+    private void fireAndCheck(final MultipartType type, final List<MultipartReply> statsData)
+            throws InterruptedException, ExecutionException, TimeoutException {
         when(statisticsService.getStatisticsOfType(Matchers.any(EventIdentifier.class), Matchers.eq(type)))
                 .thenReturn(Futures.immediateFuture(RpcResultBuilder.success(statsData).build()));
 
@@ -501,7 +518,8 @@ public class StatisticsGatheringUtilsTest {
         verify(deviceContext).submitTransaction();
     }
 
-    private static MultipartReplyMessage assembleMPReplyMessage(final MultipartType type, final MultipartReplyBody mpReplyGroupCaseBld) {
+    private static MultipartReplyMessage assembleMPReplyMessage(final MultipartType type,
+                                                                final MultipartReplyBody mpReplyGroupCaseBld) {
         return new MultipartReplyMessageBuilder()
                 .setMultipartReplyBody(mpReplyGroupCaseBld)
                 .setType(type)
@@ -511,25 +529,30 @@ public class StatisticsGatheringUtilsTest {
     }
 
     private static BucketStats createBucketStat(final long byteCount, final long packetCount) {
-        return new BucketStatsBuilder().setByteCount(BigInteger.valueOf(byteCount)).setPacketCount(BigInteger.valueOf(packetCount)).build();
+        return new BucketStatsBuilder()
+                .setByteCount(BigInteger.valueOf(byteCount)).setPacketCount(BigInteger.valueOf(packetCount)).build();
     }
 
     @Test
     public void testDeleteAllKnownFlows() throws Exception {
         final short tableId = 0;
-        final InstanceIdentifier<FlowCapableNode> nodePath = deviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
+        final InstanceIdentifier<FlowCapableNode> nodePath =
+                deviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
         final TableBuilder tableDataBld = new TableBuilder();
         tableDataBld.setId(tableId);
         final FlowCapableNodeBuilder flowNodeBuilder = new FlowCapableNodeBuilder();
         flowNodeBuilder.setTable(Collections.singletonList(tableDataBld.build()));
         final Optional<FlowCapableNode> flowNodeOpt = Optional.of(flowNodeBuilder.build());
-        final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture = Futures.immediateCheckedFuture(flowNodeOpt);
+        final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture =
+                Futures.immediateCheckedFuture(flowNodeOpt);
         when(readTx.read(LogicalDatastoreType.OPERATIONAL, nodePath)).thenReturn(flowNodeFuture);
         StatisticsGatheringUtils.deleteAllKnownFlows(deviceContext, deviceInfo.getNodeInstanceIdentifier()
             .augmentation(FlowCapableNode.class), deviceFlowRegistry);
 
         verify(deviceContext).isTransactionsEnabled();
         verify(deviceContext).getReadTransaction();
-        verify(deviceContext).writeToTransaction(Mockito.eq(LogicalDatastoreType.OPERATIONAL), Mockito.any(), Mockito.any());
+        verify(deviceContext).writeToTransaction(Mockito.eq(LogicalDatastoreType.OPERATIONAL),
+                                                 Mockito.any(),
+                                                 Mockito.any());
     }
 }
index 52b91e9ba758b25208d776a0dc8cb05222268761..719405f4d501e8529c2219bc877ef22ce498e1ff 100644 (file)
@@ -140,7 +140,8 @@ public class StatisticsManagerImplTest {
         when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
         when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
         when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessagSpy);
-        when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(new DeviceFlowRegistryImpl(OFConstants.OFP_VERSION_1_3, dataBroker, nodePath));
+        when(mockedDeviceContext.getDeviceFlowRegistry())
+                .thenReturn(new DeviceFlowRegistryImpl(OFConstants.OFP_VERSION_1_3, dataBroker, nodePath));
         when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
         when(mockedDeviceContext.getMultiMsgCollector(
                 Matchers.<RequestContext<List<MultipartReply>>>any())).thenAnswer(
@@ -187,9 +188,9 @@ public class StatisticsManagerImplTest {
     }
 
     /**
-     * switching to {@link StatisticsWorkMode#FULLYDISABLED}; no pollTimeout and no lifecycleRegistry
+     * Switching to {@link StatisticsWorkMode#FULLYDISABLED}; no pollTimeout and no lifecycleRegistry.
      *
-     * @throws Exception
+     * @throws Exception if work mode change failed
      */
     @Test
     public void testChangeStatisticsWorkMode1() throws Exception {
@@ -214,16 +215,16 @@ public class StatisticsManagerImplTest {
         verify(statisticContext).stopGatheringData();
     }
 
-    private static void checkWorkModeChangeOutcome(Future<RpcResult<Void>> workMode) throws InterruptedException, ExecutionException {
+    private static void checkWorkModeChangeOutcome(Future<RpcResult<Void>> workMode)
+            throws InterruptedException, ExecutionException {
         Assert.assertTrue(workMode.isDone());
         Assert.assertTrue(workMode.get().isSuccessful());
     }
 
-
     /**
-     * switching to {@link StatisticsWorkMode#FULLYDISABLED}; with pollTimeout and lifecycleRegistry
+     * Switching to {@link StatisticsWorkMode#FULLYDISABLED}; with pollTimeout and lifecycleRegistry.
      *
-     * @throws Exception
+     * @throws Exception if work mode change failed
      */
     @Test
     public void testChangeStatisticsWorkMode2() throws Exception {
@@ -243,7 +244,8 @@ public class StatisticsManagerImplTest {
                 new ChangeStatisticsWorkModeInputBuilder()
                         .setMode(StatisticsWorkMode.FULLYDISABLED);
 
-        Future<RpcResult<Void>> workMode = statisticsManager.changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
+        Future<RpcResult<Void>> workMode =
+                statisticsManager.changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
         checkWorkModeChangeOutcome(workMode);
 
         verify(itemLifeCycleRegistry).getLifeCycleSources();
@@ -252,10 +254,10 @@ public class StatisticsManagerImplTest {
     }
 
     /**
-     * switching to {@link StatisticsWorkMode#FULLYDISABLED} and back
-     * to {@link StatisticsWorkMode#COLLECTALL}; with lifecycleRegistry and pollTimeout
+     * Switching to {@link StatisticsWorkMode#FULLYDISABLED} and back
+     * to {@link StatisticsWorkMode#COLLECTALL}; with lifecycleRegistry and pollTimeout.
      *
-     * @throws Exception
+     * @throws Exception if work mode change failed
      */
     @Test
     public void testChangeStatisticsWorkMode3() throws Exception {
@@ -320,21 +322,37 @@ public class StatisticsManagerImplTest {
         final StatisticsContext statisticsContext = Mockito.mock(StatisticsContext.class);
         final TimeCounter mockTimerCounter = Mockito.mock(TimeCounter.class);
 
-        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(), statisticsContext, mockTimerCounter, mockedDeviceInfo);
+        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(),
+                                         statisticsContext,
+                                         mockTimerCounter,
+                                         mockedDeviceInfo);
         verify(mockedDeviceContext).getDeviceState();
 
-        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(), statisticsContext, mockTimerCounter, mockedDeviceInfo);
+        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(),
+                                         statisticsContext,
+                                         mockTimerCounter,
+                                         mockedDeviceInfo);
 
-        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(), statisticsContext, mockTimerCounter, mockedDeviceInfo);
+        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(),
+                                         statisticsContext,
+                                         mockTimerCounter,
+                                         mockedDeviceInfo);
 
         when(statisticsContext.gatherDynamicData()).thenReturn(Futures.immediateCheckedFuture(Boolean.TRUE));
         when(statisticsContext.isSchedulingEnabled()).thenReturn(Boolean.TRUE);
-        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(), statisticsContext, mockTimerCounter, mockedDeviceInfo);
+        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(),
+                                                             statisticsContext,
+                                                             mockTimerCounter,
+                                                             mockedDeviceInfo);
         verify(mockTimerCounter).markStart();
         verify(mockTimerCounter).addTimeMark();
 
-        when(statisticsContext.gatherDynamicData()).thenReturn(Futures.immediateFailedFuture(new Throwable("error msg")));
-        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(), statisticsContext, mockTimerCounter, mockedDeviceInfo);
+        when(statisticsContext.gatherDynamicData())
+                .thenReturn(Futures.immediateFailedFuture(new Throwable("error msg")));
+        statisticsManager.pollStatistics(mockedDeviceContext.getDeviceState(),
+                        statisticsContext,
+                        mockTimerCounter,
+                        mockedDeviceInfo);
         verify(mockTimerCounter,times(2)).addTimeMark();
     }
 
index eac02f2c9faafc0cc4a2cbb4674e8d19c299898c..1c4a9ff5ee30e9a9d30c17f80365aae44a5d584a 100644 (file)
@@ -32,15 +32,13 @@ public class TimeCounterTest {
      * - tm1 at time 2 ms
      * - tm2 at time 4 ms
      * - tm3 at time 9 ms
-     *
      * awaited average time:
      * - tm1 = 2/1 = 2 ms
      * - tm2 = 4/2 = 2 ms
      * - tm3 = 9/3 = 3 ms
-     *
      * But this times are only theoretical if whole test is executed without latency and atomically. Therefore awaited
      * average times can't be compared to exact values of awaited average time (therefore == was replaced with >=)
-     * @throws Exception
+     * @throws Exception if interrupted
      */
     @Test
     public void testGetAverageTimeBetweenMarks() throws Exception {
index f4f40519049e96f366bf227b9375e492f2d420e7..8fa122c8c4ff56a811267db1e5dcfb215853e712 100644 (file)
@@ -22,12 +22,14 @@ public class MessageIntelligenceAgencyImplTest {
         messageIntelligenceAgency.spyMessage(String.class, MessageSpy.StatisticsGroup.FROM_SWITCH);
         messageIntelligenceAgency.spyMessage(Integer.class, MessageSpy.StatisticsGroup.TO_SWITCH_ENTERED);
         final List<String> intelligence = messageIntelligenceAgency.provideIntelligence();
-        findExpectedStatistics(intelligence, "FROM_SWITCH: MSG[String] -> +1 | 1", "TO_SWITCH_ENTERED: MSG[Integer] -> +1 | 1");
+        findExpectedStatistics(intelligence,
+                "FROM_SWITCH: MSG[String] -> +1 | 1", "TO_SWITCH_ENTERED: MSG[Integer] -> +1 | 1");
     }
 
     private void findExpectedStatistics(final List<String> statisticsInfo, String ... expectedValues) {
         for (String expectedValue : expectedValues) {
-            assertTrue("Expected value " + expectedValue + "wasn't found.", findValueInStatistics(statisticsInfo, expectedValue));
+            assertTrue("Expected value " + expectedValue + "wasn't found.",
+                    findValueInStatistics(statisticsInfo, expectedValue));
         }
     }
 
@@ -39,6 +41,4 @@ public class MessageIntelligenceAgencyImplTest {
         }
         return false;
     }
-
-
 }
index 7cb1ab1a15558224b233eb514c93b9c0e8c27a1e..0a7e621fbb00ca8188fd3451bc61d749c4905966 100644 (file)
@@ -19,9 +19,6 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Event
 import org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-/**
- * Created by mirehak on 9/9/15.
- */
 public abstract class AbstractSingleStatsServiceTest extends AbstractStatsServiceTest {
 
     @Mock
@@ -51,6 +48,7 @@ public abstract class AbstractSingleStatsServiceTest extends AbstractStatsServic
 
         Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
         Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
-        Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
+        Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector)
+                .endCollecting(Matchers.any(EventIdentifier.class));
     }
 }
index cb50942d19d2bff4a5f6f0b64c71fa5eecd157d3..60feae5fa6e1f7a3e79da5e8875fdb4e2ca5658a 100644 (file)
@@ -83,7 +83,8 @@ public abstract class AbstractStatsServiceTest {
     public void init() throws Exception {
         Mockito.when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
         Mockito.when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
-        Mockito.when(deviceContext.getMultiMsgCollector(Matchers.any(RequestContext.class))).thenReturn(multiMsgCollector);
+        Mockito.when(deviceContext.getMultiMsgCollector(Matchers.any(RequestContext.class)))
+                .thenReturn(multiMsgCollector);
         Mockito.when(deviceContext.oook()).thenReturn(translatorLibrary);
         Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
         Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
index 009ff0de2f938de3391f35978fa8e8052dc2af8c..b03c2a5ebe4053f2c13df65fd56dc603a590c697 100644 (file)
@@ -26,7 +26,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Table
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
- * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only delegated methods (failing)
+ * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only delegated methods (failing).
  */
 public class OpendaylightFlowStatisticsServiceImpl1Test extends AbstractStatsServiceTest {
 
@@ -39,7 +39,8 @@ public class OpendaylightFlowStatisticsServiceImpl1Test extends AbstractStatsSer
 
     public void setUp() {
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
-        flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
+        flowStatisticsService =
+                OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
 
         rqContext = new AbstractRequestContext<Object>(42L) {
             @Override
@@ -52,7 +53,8 @@ public class OpendaylightFlowStatisticsServiceImpl1Test extends AbstractStatsSer
 
     @Test(expected = IllegalAccessError.class)
     public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() throws Exception {
-        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input = new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
+        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input =
+                new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
                 .setNode(createNodeRef("unitProt:123"))
                 .setTableId(new TableId((short) 1));
 
@@ -70,7 +72,8 @@ public class OpendaylightFlowStatisticsServiceImpl1Test extends AbstractStatsSer
 
     @Test(expected = IllegalAccessError.class)
     public void testGetAllFlowsStatisticsFromAllFlowTables() throws Exception {
-        GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input = new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
+        GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input =
+                new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
                 .setNode(createNodeRef("unitProt:123"));
 
         flowStatisticsService.getAllFlowsStatisticsFromAllFlowTables(input.build());
index 3f093b0387335fcdb4a59c35baeb2e5393538973..1ca253f541ab18ae2535de0ae088cecec5ccd781 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only not delegated method
+ * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only not delegated method.
  */
 public class OpendaylightFlowStatisticsServiceImpl2Test extends AbstractStatsServiceTest {
 
@@ -56,7 +56,9 @@ public class OpendaylightFlowStatisticsServiceImpl2Test extends AbstractStatsSer
 
     public void setUp() {
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
-        flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
+        flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack,
+                                                                                     deviceContext,
+                                                                                     convertorManager);
 
         rqContextMp = new AbstractRequestContext<List<MultipartReply>>(42L) {
             @Override
@@ -65,7 +67,8 @@ public class OpendaylightFlowStatisticsServiceImpl2Test extends AbstractStatsSer
             }
         };
         Mockito.when(rqContextStack.<List<MultipartReply>>createRequestContext()).thenReturn(rqContextMp);
-        Mockito.when(translatorLibrary.<MultipartReply, AggregatedFlowStatistics>lookupTranslator(Matchers.any(TranslatorKey.class)))
+        Mockito.when(translatorLibrary
+                .<MultipartReply, AggregatedFlowStatistics>lookupTranslator(Matchers.any(TranslatorKey.class)))
                 .thenReturn(translator);
     }
 
@@ -74,21 +77,21 @@ public class OpendaylightFlowStatisticsServiceImpl2Test extends AbstractStatsSer
         Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
                 .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
         Mockito.doAnswer(new Answer<Void>() {
-                             @Override
-                             public Void answer(InvocationOnMock invocation) throws Throwable {
-                                 final MultipartReplyMessageBuilder messageBuilder = new MultipartReplyMessageBuilder()
-                                         .setVersion(OFConstants.OFP_VERSION_1_3);
-                                 rqContextMp.setResult(RpcResultBuilder.success(
-                                         Collections.<MultipartReply>singletonList(messageBuilder.build())).build());
-                                 return null;
-                             }
-                         }
-        ).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
+            @Override
+            public Void answer(InvocationOnMock invocation) throws Throwable {
+                final MultipartReplyMessageBuilder messageBuilder = new MultipartReplyMessageBuilder()
+                        .setVersion(OFConstants.OFP_VERSION_1_3);
+
+                rqContextMp.setResult(RpcResultBuilder
+                        .success(Collections.<MultipartReply>singletonList(messageBuilder.build()))
+                        .build());
+                return null;
+            }
+        }).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
         Mockito.when(translator.translate(
                         Matchers.any(MultipartReply.class), Matchers.same(deviceInfo), Matchers.isNull())
         ).thenReturn(new AggregatedFlowStatisticsBuilder().build());
 
-
         GetAggregateFlowStatisticsFromFlowTableForGivenMatchInputBuilder input =
                 new GetAggregateFlowStatisticsFromFlowTableForGivenMatchInputBuilder()
                         .setNode(createNodeRef("unitProt:123"))
@@ -104,6 +107,4 @@ public class OpendaylightFlowStatisticsServiceImpl2Test extends AbstractStatsSer
         Assert.assertEquals(1, rpcResult.getResult().getAggregatedFlowStatistics().size());
         Assert.assertEquals(MultipartType.OFPMPAGGREGATE, requestInput.getValue().getType());
     }
-
-
 }
\ No newline at end of file
index b565c379a61438d48cfa4ae1032af2e572dc1d16..bfc1fb19bf8620e17592904fcce5df5f96cda67c 100644 (file)
@@ -25,7 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.O
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
 
 /**
- * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only delegated methods
+ * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only delegated methods.
  */
 public class OpendaylightFlowStatisticsServiceImpl3Test extends AbstractStatsServiceTest {
 
@@ -36,13 +36,15 @@ public class OpendaylightFlowStatisticsServiceImpl3Test extends AbstractStatsSer
 
     public void setUp() {
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
-        flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
+        flowStatisticsService =
+                OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
         flowStatisticsService.setDelegate(flowStatisticsDelegate);
     }
 
     @Test
     public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() throws Exception {
-        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input = new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
+        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input =
+                new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
                 .setNode(createNodeRef("unitProt:123"))
                 .setTableId(new TableId((short) 1))
                 .build();
index 9993ab3e50a28878e445634af3dd7e1d11333b6f..339bdbf76a60932c3c6bec77c17ccccddb15daed 100644 (file)
@@ -36,7 +36,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * Test for {@link OpendaylightFlowTableStatisticsServiceImpl}
+ * Test for {@link OpendaylightFlowTableStatisticsServiceImpl}.
  */
 public class OpendaylightFlowTableStatisticsServiceImplTest extends AbstractSingleStatsServiceTest {
 
@@ -100,7 +100,8 @@ public class OpendaylightFlowTableStatisticsServiceImplTest extends AbstractSing
         final MultipartRequestInput mpRequest = (MultipartRequestInput) request;
         Assert.assertEquals(MultipartType.OFPMPTABLE, mpRequest.getType());
         Assert.assertTrue(mpRequest.getMultipartRequestBody() instanceof MultipartRequestTableCase);
-        final MultipartRequestTableCase mpRequestBody = (MultipartRequestTableCase) (mpRequest.getMultipartRequestBody());
+        final MultipartRequestTableCase mpRequestBody =
+                (MultipartRequestTableCase) (mpRequest.getMultipartRequestBody());
         Assert.assertTrue(mpRequestBody.getMultipartRequestTable().isEmpty());
     }
 }
\ No newline at end of file
index 9357d2cd787e5ad43d1e6cead5f1e5c4688b2c68..14c27461dc5e4c7ad19ab42d472a99e39428832a 100644 (file)
@@ -55,11 +55,12 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * Test for {@link OpendaylightGroupStatisticsServiceImpl}
+ * Test for {@link OpendaylightGroupStatisticsServiceImpl}.
  */
 public class OpendaylightGroupStatisticsServiceImplTest extends AbstractSingleStatsServiceTest {
 
-    private static final org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId GROUP_ID =
+    private static final org.opendaylight.yang.gen.v1.urn
+            .opendaylight.openflow.common.types.rev130731.GroupId GROUP_ID =
             new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId(123L);
     @Captor
     private ArgumentCaptor<MultipartRequestInput> requestInput;
index 04e5c85a911b22f17db2396c8de75ec3cdba565e..6c7be87d08344e956b84aaa687cc2786c6913da9 100644 (file)
@@ -55,11 +55,13 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * Test for {@link OpendaylightMeterStatisticsServiceImpl}
+ * Test for {@link OpendaylightMeterStatisticsServiceImpl}.
  */
 public class OpendaylightMeterStatisticsServiceImplTest extends AbstractSingleStatsServiceTest {
 
-    private static final org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId METER_ID = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId(123L);
+    private static final org.opendaylight.yang.gen.v1.urn
+                .opendaylight.openflow.common.types.rev130731.MeterId METER_ID =
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId(123L);
     @Captor
     private ArgumentCaptor<MultipartRequestInput> requestInput;
 
index 7aa587f32111e399afe51199aa38652545dbaee9..f305799a09f0453fb3efec3cccac0d834d50acf2 100644 (file)
@@ -37,7 +37,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * Test for {@link OpendaylightPortStatisticsServiceImpl}
+ * Test for {@link OpendaylightPortStatisticsServiceImpl}.
  */
 public class OpendaylightPortStatisticsServiceImplTest extends AbstractSingleStatsServiceTest {
 
index 64a892c025cd9cfaa3626cd9736da68f25b9765e..ab35849fb927807e1d510c14696692b3910515f5 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * Test for {@link OpendaylightQueueStatisticsServiceImpl}
+ * Test for {@link OpendaylightQueueStatisticsServiceImpl}.
  */
 public class OpendaylightQueueStatisticsServiceImplTest extends AbstractSingleStatsServiceTest {
 
index 842eac18cbd8c12fb65aa11beefb6e0e8c054522..80a8b4f4a2f8924ca25089a8866dd5a9b3ea1f9a 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInputBuilder;
 
 /**
- * Test of {@link PortStatsService}
+ * Test of {@link PortStatsService}.
  */
 public class PortStatsServiceTest extends AbstractStatsServiceTest {
 
@@ -42,7 +42,8 @@ public class PortStatsServiceTest extends AbstractStatsServiceTest {
         Assert.assertTrue(request instanceof MultipartRequestInput);
         final MultipartRequestInput mpRequest = (MultipartRequestInput) request;
         Assert.assertTrue(mpRequest.getMultipartRequestBody() instanceof MultipartRequestPortStatsCase);
-        final MultipartRequestPortStatsCase mpRequestBody = (MultipartRequestPortStatsCase) mpRequest.getMultipartRequestBody();
+        final MultipartRequestPortStatsCase mpRequestBody =
+                (MultipartRequestPortStatsCase) mpRequest.getMultipartRequestBody();
         Assert.assertEquals(12L, mpRequestBody.getMultipartRequestPortStats().getPortNo().longValue());
 
     }
index b208416adff64f95d83fd9e4a44f96710703f7e7..80e5bac38d70683cd5dc5d11d4ac799caf3fc277 100644 (file)
@@ -102,7 +102,8 @@ public class AbstractCompatibleStatServiceTest extends AbstractStatsServiceTest
         Mockito.when(deviceInfo.getNodeId()).thenReturn(NODE_ID);
         Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
         Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
-        Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
+        Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector)
+                .endCollecting(Matchers.any(EventIdentifier.class));
 
         Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
                 .commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
@@ -154,7 +155,7 @@ public class AbstractCompatibleStatServiceTest extends AbstractStatsServiceTest
         final RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput> rpcResult = resultFuture.get();
         Assert.assertTrue(rpcResult.isSuccessful());
         Assert.assertEquals(MultipartType.OFPMPAGGREGATE, requestInput.getValue().getType());
-        Mockito.verify(notificationPublishService, Mockito.timeout(500)).offerNotification(Matchers.any(AggregateFlowStatisticsUpdate.class));
+        Mockito.verify(notificationPublishService, Mockito.timeout(500))
+                .offerNotification(Matchers.any(AggregateFlowStatisticsUpdate.class));
     }
-
 }
index 86fcdaa9a195f27ee14f2bc7289894a3667ff33f..c26b9d060c06eaa54e5a0fc03356a660317d34c3 100644 (file)
@@ -94,7 +94,8 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
 
     @Test
     public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() throws Exception {
-        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input = new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
+        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input =
+                new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
                 .setNode(createNodeRef("unitProt:123"))
                 .setTableId(new TableId((short) 1));
 
@@ -123,11 +124,13 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
                 = flowStatisticsServiceDelegate.getAggregateFlowStatisticsFromFlowTableForAllFlows(input.build());
 
         Assert.assertTrue(resultFuture.isDone());
-        final RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput> rpcResultCompatible = resultFuture.get();
+        final RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput> rpcResultCompatible =
+                resultFuture.get();
         Assert.assertTrue(rpcResultCompatible.isSuccessful());
         Assert.assertEquals(MultipartType.OFPMPAGGREGATE, requestInput.getValue().getType());
 
-        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS)).offerNotification(Matchers.any(Notification.class));
+        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
+                .offerNotification(Matchers.any(Notification.class));
     }
 
     @Test
@@ -146,7 +149,8 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
         Assert.assertTrue(rpcResultCompatible.isSuccessful());
         Assert.assertEquals(MultipartType.OFPMPFLOW, requestInput.getValue().getType());
 
-        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS)).offerNotification(Matchers.any(Notification.class));
+        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
+                .offerNotification(Matchers.any(Notification.class));
     }
 
     private static RpcResult<Object> buildFlowStatsReply() {
@@ -175,7 +179,8 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
                                                         .setApplyActions(new ApplyActionsBuilder()
                                                                 .setAction(Collections.singletonList(new ActionBuilder()
                                                                         .setActionChoice(new OutputActionCaseBuilder()
-                                                                                .setOutputAction(new OutputActionBuilder()
+                                                                                .setOutputAction(
+                                                                                        new OutputActionBuilder()
                                                                                         .setMaxLength(17)
                                                                                         .setPort(new PortNumber(18L))
                                                                                         .build())
@@ -193,7 +198,8 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
 
     @Test
     public void testGetAllFlowsStatisticsFromAllFlowTables() throws Exception {
-        GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input = new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
+        GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input =
+                new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
                 .setNode(createNodeRef("unitProt:123"));
 
         rpcResult = buildFlowStatsReply();
@@ -206,7 +212,8 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
         Assert.assertTrue(rpcResultCompatible.isSuccessful());
         Assert.assertEquals(MultipartType.OFPMPFLOW, requestInput.getValue().getType());
 
-        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS)).offerNotification(Matchers.any(Notification.class));
+        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
+                .offerNotification(Matchers.any(Notification.class));
     }
 
     @Test
@@ -227,6 +234,7 @@ public class OpendaylightFlowStatisticsServiceDelegateImplTest extends AbstractS
         Assert.assertTrue(rpcResultCompatible.isSuccessful());
         Assert.assertEquals(MultipartType.OFPMPFLOW, requestInput.getValue().getType());
 
-        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS)).offerNotification(Matchers.any(Notification.class));
+        Mockito.verify(notificationPublishService, Mockito.timeout(NOTIFICATION_WAIT_TIMEOUT_MS))
+                .offerNotification(Matchers.any(Notification.class));
     }
 }
index 905f8a2c88a0ad515aeff48b51c32b586ba63778..10f42edfa8e85a8447a3a3a981700c2486bd1c9c 100644 (file)
@@ -34,7 +34,12 @@ public class StatisticsGatheringOnTheFlyServiceTest extends ServiceMocking {
     @Override
     protected void setup() {
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
-        statisticsGatheringService = new StatisticsGatheringOnTheFlyService<>(mockedRequestContextStack, mockedDeviceContext, convertorManager, MultipartWriterProviderFactory.createDefaultProvider(mockedDeviceContext));
+        statisticsGatheringService =
+                new StatisticsGatheringOnTheFlyService<>(mockedRequestContextStack,
+                                                         mockedDeviceContext,
+                                                         convertorManager,
+                                                         MultipartWriterProviderFactory
+                                                                 .createDefaultProvider(mockedDeviceContext));
         Mockito.doReturn(NODE_ID).when(mockedPrimConnectionContext).getNodeId();
         Mockito.when(mockedDeviceInfo.getNodeId()).thenReturn(NODE_ID);
         Mockito.when(mockedDeviceContext.getDeviceInfo().getNodeId()).thenReturn(NODE_ID);
index eee08fe61d4dbe276a25802030e2e08d5e6e655a..4a7a65e9e08b8efdd475d0fbab4df4ac5624abf3 100644 (file)
@@ -78,6 +78,7 @@ public abstract class AbstractDirectStatisticsServiceTest {
     protected KeyedInstanceIdentifier<Node, NodeKey> nodeInstanceIdentifier;
     protected ConvertorManager convertorManager;
     protected MultipartWriterProvider multipartWriterProvider;
+
     protected static NodeRef createNodeRef(String nodeIdValue) {
         InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, new NodeKey(new NodeId(nodeIdValue)));
index 75465fabf4248e779675d680e5e19e5568192ab4..3ef1d20474f5f4e4c6825baee1c893ed64b86167 100644 (file)
@@ -48,7 +48,10 @@ public class FlowDirectStatisticsServiceTest extends AbstractDirectStatisticsSer
 
     @Override
     public void setUp() throws Exception {
-        service = new FlowDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new FlowDirectStatisticsService(requestContextStack,
+                                                  deviceContext,
+                                                  convertorManager,
+                                                  multipartWriterProvider);
         final DeviceFlowRegistry registry = mock(DeviceFlowRegistry.class);
         when(registry.retrieveDescriptor(any())).thenReturn(FlowDescriptorFactory.create(TABLE_NO, new FlowId("1")));
         when(deviceContext.getDeviceFlowRegistry()).thenReturn(registry);
@@ -82,7 +85,8 @@ public class FlowDirectStatisticsServiceTest extends AbstractDirectStatisticsSer
                 .setByteCount(BigInteger.ONE)
                 .setPacketCount(BigInteger.ONE)
                 .setFlags(mock(FlowModFlags.class))
-                .setMatch(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder()
+                .setMatch(new org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder()
                         .setMatchEntry(Collections.emptyList())
                         .build())
                 .build();
index 1298013cc215bd0eed8442081355f2f3cd848931..4547b2645a4b27a15ad0003e3d586baff3328808 100644 (file)
@@ -42,7 +42,10 @@ public class GroupDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void setUp() throws Exception {
-        service = new GroupDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new GroupDirectStatisticsService(requestContextStack,
+                                                   deviceContext,
+                                                   convertorManager,
+                                                   multipartWriterProvider);
     }
 
     @Override
@@ -67,7 +70,8 @@ public class GroupDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
         final MultipartReplyGroupCase groupCase = mock(MultipartReplyGroupCase.class);
         final MultipartReplyGroup group = mock(MultipartReplyGroup.class);
         final GroupStats groupStat = new GroupStatsBuilder()
-                .setGroupId(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId(GROUP_NO))
+                .setGroupId(new org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.openflow.common.types.rev130731.GroupId(GROUP_NO))
                 .setByteCount(BigInteger.ONE)
                 .setPacketCount(BigInteger.ONE)
                 .setBucketStats(Collections.emptyList())
@@ -86,18 +90,22 @@ public class GroupDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
         final GetGroupStatisticsOutput output = service.buildReply(input, true);
         assertTrue(output.getGroupStats().size() > 0);
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stats =
-                output.getGroupStats().get(0);
+        final org.opendaylight.yang.gen.v1.urn
+            .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stats = output.getGroupStats().get(0);
 
         assertEquals(stats.getGroupId().getValue(), GROUP_NO);
     }
 
     @Override
     public void testStoreStatistics() throws Exception {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stat = mock(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats.class);
+        final org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stat =
+                mock(org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats.class);
         when(stat.getGroupId()).thenReturn(new GroupId(GROUP_NO));
 
-        final List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> stats = Arrays.asList(stat);
+        final List<org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> stats = Arrays.asList(stat);
         final GetGroupStatisticsOutput output = mock(GetGroupStatisticsOutput.class);
         when(output.getGroupStats()).thenReturn(stats);
 
index f9889ebafe8f2b575f73b1b589a92594835357d0..f361d509b3697597c4c8df4dcab089a7e7bbe66a 100644 (file)
@@ -42,7 +42,10 @@ public class MeterDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void setUp() throws Exception {
-        service = new MeterDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new MeterDirectStatisticsService(requestContextStack,
+                                                   deviceContext,
+                                                   convertorManager,
+                                                   multipartWriterProvider);
     }
 
     @Override
@@ -67,7 +70,8 @@ public class MeterDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
         final MultipartReplyMeterCase MeterCase = mock(MultipartReplyMeterCase.class);
         final MultipartReplyMeter meter = mock(MultipartReplyMeter.class);
         final MeterStats meterStat = new MeterStatsBuilder()
-                .setMeterId(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId(METER_NO))
+                .setMeterId(new org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.openflow.common.types.rev130731.MeterId(METER_NO))
                 .setByteInCount(BigInteger.ONE)
                 .setPacketInCount(BigInteger.ONE)
                 .setDurationSec(1L)
@@ -86,18 +90,22 @@ public class MeterDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
         final GetMeterStatisticsOutput output = service.buildReply(input, true);
         assertTrue(output.getMeterStats().size() > 0);
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stats =
-                output.getMeterStats().get(0);
+        final org.opendaylight.yang.gen.v1.urn
+            .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stats = output.getMeterStats().get(0);
 
         assertEquals(stats.getMeterId().getValue(), METER_NO);
     }
 
     @Override
     public void testStoreStatistics() throws Exception {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stat = mock(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats.class);
+        final org.opendaylight.yang.gen.v1.urn
+                .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stat =
+                mock(org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats.class);
         when(stat.getMeterId()).thenReturn(new MeterId(METER_NO));
 
-        final List<org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats> stats = Arrays.asList(stat);
+        final List<org.opendaylight.yang.gen.v1.urn
+                .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats> stats = Arrays.asList(stat);
         final GetMeterStatisticsOutput output = mock(GetMeterStatisticsOutput.class);
         when(output.getMeterStats()).thenReturn(stats);
 
index 1851e5a1ed91cc7ba940549d48663470553f27c5..6969ce96a3334245efe7e8acc419ce58907754d7 100644 (file)
@@ -39,7 +39,10 @@ public class NodeConnectorDirectStatisticsServiceTest extends AbstractDirectStat
 
     @Override
     public void setUp() throws Exception {
-        service = new PortDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new PortDirectStatisticsService(requestContextStack,
+                                                  deviceContext,
+                                                  convertorManager,
+                                                  multipartWriterProvider);
     }
 
     @Override
index 726ae742084c253daf053d87f533307af07818bb..07ef4d5cbd587602ba178e885d31dbc33b98abfe 100644 (file)
@@ -42,7 +42,10 @@ public class QueueDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void setUp() throws Exception {
-        service = new QueueDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new QueueDirectStatisticsService(requestContextStack,
+                                                   deviceContext,
+                                                   convertorManager,
+                                                   multipartWriterProvider);
     }
 
     @Override
index 0abec39cdecfd7ef3e8559cd261126db5863f70b..8035dc93e98b1fec244b835a5fdd6b65fe6f0100 100644 (file)
@@ -49,7 +49,10 @@ public class FlowDirectStatisticsServiceTest extends AbstractDirectStatisticsSer
 
     @Override
     public void setUp() throws Exception {
-        service = new FlowDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new FlowDirectStatisticsService(requestContextStack,
+                                                  deviceContext,
+                                                  convertorManager,
+                                                  multipartWriterProvider);
         final DeviceFlowRegistry registry = mock(DeviceFlowRegistry.class);
         when(registry.retrieveDescriptor(any())).thenReturn(FlowDescriptorFactory.create(TABLE_NO, new FlowId("1")));
         when(deviceContext.getDeviceFlowRegistry()).thenReturn(registry);
index caede136db0692ae15a0262127f27ead0ea854c6..adea301ea4a1a3b356b177bb22ebd4055574bb98 100644 (file)
@@ -40,7 +40,10 @@ public class GroupDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void setUp() throws Exception {
-        service = new GroupDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new GroupDirectStatisticsService(requestContextStack,
+                                                   deviceContext,
+                                                   convertorManager,
+                                                   multipartWriterProvider);
     }
 
     @Override
@@ -74,18 +77,22 @@ public class GroupDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
         final GetGroupStatisticsOutput output = service.buildReply(input, true);
         assertTrue(output.getGroupStats().size() > 0);
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stats =
-                output.getGroupStats().get(0);
+        final org.opendaylight.yang.gen.v1.urn
+            .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stats = output.getGroupStats().get(0);
 
         assertEquals(stats.getGroupId().getValue(), GROUP_NO);
     }
 
     @Override
     public void testStoreStatistics() throws Exception {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stat = mock(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats.class);
+        final org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stat =
+                mock(org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats.class);
         when(stat.getGroupId()).thenReturn(new GroupId(GROUP_NO));
 
-        final List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> stats = Arrays.asList(stat);
+        final List<org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.group.statistics.reply.GroupStats> stats = Arrays.asList(stat);
         final GetGroupStatisticsOutput output = mock(GetGroupStatisticsOutput.class);
         when(output.getGroupStats()).thenReturn(stats);
 
index ecb92b74ae7d4367525acef8b13bdb6d44ce2f01..64672443786f01e465bed2177be78b879f19f204 100644 (file)
@@ -45,7 +45,10 @@ public class MeterDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void setUp() throws Exception {
-        service = new MeterDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new MeterDirectStatisticsService(requestContextStack,
+                                                   deviceContext,
+                                                   convertorManager,
+                                                   multipartWriterProvider);
     }
 
     @Override
@@ -93,10 +96,14 @@ public class MeterDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void testStoreStatistics() throws Exception {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stat = mock(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats.class);
+        final org.opendaylight.yang.gen.v1.urn
+                .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stat =
+                mock(org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats.class);
         when(stat.getMeterId()).thenReturn(new MeterId(METER_NO));
 
-        final List<org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats> stats = Arrays.asList(stat);
+        final List<org.opendaylight.yang.gen.v1.urn
+                .opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats> stats = Arrays.asList(stat);
         final GetMeterStatisticsOutput output = mock(GetMeterStatisticsOutput.class);
         when(output.getMeterStats()).thenReturn(stats);
 
index fd501ace2161e2862103a74fa021ff8d229fd06a..2ced51a7218bb4112ab54613ffddad6b3bf15694 100644 (file)
@@ -38,7 +38,10 @@ public class NodeConnectorDirectStatisticsServiceTest extends AbstractDirectStat
 
     @Override
     public void setUp() throws Exception {
-        service = new PortDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new PortDirectStatisticsService(requestContextStack,
+                                                  deviceContext,
+                                                  convertorManager,
+                                                  multipartWriterProvider);
     }
 
     @Override
index 4e32c092db2545c564ceaaee2eb779570bef86fc..33026c116c9b3528aed2db1c9edf0af4c1181403 100644 (file)
@@ -43,7 +43,10 @@ public class QueueDirectStatisticsServiceTest extends AbstractDirectStatisticsSe
 
     @Override
     public void setUp() throws Exception {
-        service = new QueueDirectStatisticsService(requestContextStack, deviceContext, convertorManager, multipartWriterProvider);
+        service = new QueueDirectStatisticsService(requestContextStack,
+                                                   deviceContext,
+                                                   convertorManager,
+                                                   multipartWriterProvider);
     }
 
     @Override