Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / GetAllGroupStatisticsImpl.java
1 /*
2  * Copyright (c) 2024 PANTHEON.tech, s.r.o. 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.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
14 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
15 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
16 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatistics;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInput;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutput;
20 import org.opendaylight.yangtools.yang.common.RpcResult;
21
22 @Deprecated
23 public final class GetAllGroupStatisticsImpl implements GetAllGroupStatistics {
24     private final NotificationPublishService notificationPublishService;
25     private final @NonNull AllGroupsStatsService allGroups;
26
27     public GetAllGroupStatisticsImpl(final RequestContextStack requestContextStack,
28             final DeviceContext deviceContext, final AtomicLong compatibilityXidSeed,
29             final NotificationPublishService notificationPublishService, final ConvertorExecutor convertorExecutor) {
30         this.notificationPublishService = notificationPublishService;
31         allGroups = new AllGroupsStatsService(requestContextStack, deviceContext, compatibilityXidSeed,
32             convertorExecutor);
33     }
34
35     @Override
36     public ListenableFuture<RpcResult<GetAllGroupStatisticsOutput>> invoke(final GetAllGroupStatisticsInput input) {
37         return allGroups.handleAndNotify(input, notificationPublishService);
38     }
39 }