Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / GetGroupStatisticsImpl.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.impl.statistics.services;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.concurrent.atomic.AtomicLong;
12 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
13 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
14 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
15 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupStatistics;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupStatisticsInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupStatisticsOutput;
19 import org.opendaylight.yangtools.yang.common.RpcResult;
20
21 @Deprecated
22 public final class GetGroupStatisticsImpl implements GetGroupStatistics {
23     private final GroupStatsService groupStats;
24     private final NotificationPublishService notificationPublishService;
25
26     public GetGroupStatisticsImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
27             final AtomicLong compatibilityXidSeed, final NotificationPublishService notificationPublishService,
28             final ConvertorExecutor convertorExecutor) {
29         this.notificationPublishService = notificationPublishService;
30         groupStats = new GroupStatsService(requestContextStack, deviceContext, compatibilityXidSeed, convertorExecutor);
31     }
32
33     @Override
34     public ListenableFuture<RpcResult<GetGroupStatisticsOutput>> invoke(final GetGroupStatisticsInput input) {
35         return groupStats.handleAndNotify(input, notificationPublishService);
36     }
37 }