Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / compatibility / GetAggregateFlowStatisticsFromFlowTableForAllFlowsImpl.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.compatibility;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.google.common.util.concurrent.ListenableFuture;
13 import java.util.concurrent.atomic.AtomicLong;
14 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
15 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
16 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
17 import org.opendaylight.openflowplugin.impl.statistics.services.AggregateFlowsInTableService;
18 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlows;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput;
22 import org.opendaylight.yangtools.yang.common.RpcResult;
23
24 @Deprecated
25 public final class GetAggregateFlowStatisticsFromFlowTableForAllFlowsImpl
26         implements GetAggregateFlowStatisticsFromFlowTableForAllFlows {
27     private final AggregateFlowsInTableService aggregateFlowsInTable;
28     private final NotificationPublishService notificationService;
29
30     public GetAggregateFlowStatisticsFromFlowTableForAllFlowsImpl(final RequestContextStack requestContextStack,
31             final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor,
32             final AtomicLong compatibilityXidSeed, final NotificationPublishService notificationService) {
33         aggregateFlowsInTable = new AggregateFlowsInTableService(requestContextStack, deviceContext,
34             compatibilityXidSeed);
35         this.notificationService = requireNonNull(notificationService);
36     }
37
38     @Override
39     public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> invoke(
40             final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
41         return aggregateFlowsInTable.handleAndNotify(input, notificationService);
42     }
43 }