X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2Fservices%2FOpendaylightFlowTableStatisticsServiceImpl.java;h=874346766d8dd95b6dfb797767ad52582b85615a;hb=cfe3a97837951ebbedb337dc988027f10c49f714;hp=0f8ea8ae8365a2b3823ef10a3f2ac324824d6c30;hpb=617a0726d931230945a8a8d28a6e34be39f56b16;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImpl.java index 0f8ea8ae83..874346766d 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImpl.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the @@ -7,11 +7,11 @@ */ package org.opendaylight.openflowplugin.impl.statistics.services; +import com.google.common.util.concurrent.ListenableFuture; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicLong; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; @@ -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 implements + AbstractCompatibleStatService implements OpendaylightFlowTableStatisticsService { private final NotificationPublishService notificationPublishService; @@ -56,7 +58,7 @@ public final class OpendaylightFlowTableStatisticsServiceImpl extends } @Override - public Future> getFlowTablesStatistics( + public ListenableFuture> getFlowTablesStatistics( final GetFlowTablesStatisticsInput input) { return handleAndNotify(input, 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 mpReplyList, TransactionId emulatedTxId) { + public FlowTableStatisticsUpdate transformToNotification(List mpReplyList, + TransactionId emulatedTxId) { FlowTableStatisticsUpdateBuilder notification = new FlowTableStatisticsUpdateBuilder(); notification.setId(getDeviceInfo().getNodeId()); notification.setMoreReplies(Boolean.FALSE); @@ -97,6 +101,7 @@ public final class OpendaylightFlowTableStatisticsServiceImpl extends MultipartReplyTable replyBody = caseBody.getMultipartReplyTable(); List swTablesStats = replyBody.getTableStats(); + //TODO: Duplicate code: look at MultiReplyTranslatorUtil method translateTable for (TableStats swTableStats : swTablesStats) { FlowTableAndStatisticsMapBuilder statisticsBuilder = new FlowTableAndStatisticsMapBuilder(); statisticsBuilder.setActiveFlows(new Counter32(swTableStats.getActiveCount()));