Remove unused routedRpcRegistration
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / OpendaylightGroupStatisticsServiceImpl.java
index 674063b5e01427193fb4d7bf76dc37c3e5c787c9..1f56925a9a8f1106f6891a5ff33c5e0212a472cb 100644 (file)
@@ -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,9 +7,12 @@
  */
 package org.opendaylight.openflowplugin.impl.statistics.services;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.concurrent.atomic.AtomicLong;
+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.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInput;
@@ -21,39 +24,49 @@ 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;
     private final GroupFeaturesService groupFeat;
     private final GroupStatsService groupStats;
+    private final NotificationPublishService notificationPublishService;
 
-    public OpendaylightGroupStatisticsServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
-        allGroups = new AllGroupsStatsService(requestContextStack, deviceContext);
-        groupDesc = new GroupDescriptionService(requestContextStack, deviceContext);
-        groupFeat = new GroupFeaturesService(requestContextStack, deviceContext);
-        groupStats = new GroupStatsService(requestContextStack, 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);
+        groupFeat = new GroupFeaturesService(requestContextStack, deviceContext, compatibilityXidSeed);
+        groupStats = new GroupStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
     }
 
     @Override
-    public Future<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(final GetAllGroupStatisticsInput input) {
-        return allGroups.handleServiceCall(input);
+    public ListenableFuture<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(
+            final GetAllGroupStatisticsInput input) {
+        return allGroups.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetGroupDescriptionOutput>> getGroupDescription(final GetGroupDescriptionInput input) {
-        return groupDesc.handleServiceCall(input);
+    public ListenableFuture<RpcResult<GetGroupDescriptionOutput>> getGroupDescription(
+            final GetGroupDescriptionInput input) {
+        return groupDesc.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetGroupFeaturesOutput>> getGroupFeatures(final GetGroupFeaturesInput input) {
-        return groupFeat.handleServiceCall(input);
+    public ListenableFuture<RpcResult<GetGroupFeaturesOutput>> getGroupFeatures(final GetGroupFeaturesInput input) {
+        return groupFeat.handleAndNotify(input, notificationPublishService);
     }
 
     @Override
-    public Future<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(final GetGroupStatisticsInput input) {
-        return groupStats.handleServiceCall(input);
+    public ListenableFuture<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(
+            final GetGroupStatisticsInput input) {
+        return groupStats.handleAndNotify(input, notificationPublishService);
     }
 }