- resultingFuture = Futures.immediateFailedFuture(new Throwable(errMsg));
- break;
- default:
- resultingFuture = Futures.immediateCheckedFuture(Boolean.TRUE);
- break;
- }
- return resultingFuture;
- }
- return null;
- }
-
- //TODO: Refactor twice sending deviceContext into gatheringStatistics
- private ListenableFuture<Boolean> collectFlowStatistics(final MultipartType multipartType, final boolean initial) {
- return devState.isFlowStatisticsAvailable() ? StatisticsGatheringUtils.gatherStatistics(
- statisticsGatheringOnTheFlyService,
- getDeviceInfo(),
- /*MultipartType.OFPMPFLOW*/ multipartType,
- deviceContext,
- deviceContext,
- initial, multipartReplyTranslator) : emptyFuture;
- }
-
- private ListenableFuture<Boolean> collectTableStatistics(final MultipartType multipartType) {
- return devState.isTableStatisticsAvailable() ? StatisticsGatheringUtils.gatherStatistics(
- statisticsGatheringService,
- getDeviceInfo(),
- /*MultipartType.OFPMPTABLE*/ multipartType,
- deviceContext,
- deviceContext,
- false, multipartReplyTranslator) : emptyFuture;
- }
-
- private ListenableFuture<Boolean> collectPortStatistics(final MultipartType multipartType) {
- return devState.isPortStatisticsAvailable() ? StatisticsGatheringUtils.gatherStatistics(
- statisticsGatheringService,
- getDeviceInfo(),
- /*MultipartType.OFPMPPORTSTATS*/ multipartType,
- deviceContext,
- deviceContext,
- false, multipartReplyTranslator) : emptyFuture;
- }
-
- private ListenableFuture<Boolean> collectQueueStatistics(final MultipartType multipartType) {
- return !devState.isQueueStatisticsAvailable() ? emptyFuture : StatisticsGatheringUtils.gatherStatistics(
- statisticsGatheringService,
- getDeviceInfo(),
- /*MultipartType.OFPMPQUEUE*/ multipartType,
- deviceContext,
- deviceContext,
- false, multipartReplyTranslator);
- }