Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / sal / AbstractMeterRpc.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.services.sal;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
12 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
13 import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerMeterService;
14 import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerMeterService;
15 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter;
17 import org.opendaylight.yangtools.yang.binding.RpcOutput;
18
19 abstract class AbstractMeterRpc<I extends Meter, O extends RpcOutput> extends AbstractDeviceRpc {
20     final @NonNull MultiLayerMeterService<I, O> multi;
21     final @NonNull SingleLayerMeterService<O> single;
22
23     AbstractMeterRpc(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
24             final ConvertorExecutor convertorExecutor, final Class<O> output) {
25         super(deviceContext);
26         multi = new MultiLayerMeterService<>(requestContextStack, deviceContext, output, convertorExecutor);
27         single = new SingleLayerMeterService<>(requestContextStack, deviceContext, output);
28     }
29 }