2 * Copyright (c) 2014 Cisco Systems, Inc. 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.sal.connect.netconf.util;
10 import static com.google.common.base.Preconditions.checkArgument;
11 import static java.util.Objects.requireNonNull;
12 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.COMMIT_RPC_CONTENT;
13 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.EDIT_CONTENT_NODEID;
14 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.GET_RPC_CONTENT;
15 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_CANDIDATE_QNAME;
16 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_COMMIT_QNAME;
17 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_COPY_CONFIG_NODEID;
18 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_COPY_CONFIG_QNAME;
19 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DEFAULT_OPERATION_NODEID;
20 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DISCARD_CHANGES_QNAME;
21 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_EDIT_CONFIG_NODEID;
22 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_EDIT_CONFIG_QNAME;
23 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_ERROR_OPTION_NODEID;
24 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_GET_CONFIG_NODEID;
25 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_GET_CONFIG_QNAME;
26 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_GET_NODEID;
27 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_GET_QNAME;
28 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_LOCK_NODEID;
29 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_LOCK_QNAME;
30 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_RUNNING_QNAME;
31 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_SOURCE_NODEID;
32 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_TARGET_NODEID;
33 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_UNLOCK_NODEID;
34 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_UNLOCK_QNAME;
35 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_VALIDATE_NODEID;
36 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_VALIDATE_QNAME;
37 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.ROLLBACK_ON_ERROR_OPTION;
38 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure;
39 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toId;
41 import com.google.common.collect.Iterables;
42 import com.google.common.util.concurrent.FutureCallback;
43 import com.google.common.util.concurrent.Futures;
44 import com.google.common.util.concurrent.ListenableFuture;
45 import com.google.common.util.concurrent.MoreExecutors;
46 import java.util.Collections;
47 import java.util.List;
49 import java.util.Map.Entry;
50 import java.util.Optional;
51 import java.util.stream.Collectors;
52 import org.eclipse.jdt.annotation.NonNull;
53 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
54 import org.opendaylight.mdsal.dom.api.DOMRpcService;
55 import org.opendaylight.netconf.api.ModifyAction;
56 import org.opendaylight.netconf.sal.connect.netconf.sal.KeepaliveSalFacade.KeepaliveDOMRpcService;
57 import org.opendaylight.netconf.sal.connect.netconf.sal.SchemalessNetconfDeviceRpc;
58 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.copy.config.input.target.ConfigTarget;
59 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.get.config.input.source.ConfigSource;
60 import org.opendaylight.yangtools.rfc8528.data.api.MountPointContext;
61 import org.opendaylight.yangtools.yang.common.Empty;
62 import org.opendaylight.yangtools.yang.common.QName;
63 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
64 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
65 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
66 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
67 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
68 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
69 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
70 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
73 * Provides base operations for NETCONF e.g. {@code get}, {@code get-config}, {@code edit-config}, {@code commit} etc.
74 * as per <a href="https://www.rfc-editor.org/rfc/rfc6241#section-7">RFC6241 Protocol Operations</a>.
76 // FIXME: datastore etc. should require NodeIdentifier instead of QName to reduce GC pressure
77 // FIXME: turn Optional arguments to @Nullable
78 public final class NetconfBaseOps {
79 private static final NodeIdentifier CONFIG_SOURCE_NODEID = NodeIdentifier.create(ConfigSource.QNAME);
80 private static final NodeIdentifier CONFIG_TARGET_NODEID = NodeIdentifier.create(ConfigTarget.QNAME);
82 private final DOMRpcService rpc;
83 private final MountPointContext mountContext;
84 private final RpcStructureTransformer transformer;
86 public NetconfBaseOps(final DOMRpcService rpc, final MountPointContext mountContext) {
87 this.rpc = requireNonNull(rpc);
88 this.mountContext = requireNonNull(mountContext);
90 if (rpc instanceof KeepaliveDOMRpcService keepAlive
91 && keepAlive.getDeviceRpc() instanceof SchemalessNetconfDeviceRpc) {
92 transformer = new SchemalessRpcStructureTransformer();
94 transformer = new NetconfRpcStructureTransformer(mountContext);
98 public ListenableFuture<? extends DOMRpcResult> lock(final FutureCallback<DOMRpcResult> callback,
99 final QName datastore) {
100 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_LOCK_QNAME, getLockContent(datastore)));
103 private static <T> ListenableFuture<T> addCallback(final FutureCallback<? super T> callback,
104 final ListenableFuture<T> future) {
105 Futures.addCallback(future, callback, MoreExecutors.directExecutor());
109 public ListenableFuture<? extends DOMRpcResult> lockCandidate(final FutureCallback<DOMRpcResult> callback) {
110 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_LOCK_QNAME,
111 getLockContent(NETCONF_CANDIDATE_QNAME)));
114 public ListenableFuture<? extends DOMRpcResult> lockRunning(final FutureCallback<DOMRpcResult> callback) {
115 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_LOCK_QNAME,
116 getLockContent(NETCONF_RUNNING_QNAME)));
119 public ListenableFuture<? extends DOMRpcResult> unlock(final FutureCallback<DOMRpcResult> callback,
120 final QName datastore) {
121 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_UNLOCK_QNAME,
122 getUnLockContent(datastore)));
125 public ListenableFuture<? extends DOMRpcResult> unlockRunning(final FutureCallback<DOMRpcResult> callback) {
126 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_UNLOCK_QNAME,
127 getUnLockContent(NETCONF_RUNNING_QNAME)));
130 public ListenableFuture<? extends DOMRpcResult> unlockCandidate(final FutureCallback<DOMRpcResult> callback) {
131 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_UNLOCK_QNAME,
132 getUnLockContent(NETCONF_CANDIDATE_QNAME)));
135 public ListenableFuture<? extends DOMRpcResult> discardChanges(final FutureCallback<DOMRpcResult> callback) {
136 // FIXME: eliminate null
137 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_DISCARD_CHANGES_QNAME, null));
140 public ListenableFuture<? extends DOMRpcResult> commit(final FutureCallback<DOMRpcResult> callback) {
141 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_COMMIT_QNAME, COMMIT_RPC_CONTENT));
144 public ListenableFuture<? extends DOMRpcResult> validate(final FutureCallback<DOMRpcResult> callback,
145 final QName datastore) {
146 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_VALIDATE_QNAME,
147 getValidateContent(requireNonNull(datastore))));
150 public ListenableFuture<? extends DOMRpcResult> validateCandidate(final FutureCallback<DOMRpcResult> callback) {
151 return validate(callback, NETCONF_CANDIDATE_QNAME);
154 public ListenableFuture<? extends DOMRpcResult> validateRunning(final FutureCallback<DOMRpcResult> callback) {
155 return validate(callback, NETCONF_RUNNING_QNAME);
158 public ListenableFuture<? extends DOMRpcResult> copyConfig(final FutureCallback<DOMRpcResult> callback,
159 final QName source, final QName target) {
160 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_COPY_CONFIG_QNAME,
161 getCopyConfigContent(source, target)));
164 public ListenableFuture<? extends DOMRpcResult> copyRunningToCandidate(
165 final FutureCallback<DOMRpcResult> callback) {
166 return copyConfig(callback, NETCONF_RUNNING_QNAME, NETCONF_CANDIDATE_QNAME);
169 public ListenableFuture<? extends DOMRpcResult> getConfig(final FutureCallback<DOMRpcResult> callback,
170 final QName datastore, final Optional<YangInstanceIdentifier> filterPath) {
171 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_GET_CONFIG_QNAME, nonEmptyFilter(filterPath)
172 .map(path -> NetconfMessageTransformUtil.wrap(NETCONF_GET_CONFIG_NODEID,
173 getSourceNode(datastore), transformer.toFilterStructure(path)))
174 .orElseGet(() -> NetconfMessageTransformUtil.wrap(NETCONF_GET_CONFIG_NODEID, getSourceNode(datastore)))));
177 private ListenableFuture<? extends DOMRpcResult> getConfig(final FutureCallback<DOMRpcResult> callback,
178 final QName datastore, final Optional<YangInstanceIdentifier> filterPath,
179 final List<YangInstanceIdentifier> fields) {
180 final ContainerNode rpcInput;
181 if (nonEmptyFilter(filterPath).isPresent()) {
182 rpcInput = NetconfMessageTransformUtil.wrap(NETCONF_GET_CONFIG_NODEID, getSourceNode(datastore),
183 transformer.toFilterStructure(List.of(FieldsFilter.of(filterPath.orElseThrow(), fields))));
184 } else if (containsEmptyPath(fields)) {
185 rpcInput = NetconfMessageTransformUtil.wrap(NETCONF_GET_CONFIG_NODEID, getSourceNode(datastore));
187 rpcInput = NetconfMessageTransformUtil.wrap(NETCONF_GET_CONFIG_NODEID,
188 getSourceNode(datastore), getSubtreeFilterFromRootFields(fields));
190 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_GET_CONFIG_QNAME, rpcInput));
194 * Calling GET-CONFIG RPC with subtree filter that is specified by {@link YangInstanceIdentifier}.
196 * @param callback RPC response callback
197 * @param filterPath path to requested data
198 * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
200 public ListenableFuture<Optional<NormalizedNode>> getConfigRunningData(final FutureCallback<DOMRpcResult> callback,
201 final Optional<YangInstanceIdentifier> filterPath) {
202 return extractData(filterPath, getConfigRunning(callback, filterPath));
206 * Calling GET-CONFIG RPC with subtree filter tha tis specified by parent {@link YangInstanceIdentifier} and list
207 * of specific fields that caller would like to read. Field paths are relative to parent path.
209 * @param callback RPC response callback
210 * @param filterPath parent path to requested data
211 * @param fields paths to specific fields that are selected under parent path
212 * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
214 public ListenableFuture<Optional<NormalizedNode>> getConfigRunningData(final FutureCallback<DOMRpcResult> callback,
215 final Optional<YangInstanceIdentifier> filterPath, final List<YangInstanceIdentifier> fields) {
216 if (fields.isEmpty()) {
217 // RFC doesn't allow to build subtree filter that would expect just empty element in response
218 return Futures.immediateFailedFuture(new IllegalArgumentException(
219 "Failed to build NETCONF GET-CONFIG RPC: provided list of fields is empty; filter path: "
222 return extractData(filterPath, getConfigRunning(callback, filterPath, fields));
226 * Calling GET RPC with subtree filter that is specified by {@link YangInstanceIdentifier}.
228 * @param callback RPC response callback
229 * @param filterPath path to requested data
230 * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
232 public ListenableFuture<Optional<NormalizedNode>> getData(final FutureCallback<DOMRpcResult> callback,
233 final Optional<YangInstanceIdentifier> filterPath) {
234 return extractData(filterPath, get(callback, filterPath));
238 * Calling GET RPC with subtree filter tha tis specified by parent {@link YangInstanceIdentifier} and list
239 * of specific fields that caller would like to read. Field paths are relative to parent path.
241 * @param callback RPC response callback
242 * @param filterPath parent path to requested data
243 * @param fields paths to specific fields that are selected under parent path
244 * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
246 public ListenableFuture<Optional<NormalizedNode>> getData(final FutureCallback<DOMRpcResult> callback,
247 final Optional<YangInstanceIdentifier> filterPath, final List<YangInstanceIdentifier> fields) {
248 if (fields.isEmpty()) {
249 // RFC doesn't allow to build subtree filter that would expect just empty element in response
250 return Futures.immediateFailedFuture(new IllegalArgumentException(
251 "Failed to build NETCONF GET RPC: provided list of fields is empty; filter path: " + filterPath));
253 return extractData(filterPath, get(callback, filterPath, fields));
256 private ListenableFuture<Optional<NormalizedNode>> extractData(final Optional<YangInstanceIdentifier> path,
257 final ListenableFuture<? extends DOMRpcResult> configRunning) {
258 return Futures.transform(configRunning, result -> {
259 final var errors = result.getErrors();
260 checkArgument(errors.isEmpty(), "Unable to read data: %s, errors: %s", path, errors);
261 return transformer.selectFromDataStructure(((ContainerNode) result.getResult())
262 .getChildByArg(NetconfMessageTransformUtil.NETCONF_DATA_NODEID), path.orElseThrow());
263 }, MoreExecutors.directExecutor());
266 public ListenableFuture<? extends DOMRpcResult> getConfigRunning(final FutureCallback<DOMRpcResult> callback,
267 final Optional<YangInstanceIdentifier> filterPath) {
268 return getConfig(callback, NETCONF_RUNNING_QNAME, filterPath);
271 private ListenableFuture<? extends DOMRpcResult> getConfigRunning(final FutureCallback<DOMRpcResult> callback,
272 final Optional<YangInstanceIdentifier> filterPath, final List<YangInstanceIdentifier> fields) {
273 return getConfig(callback, NETCONF_RUNNING_QNAME, filterPath, fields);
276 public ListenableFuture<? extends DOMRpcResult> getConfigCandidate(final FutureCallback<DOMRpcResult> callback,
277 final Optional<YangInstanceIdentifier> filterPath) {
278 return getConfig(callback, NETCONF_CANDIDATE_QNAME, filterPath);
281 public ListenableFuture<? extends DOMRpcResult> get(final FutureCallback<DOMRpcResult> callback,
282 final Optional<YangInstanceIdentifier> filterPath) {
283 return addCallback(requireNonNull(callback),
284 rpc.invokeRpc(NETCONF_GET_QNAME, nonEmptyFilter(filterPath)
285 .map(path -> NetconfMessageTransformUtil.wrap(NETCONF_GET_NODEID,
286 toFilterStructure(path, mountContext.getEffectiveModelContext())))
287 .orElse(NetconfMessageTransformUtil.GET_RPC_CONTENT)));
290 private ListenableFuture<? extends DOMRpcResult> get(final FutureCallback<DOMRpcResult> callback,
291 final Optional<YangInstanceIdentifier> filterPath, final List<YangInstanceIdentifier> fields) {
292 final ContainerNode rpcInput;
293 if (nonEmptyFilter(filterPath).isPresent()) {
294 rpcInput = NetconfMessageTransformUtil.wrap(NETCONF_GET_NODEID, transformer.toFilterStructure(
295 Collections.singletonList(FieldsFilter.of(filterPath.orElseThrow(), fields))));
296 } else if (containsEmptyPath(fields)) {
297 rpcInput = GET_RPC_CONTENT;
299 rpcInput = NetconfMessageTransformUtil.wrap(NETCONF_GET_NODEID, getSubtreeFilterFromRootFields(fields));
301 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_GET_QNAME, rpcInput));
304 private static boolean containsEmptyPath(final List<YangInstanceIdentifier> fields) {
305 return fields.stream().anyMatch(YangInstanceIdentifier::isEmpty);
308 private DataContainerChild getSubtreeFilterFromRootFields(final List<YangInstanceIdentifier> fields) {
309 return transformer.toFilterStructure(fields.stream()
310 .map(fieldPath -> Map.entry(
311 YangInstanceIdentifier.create(Iterables.limit(fieldPath.getPathArguments(), 1)),
312 YangInstanceIdentifier.create(Iterables.skip(fieldPath.getPathArguments(), 1))))
313 .collect(Collectors.groupingBy(Entry::getKey,
314 Collectors.mapping(Entry::getValue, Collectors.toUnmodifiableList())))
316 .map(entry -> FieldsFilter.of(entry.getKey(), entry.getValue()))
317 .collect(Collectors.toUnmodifiableList()));
320 private static Optional<YangInstanceIdentifier> nonEmptyFilter(final Optional<YangInstanceIdentifier> filterPath) {
321 return filterPath.filter(path -> !path.isEmpty());
324 public ListenableFuture<? extends DOMRpcResult> editConfigCandidate(
325 final FutureCallback<? super DOMRpcResult> callback, final DataContainerChild editStructure,
326 final ModifyAction modifyAction, final boolean rollback) {
327 return editConfig(callback, NETCONF_CANDIDATE_QNAME, editStructure, Optional.of(modifyAction), rollback);
330 public ListenableFuture<? extends DOMRpcResult> editConfigCandidate(
331 final FutureCallback<? super DOMRpcResult> callback, final DataContainerChild editStructure,
332 final boolean rollback) {
333 return editConfig(callback, NETCONF_CANDIDATE_QNAME, editStructure, Optional.empty(), rollback);
336 public ListenableFuture<? extends DOMRpcResult> editConfigRunning(
337 final FutureCallback<? super DOMRpcResult> callback, final DataContainerChild editStructure,
338 final ModifyAction modifyAction, final boolean rollback) {
339 return editConfig(callback, NETCONF_RUNNING_QNAME, editStructure, Optional.of(modifyAction), rollback);
342 public ListenableFuture<? extends DOMRpcResult> editConfigRunning(
343 final FutureCallback<? super DOMRpcResult> callback, final DataContainerChild editStructure,
344 final boolean rollback) {
345 return editConfig(callback, NETCONF_RUNNING_QNAME, editStructure, Optional.empty(), rollback);
348 public ListenableFuture<? extends DOMRpcResult> editConfig(
349 final FutureCallback<? super DOMRpcResult> callback, final QName datastore,
350 final DataContainerChild editStructure, final Optional<ModifyAction> modifyAction,
351 final boolean rollback) {
352 return addCallback(requireNonNull(callback), rpc.invokeRpc(NETCONF_EDIT_CONFIG_QNAME,
353 getEditConfigContent(requireNonNull(datastore), requireNonNull(editStructure), modifyAction, rollback)));
356 public ChoiceNode createEditConfigStructure(final Optional<NormalizedNode> lastChild,
357 final Optional<ModifyAction> operation, final YangInstanceIdentifier dataPath) {
358 return Builders.choiceBuilder()
359 .withNodeIdentifier(EDIT_CONTENT_NODEID)
360 .withChild(transformer.createEditConfigStructure(lastChild, dataPath, operation))
364 private static ContainerNode getEditConfigContent(final QName datastore, final DataContainerChild editStructure,
365 final Optional<ModifyAction> defaultOperation, final boolean rollback) {
366 final var editBuilder = Builders.containerBuilder().withNodeIdentifier(NETCONF_EDIT_CONFIG_NODEID);
369 editBuilder.withChild(getTargetNode(datastore));
372 defaultOperation.ifPresent(op -> {
373 editBuilder.withChild(ImmutableNodes.leafNode(NETCONF_DEFAULT_OPERATION_NODEID, op.xmlValue()));
379 editBuilder.withChild(ImmutableNodes.leafNode(NETCONF_ERROR_OPTION_NODEID, ROLLBACK_ON_ERROR_OPTION));
383 return editBuilder.withChild(editStructure).build();
386 public static @NonNull ContainerNode getSourceNode(final QName datastore) {
387 return Builders.containerBuilder()
388 .withNodeIdentifier(NETCONF_SOURCE_NODEID)
389 .withChild(Builders.choiceBuilder()
390 .withNodeIdentifier(CONFIG_SOURCE_NODEID)
391 .withChild(ImmutableNodes.leafNode(datastore, Empty.value()))
396 public static @NonNull ContainerNode getLockContent(final QName datastore) {
397 return Builders.containerBuilder()
398 .withNodeIdentifier(NETCONF_LOCK_NODEID)
399 .withChild(getTargetNode(datastore))
403 public static @NonNull ContainerNode getTargetNode(final QName datastore) {
404 return Builders.containerBuilder()
405 .withNodeIdentifier(NETCONF_TARGET_NODEID)
406 .withChild(Builders.choiceBuilder()
407 .withNodeIdentifier(CONFIG_TARGET_NODEID)
408 .withChild(ImmutableNodes.leafNode(toId(datastore), Empty.value()))
413 public static @NonNull ContainerNode getCopyConfigContent(final QName source, final QName target) {
414 return Builders.containerBuilder()
415 .withNodeIdentifier(NETCONF_COPY_CONFIG_NODEID)
416 .withChild(getTargetNode(target))
417 .withChild(getSourceNode(source))
421 public static @NonNull ContainerNode getValidateContent(final QName source) {
422 return Builders.containerBuilder()
423 .withNodeIdentifier(NETCONF_VALIDATE_NODEID)
424 .withChild(getSourceNode(source))
428 public static @NonNull ContainerNode getUnLockContent(final QName datastore) {
429 return Builders.containerBuilder()
430 .withNodeIdentifier(NETCONF_UNLOCK_NODEID)
431 .withChild(getTargetNode(datastore))