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.DOMExtensibleService;
13 import org.opendaylight.mdsal.dom.api.DOMRpcException;
14 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
15 import org.opendaylight.mdsal.dom.api.DOMService;
16 import org.opendaylight.mdsal.dom.api.DOMServiceExtension;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.CancelCommit;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.CloseSession;
19 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Commit;
20 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.CopyConfig;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.DeleteConfig;
22 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.DiscardChanges;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditConfig;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Get;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.GetConfig;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.KillSession;
27 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Lock;
28 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Unlock;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.Validate;
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscription;
31 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.GetSchema;
32 import org.opendaylight.yangtools.yang.common.QName;
33 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
36 * A {@link DOMService} capturing the ability to invoke NETCONF RPCs through
37 * {@link #invokeNetconf(QName, ContainerNode)}.
39 public interface NetconfRpcService extends DOMExtensibleService<NetconfRpcService, NetconfRpcService.Extension> {
41 * Invoke a well-known RPC. This method is guaranteed to support the following RPCs:
43 * <li>{@link CloseSession}</li>
44 * <li>{@link CopyConfig}</li>
45 * <li>{@link DeleteConfig}</li>
46 * <li>{@link EditConfig}</li>
47 * <li>{@link Get}</li>
48 * <li>{@link GetConfig}</li>
49 * <li>{@link KillSession}</li>
50 * <li>{@link Lock}</li>
51 * <li>{@link Unlock}</li>
55 * The support for other RPCs is advertized through {@link #getExtensions()}.
57 * @param type QName of the RPC to be invoked
58 * @param input Input arguments, null if the RPC does not take any.
59 * @return A {@link ListenableFuture} which will return either a result structure, or report a subclass
60 * of {@link DOMRpcException} reporting a transport error.
62 @NonNull ListenableFuture<? extends DOMRpcResult> invokeNetconf(@NonNull QName type, @NonNull ContainerNode input);
65 * Extensions to {@link NetconfRpcService} defining additional RPC availability.
67 // Note: This is not an interface on purpose, to make the set of extensions well-known
68 enum Extension implements DOMServiceExtension<NetconfRpcService, Extension> {
70 * This device supports
71 * <a href="https://www.rfc-editor.org/rfc/rfc4741#section-8.3">Candidate Configuration Capability</a>.
72 * The following RPCs are supported:
74 * <li>{@link Commit}</li>
75 * <li>{@link DiscardChanges}</li>
80 * This device supports
81 * <a href="https://www.rfc-editor.org/rfc/rfc4741#section-8.4">Confirmed Commit Capability 1.0</a>.
82 * The following RPCs are supported:
84 * <li>{@link Commit}</li>
85 * <li>{@link DiscardChanges}</li>
90 * This device supports
91 * <a href="https://www.rfc-editor.org/rfc/rfc6241#section-8.4">Confirmed Commit Capability 1.1</a>.
92 * The following RPCs are supported:
94 * <li>{@link CancelCommit}</li>
95 * <li>{@link Commit}</li>
96 * <li>{@link DiscardChanges}</li>
101 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc6022">NETCONF Monitoring</a>. The following
102 * RPCs are supported:
104 * <li>{@link GetSchema}</li>
109 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc5277">Event Notifications</a>. The following
110 * RPCs are supported:
112 * <li>{@link CreateSubscription}</li>
114 * {@link CreateSubscription} is supported.
118 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc4741#section-8.6">Validate Capability</a>.
119 * The following RPCs are supported:
121 * <li>{@link Validate}</li>
126 * This device supports <a href="https://www.rfc-editor.org/rfc/rfc6241#section-8.6">Validate Capability</a>.
127 * The following RPCs are supported:
129 * <li>{@link Validate}</li>