+ private ListenableFuture<Boolean> collectPortStatistics(final MultipartType multipartType) {
+ return devState.isPortStatisticsAvailable() ? StatisticsGatheringUtils.gatherStatistics(
+ statisticsGatheringService,
+ deviceContext.getDeviceInfo(),
+ /*MultipartType.OFPMPPORTSTATS*/ multipartType,
+ deviceContext,
+ deviceContext,
+ devState) : emptyFuture;
+ }
+
+ private ListenableFuture<Boolean> collectQueueStatistics(final MultipartType multipartType) {
+ return !devState.isQueueStatisticsAvailable() ? emptyFuture : StatisticsGatheringUtils.gatherStatistics(
+ statisticsGatheringService,
+ deviceContext.getDeviceInfo(),
+ /*MultipartType.OFPMPQUEUE*/ multipartType,
+ deviceContext,
+ deviceContext,
+ devState);
+ }
+
+ private ListenableFuture<Boolean> collectGroupDescStatistics(final MultipartType multipartType) {
+ return devState.isGroupAvailable() ? StatisticsGatheringUtils.gatherStatistics(
+ statisticsGatheringService,
+ deviceContext.getDeviceInfo(),
+ /*MultipartType.OFPMPGROUPDESC*/ multipartType,
+ deviceContext,
+ deviceContext,
+ devState) : emptyFuture;
+ }
+
+ private ListenableFuture<Boolean> collectGroupStatistics(final MultipartType multipartType) {
+ return devState.isGroupAvailable() ? StatisticsGatheringUtils.gatherStatistics(
+ statisticsGatheringService,
+ deviceContext.getDeviceInfo(),
+ /*MultipartType.OFPMPGROUP*/ multipartType,
+ deviceContext,
+ deviceContext,
+ devState) : emptyFuture;
+ }
+
+ private ListenableFuture<Boolean> collectMeterConfigStatistics(final MultipartType multipartType) {
+ return devState.isMetersAvailable() ? StatisticsGatheringUtils.gatherStatistics(
+ statisticsGatheringService,
+ deviceContext.getDeviceInfo(),
+ /*MultipartType.OFPMPMETERCONFIG*/ multipartType,
+ deviceContext,
+ deviceContext,
+ devState) : emptyFuture;
+ }
+
+ private ListenableFuture<Boolean> collectMeterStatistics(final MultipartType multipartType) {
+ return devState.isMetersAvailable() ? StatisticsGatheringUtils.gatherStatistics(
+ statisticsGatheringService,
+ deviceContext.getDeviceInfo(),
+ /*MultipartType.OFPMPMETER*/ multipartType,
+ deviceContext,
+ deviceContext,
+ devState) : emptyFuture;
+ }
+
+ @VisibleForTesting
+ void setStatisticsGatheringService(final StatisticsGatheringService statisticsGatheringService) {
+ this.statisticsGatheringService = statisticsGatheringService;
+ }
+
+ @VisibleForTesting
+ void setStatisticsGatheringOnTheFlyService(final StatisticsGatheringOnTheFlyService
+ statisticsGatheringOnTheFlyService) {
+ this.statisticsGatheringOnTheFlyService = statisticsGatheringOnTheFlyService;