Simplify CommonService interface
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / OpendaylightMeterStatisticsServiceImpl.java
1 /**
2  * Copyright (c) 2015 Cisco Systems, Inc. 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 java.util.concurrent.Future;
11 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
12 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsOutput;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsInput;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsOutput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutput;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsInput;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsOutput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
22 import org.opendaylight.yangtools.yang.common.RpcResult;
23
24 public class OpendaylightMeterStatisticsServiceImpl implements OpendaylightMeterStatisticsService {
25     private final AllMeterConfigStatsService allMeterConfig;
26     private final AllMeterStatsService allMeterStats;
27     private final MeterFeaturesService meterFeatures;
28     private final MeterStatsService meterStats;
29
30     public OpendaylightMeterStatisticsServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
31         allMeterConfig = new AllMeterConfigStatsService(requestContextStack, deviceContext);
32         allMeterStats = new AllMeterStatsService(requestContextStack, deviceContext);
33         meterFeatures = new MeterFeaturesService(requestContextStack, deviceContext);
34         meterStats = new MeterStatsService(requestContextStack, deviceContext);
35     }
36
37     @Override
38     public Future<RpcResult<GetAllMeterConfigStatisticsOutput>> getAllMeterConfigStatistics(
39             final GetAllMeterConfigStatisticsInput input) {
40         return allMeterConfig.handleServiceCall(input);
41     }
42
43     @Override
44     public Future<RpcResult<GetAllMeterStatisticsOutput>> getAllMeterStatistics(final GetAllMeterStatisticsInput input) {
45         return allMeterStats.handleServiceCall(input);
46     }
47
48     @Override
49     public Future<RpcResult<GetMeterFeaturesOutput>> getMeterFeatures(final GetMeterFeaturesInput input) {
50         return meterFeatures.handleServiceCall(input);
51     }
52
53     @Override
54     public Future<RpcResult<GetMeterStatisticsOutput>> getMeterStatistics(final GetMeterStatisticsInput input) {
55         return meterStats.handleServiceCall(input);
56     }
57 }