2 * Copyright (c) 2015 Cisco Systems, Inc. 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;
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;
22 public final class GetGroupStatisticsImpl implements GetGroupStatistics {
23 private final GroupStatsService groupStats;
24 private final NotificationPublishService notificationPublishService;
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);
34 public ListenableFuture<RpcResult<GetGroupStatisticsOutput>> invoke(final GetGroupStatisticsInput input) {
35 return groupStats.handleAndNotify(input, notificationPublishService);