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.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsInput;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsOutput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortOutput;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortInput;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortOutput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService;
22 import org.opendaylight.yangtools.yang.common.RpcResult;
24 public class OpendaylightQueueStatisticsServiceImpl implements OpendaylightQueueStatisticsService {
25 private final AllQueuesAllPortsService allQueuesAllPorts;
26 private final AllQueuesOnePortService allQueuesOnePort;
27 private final OneQueueOnePortService oneQueueOnePort;
28 private final NotificationPublishService notificationPublishService;
30 public OpendaylightQueueStatisticsServiceImpl(final RequestContextStack requestContextStack,
31 final DeviceContext deviceContext,
32 final AtomicLong compatibilityXidSeed,
33 final NotificationPublishService notificationPublishService) {
34 this.notificationPublishService = notificationPublishService;
35 allQueuesAllPorts = new AllQueuesAllPortsService(requestContextStack, deviceContext, compatibilityXidSeed);
36 allQueuesOnePort = new AllQueuesOnePortService(requestContextStack, deviceContext, compatibilityXidSeed);
37 oneQueueOnePort = new OneQueueOnePortService(requestContextStack, deviceContext, compatibilityXidSeed);
41 public ListenableFuture<RpcResult<GetAllQueuesStatisticsFromAllPortsOutput>> getAllQueuesStatisticsFromAllPorts(
42 final GetAllQueuesStatisticsFromAllPortsInput input) {
43 return allQueuesAllPorts.handleAndNotify(input, notificationPublishService);
47 public ListenableFuture<RpcResult<GetAllQueuesStatisticsFromGivenPortOutput>> getAllQueuesStatisticsFromGivenPort(
48 final GetAllQueuesStatisticsFromGivenPortInput input) {
49 return allQueuesOnePort.handleAndNotify(input, notificationPublishService);
53 public ListenableFuture<RpcResult<GetQueueStatisticsFromGivenPortOutput>> getQueueStatisticsFromGivenPort(
54 final GetQueueStatisticsFromGivenPortInput input) {
55 return oneQueueOnePort.handleAndNotify(input, notificationPublishService);