Move netconf-console to apps/
[netconf.git] / plugins / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / api / NetconfRpcService.java
1 /*
2  * Copyright (c) 2022 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.netconf.sal.connect.api;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.dom.api.DOMRpcException;
13 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
14 import org.opendaylight.mdsal.dom.api.DOMService;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.common.YangConstants;
17 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
18
19 /**
20  * A {@link DOMService} capturing the ability to invoke RPCs which are defined in RFC4741 and in RFC6241.
21  */
22 public interface NetconfRpcService extends DOMService {
23     /**
24      * Invoke a base RFC4741/RFC6241 RPC, e.g. those in {@link YangConstants#NETCONF_NAMESPACE}.
25      *
26      * @param type QName of the RPC to be invoked
27      * @param input Input arguments, null if the RPC does not take any.
28      * @return A {@link ListenableFuture} which will return either a result structure, or report a subclass
29      *         of {@link DOMRpcException} reporting a transport error.
30      */
31     @NonNull ListenableFuture<? extends DOMRpcResult> invokeNetconf(@NonNull QName type, @NonNull ContainerNode input);
32 }