2 * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.impl.statistics.services.compatibility;
10 import static java.util.Objects.requireNonNull;
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.AllFlowsInTableService;
18 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTable;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutput;
22 import org.opendaylight.yangtools.yang.common.RpcResult;
25 public final class GetAllFlowStatisticsFromFlowTableImpl implements GetAllFlowStatisticsFromFlowTable {
26 private final AllFlowsInTableService allFlowsInTable;
27 private final NotificationPublishService notificationService;
29 public GetAllFlowStatisticsFromFlowTableImpl(final RequestContextStack requestContextStack,
30 final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor,
31 final AtomicLong compatibilityXidSeed, final NotificationPublishService notificationService) {
32 allFlowsInTable = new AllFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed,
34 this.notificationService = requireNonNull(notificationService);
38 public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> invoke(
39 final GetAllFlowStatisticsFromFlowTableInput input) {
40 return allFlowsInTable.handleAndNotify(input, notificationService);