2 * Copyright (c) 2022 PANTHEON.tech, s.r.o. 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.netconf.client.mdsal.api;
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.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.CancelCommit;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.CloseSession;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Commit;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.CopyConfig;
19 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.DeleteConfig;
20 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.DiscardChanges;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditConfig;
22 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Get;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.GetConfig;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.KillSession;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Lock;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Unlock;
27 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Validate;
28 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscription;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.GetSchema;
30 import org.opendaylight.yangtools.yang.common.QName;
31 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
34 * A {@link DOMService} capturing the ability to invoke NETCONF RPCs through
35 * {@link #invokeNetconf(QName, ContainerNode)}.
37 public interface NetconfRpcService extends DOMService<NetconfRpcService, NetconfRpcService.Extension> {
39 * Invoke a well-known RPC. This method is guaranteed to support the following RPCs:
41 * <li>{@link CloseSession}</li>
42 * <li>{@link CopyConfig}</li>
43 * <li>{@link DeleteConfig}</li>
44 * <li>{@link EditConfig}</li>
45 * <li>{@link Get}</li>
46 * <li>{@link GetConfig}</li>
47 * <li>{@link KillSession}</li>
48 * <li>{@link Lock}</li>
49 * <li>{@link Unlock}</li>
53 * The support for other RPCs is advertized through {@link #supportedExtensions()}.
55 * @param type QName of the RPC to be invoked
56 * @param input Input arguments, null if the RPC does not take any.
57 * @return A {@link ListenableFuture} which will return either a result structure, or report a subclass
58 * of {@link DOMRpcException} reporting a transport error.
60 @NonNull ListenableFuture<? extends DOMRpcResult> invokeNetconf(@NonNull QName type, @NonNull ContainerNode input);
63 * Extensions to {@link NetconfRpcService} defining additional RPC availability.
65 // Note: This is not an interface on purpose, to make the set of extensions well-known
66 enum Extension implements DOMService.Extension<NetconfRpcService, Extension> {
68 * This device supports
69 * <a href="https://www.rfc-editor.org/rfc/rfc4741#section-8.3">Candidate Configuration Capability</a>.
70 * The following RPCs are supported:
72 * <li>{@link Commit}</li>
73 * <li>{@link DiscardChanges}</li>
78 * This device supports
79 * <a href="https://www.rfc-editor.org/rfc/rfc4741#section-8.4">Confirmed Commit Capability 1.0</a>.
80 * The following RPCs are supported:
82 * <li>{@link Commit}</li>
83 * <li>{@link DiscardChanges}</li>
88 * This device supports
89 * <a href="https://www.rfc-editor.org/rfc/rfc6241#section-8.4">Confirmed Commit Capability 1.1</a>.
90 * The following RPCs are supported:
92 * <li>{@link CancelCommit}</li>
93 * <li>{@link Commit}</li>
94 * <li>{@link DiscardChanges}</li>
99 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc6022">NETCONF Monitoring</a>. The following
100 * RPCs are supported:
102 * <li>{@link GetSchema}</li>
107 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc5277">Event Notifications</a>. The following
108 * RPCs are supported:
110 * <li>{@link CreateSubscription}</li>
112 * {@link CreateSubscription} is supported.
116 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc4741#section-8.6">Validate Capability</a>.
117 * The following RPCs are supported:
119 * <li>{@link Validate}</li>
124 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc6241#section-8.6">Validate Capability</a>.
125 * The following RPCs are supported:
127 * <li>{@link Validate}</li>