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