Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / GetGroupFeaturesImpl.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.statistics.services;
9
10 import static java.util.Objects.requireNonNull;
11
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.openflow.md.core.sal.convertor.ConvertorExecutor;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeatures;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesInput;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutput;
21 import org.opendaylight.yangtools.yang.common.RpcResult;
22
23 @Deprecated
24 public final class GetGroupFeaturesImpl implements GetGroupFeatures {
25     private final GroupFeaturesService groupFeat;
26     private final NotificationPublishService notificationPublishService;
27
28     public GetGroupFeaturesImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
29             final AtomicLong compatibilityXidSeed, final NotificationPublishService notificationPublishService,
30             final ConvertorExecutor convertorExecutor) {
31         groupFeat = new GroupFeaturesService(requestContextStack, deviceContext, compatibilityXidSeed);
32         this.notificationPublishService = requireNonNull(notificationPublishService);
33     }
34
35     @Override
36     public ListenableFuture<RpcResult<GetGroupFeaturesOutput>> invoke(final GetGroupFeaturesInput input) {
37         return groupFeat.handleAndNotify(input, notificationPublishService);
38     }
39 }