+ return addCallback(requireNonNull(callback), rpc.invokeNetconf(NETCONF_GET_CONFIG_QNAME, rpcInput));
+ }
+
+ /**
+ * Calling GET-CONFIG RPC with subtree filter that is specified by {@link YangInstanceIdentifier}.
+ *
+ * @param callback RPC response callback
+ * @param filterPath path to requested data
+ * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
+ */
+ public ListenableFuture<Optional<NormalizedNode>> getConfigRunningData(final FutureCallback<DOMRpcResult> callback,
+ final Optional<YangInstanceIdentifier> filterPath) {
+ return extractData(filterPath, getConfigRunning(callback, filterPath));
+ }
+
+ /**
+ * Calling GET-CONFIG RPC with subtree filter tha tis specified by parent {@link YangInstanceIdentifier} and list
+ * of specific fields that caller would like to read. Field paths are relative to parent path.
+ *
+ * @param callback RPC response callback
+ * @param filterPath parent path to requested data
+ * @param fields paths to specific fields that are selected under parent path
+ * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
+ */
+ public ListenableFuture<Optional<NormalizedNode>> getConfigRunningData(final FutureCallback<DOMRpcResult> callback,
+ final Optional<YangInstanceIdentifier> filterPath, final List<YangInstanceIdentifier> fields) {
+ if (fields.isEmpty()) {
+ // RFC doesn't allow to build subtree filter that would expect just empty element in response
+ return Futures.immediateFailedFuture(new IllegalArgumentException(
+ "Failed to build NETCONF GET-CONFIG RPC: provided list of fields is empty; filter path: "
+ + filterPath));
+ }
+ return extractData(filterPath, getConfigRunning(callback, filterPath, fields));
+ }
+
+ /**
+ * Calling GET RPC with subtree filter that is specified by {@link YangInstanceIdentifier}.
+ *
+ * @param callback RPC response callback
+ * @param filterPath path to requested data
+ * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
+ */
+ public ListenableFuture<Optional<NormalizedNode>> getData(final FutureCallback<DOMRpcResult> callback,
+ final Optional<YangInstanceIdentifier> filterPath) {
+ return extractData(filterPath, get(callback, filterPath));
+ }
+
+ /**
+ * Calling GET RPC with subtree filter tha tis specified by parent {@link YangInstanceIdentifier} and list
+ * of specific fields that caller would like to read. Field paths are relative to parent path.
+ *
+ * @param callback RPC response callback
+ * @param filterPath parent path to requested data
+ * @param fields paths to specific fields that are selected under parent path
+ * @return asynchronous completion token with read {@link NormalizedNode} wrapped in {@link Optional} instance
+ */
+ public ListenableFuture<Optional<NormalizedNode>> getData(final FutureCallback<DOMRpcResult> callback,
+ final Optional<YangInstanceIdentifier> filterPath, final List<YangInstanceIdentifier> fields) {
+ if (fields.isEmpty()) {
+ // RFC doesn't allow to build subtree filter that would expect just empty element in response
+ return Futures.immediateFailedFuture(new IllegalArgumentException(
+ "Failed to build NETCONF GET RPC: provided list of fields is empty; filter path: " + filterPath));
+ }
+ return extractData(filterPath, get(callback, filterPath, fields));