From 64b8edae284ceca6f97a17a14f0632e27148ae62 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 26 Jun 2021 16:45:21 +0200 Subject: [PATCH] Add yang.common.Error{Severity,Tag,Type} constructs There is a number of error-reporting constructs which are defined across RFC4741, RFC6020, RFC6241 and RFC8040. These originate from NETCONF, but are quite integrated in the YANG enforcement specification. - NetconfLayer to identify the NETCONF layer involved - ErrorSeverity to discern errors and warnings - ErrorType to express error-types reported - ErrorTag to extensibly identify error-tag reported Also add proper RFC4741/RFC6241 namespace anchors and use them as appropriate. JIRA: YANGTOOLS-1303 Change-Id: Idbb0d7ac4a2b58f930b06d14522872a18e7037d8 Signed-off-by: Robert Varga --- .../yangtools/yang/common/ErrorSeverity.java | 61 ++++++ .../yangtools/yang/common/ErrorTag.java | 179 ++++++++++++++++++ .../yangtools/yang/common/ErrorType.java | 84 ++++++++ .../yangtools/yang/common/NetconfLayer.java | 64 +++++++ .../yangtools/yang/common/RpcError.java | 67 +++++-- .../yangtools/yang/common/YangConstants.java | 52 +++++ .../yang/model/api/SchemaContext.java | 3 +- 7 files changed, 497 insertions(+), 13 deletions(-) create mode 100644 common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorSeverity.java create mode 100644 common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorTag.java create mode 100644 common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorType.java create mode 100644 common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/NetconfLayer.java diff --git a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorSeverity.java b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorSeverity.java new file mode 100644 index 0000000000..04983d2ac0 --- /dev/null +++ b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorSeverity.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.yangtools.yang.common; + +import static java.util.Objects.requireNonNull; + +import com.google.common.collect.Maps; +import java.util.Arrays; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * Enumeration of {@code error-severity} values, as defined by + * RFC4741, section 4.3. + */ +@NonNullByDefault +public enum ErrorSeverity { + /** + * An error preventing an operation from completing successfully. + */ + ERROR("error", RpcError.ErrorSeverity.ERROR), + /** + * A warning not affecting an operation's ability to complete successfully. + */ + WARNING("warning", RpcError.ErrorSeverity.ERROR); + + private static final Map BY_ELEMENT_BODY = + Maps.uniqueIndex(Arrays.asList(values()), ErrorSeverity::elementBody); + + private final RpcError.ErrorSeverity legacy; + private final String elementBody; + + ErrorSeverity(final String elementName, final RpcError.ErrorSeverity legacy) { + this.elementBody = requireNonNull(elementName); + this.legacy = requireNonNull(legacy); + } + + /** + * Return the XML element body of this object. + * + * @return element body of this object + */ + public String elementBody() { + return elementBody; + } + + @Deprecated + public RpcError.ErrorSeverity toLegacy() { + return legacy; + } + + public static @Nullable ErrorSeverity forElementBody(final String elementBody) { + return BY_ELEMENT_BODY.get(requireNonNull(elementBody)); + } +} diff --git a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorTag.java b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorTag.java new file mode 100644 index 0000000000..4e0a0b913b --- /dev/null +++ b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorTag.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.yangtools.yang.common; + +import static java.util.Objects.requireNonNull; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * Extensible enumeration of {@code error-tag} values, as defined in + * RFC6241. These values are an extensible + * enumeration, since YANG does not place restriction on possible values in + * RFC8040. + * + *

+ * Error tag defines overall error semantics. Additional tag-specific information may be associated with a particular + * error tag. + */ +@NonNullByDefault +public final class ErrorTag { + /** + * {@code access-denied} {@link ErrorTag}. + */ + public static final ErrorTag ACCESS_DENIED = new ErrorTag("access-denied"); + /** + * {@code bad-attribute} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 8.3.1, bullet 6 + *

+     *   For insert handling, if the value for the attributes "before" and
+     *   "after" are not valid for the type of the appropriate key leafs,
+     *   the server MUST reply with a "bad-attribute" error-tag in the rpc-
+     *   error.
+     * 
+ */ + public static final ErrorTag BAD_ATTRIBUTE = new ErrorTag("bad-attribute"); + /** + * {@code bad-element} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 8.3.1, bullet 3 + *
+     *   If data for more than one case branch of a choice is present, the
+     *   server MUST reply with a "bad-element" in the rpc-error.
+     * 
+ */ + public static final ErrorTag BAD_ELEMENT = new ErrorTag("bad-element"); + /** + * {@code data-exists} {@link ErrorTag}. + */ + public static final ErrorTag DATA_EXISTS = new ErrorTag("data-exists"); + /** + * {@code data-missing} {@link ErrorTag}. Covers mechanics specified in RFC6020 sections 13.5 through 13.7. + */ + public static final ErrorTag DATA_MISSING = new ErrorTag("data-missing"); + /** + * {@code in-use} {@link ErrorTag}. + */ + public static final ErrorTag IN_USE = new ErrorTag("in-use"); + /** + * {@code invalid-value} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 8.3.1, bullet 1 + *
+     *   If a leaf data value does not match the type constraints for the
+     *   leaf, including those defined in the type's "range", "length", and
+     *   "pattern" properties, the server MUST reply with an
+     *   "invalid-value" error-tag in the rpc-error, and with the error-
+     *   app-tag and error-message associated with the constraint, if any
+     *   exist.
+     * 
+ */ + public static final ErrorTag INVALID_VALUE = new ErrorTag("invalid-value"); + /** + * {@code lock-denied} {@link ErrorTag}. + */ + public static final ErrorTag LOCK_DENIED = new ErrorTag("lock-denied"); + /** + * {@code missing-attribute} {@link ErrorTag}. + */ + public static final ErrorTag MISSING_ATTRIBUTE = new ErrorTag("missing-attribute"); + /** + * {@code missing-element} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 8.3.1, bullet 2 + *
+     *   If all keys of a list entry are not present, the server MUST reply
+     *   with a "missing-element" error-tag in the rpc-error.
+     * 
+ * as well as RFC6020 section 7.13.2, paragraph 2 + *
+     *   If a leaf in the input tree has a "mandatory" statement with the
+     *   value "true", the leaf MUST be present in a NETCONF RPC invocation.
+     *   Otherwise, the server MUST return a "missing-element" error.
+     * 
+ */ + public static final ErrorTag MISSING_ELEMENT = new ErrorTag("missing-element"); + /** + * {@code operation-failed} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 13.1 through 13.4. + */ + public static final ErrorTag OPERATION_FAILED = new ErrorTag("operation-failed"); + /** + * {@code operation-not-supported} {@link ErrorTag}. + */ + public static final ErrorTag OPERATION_NOT_SUPPORTED = new ErrorTag("operation-not-supported"); + /** + * {@code partial-operation} {@link ErrorTag}. + * @deprecated This error-info is obsolete since RFC6241. + */ + @Deprecated(since = "RFC6241") + public static final ErrorTag PARTIAL_OPERATION = new ErrorTag("partial-operation"); + /** + * {@code resource-denied} {@link ErrorTag}. + */ + public static final ErrorTag RESOURCE_DENIED = new ErrorTag("resource-denied"); + /** + * {@code rollback-failed} {@link ErrorTag}. + */ + public static final ErrorTag ROLLBACK_FAILED = new ErrorTag("rollback-failed"); + /** + * {@code too-big} {@link ErrorTag}. + */ + public static final ErrorTag TOO_BIG = new ErrorTag("too-big"); + /** + * {@code unknown-element} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 8.3.1, bullet 7 + *
+     *   If the attributes "before" and "after" appears in any element that
+     *   is not a list whose "ordered-by" property is "user", the server
+     *   MUST reply with an "unknown-attribute" error-tag in the rpc-error.
+     * 
+ */ + public static final ErrorTag UNKNOWN_ATTRIBUTE = new ErrorTag("unknown-attribute"); + /** + * {@code unknown-element} {@link ErrorTag}. Covers mechanics specified in RFC6020 section 8.3.1, bullet 4 + *
+     *   If data for a node tagged with "if-feature" is present, and the
+     *   feature is not supported by the device, the server MUST reply with
+     *   an "unknown-element" error-tag in the rpc-error.
+     * 
+ * as well as RFC6020 section 8.3.1, bullet 5 + *
+     *   If data for a node tagged with "when" is present, and the "when"
+     *   condition evaluates to "false", the server MUST reply with an
+     *   "unknown-element" error-tag in the rpc-error.
+     * 
+ */ + public static final ErrorTag UNKNOWN_ELEMENT = new ErrorTag("unknown-element"); + /** + * {@code unknown-namespace} {@link ErrorTag}. + */ + public static final ErrorTag UNKNOWN_NAMESPACE = new ErrorTag("unknown-namespace"); + + private final String elementBody; + + public ErrorTag(final String elementBody) { + this.elementBody = requireNonNull(elementBody); + } + + /** + * Return the XML element body of this object. + * + * @return element body of this object + */ + public String elementBody() { + return elementBody; + } + + @Override + public int hashCode() { + return elementBody.hashCode(); + } + + @Override + public boolean equals(final @Nullable Object obj) { + return obj == this || obj instanceof ErrorTag && elementBody.equals(((ErrorTag) obj).elementBody); + } + + @Override + public String toString() { + return elementBody; + } +} \ No newline at end of file diff --git a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorType.java b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorType.java new file mode 100644 index 0000000000..42b8d49638 --- /dev/null +++ b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/ErrorType.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.yangtools.yang.common; + +import static java.util.Objects.requireNonNull; + +import com.google.common.collect.Maps; +import java.util.Arrays; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * Enumeration of {@code error-type} values. These provide glue between {@link NetconfLayer} and various sources of + * such errors. This enumeration is not extensible in YANG as it is modeled in + * RFC8040. + */ +@NonNullByDefault +public enum ErrorType { + /** + * A {@link NetconfLayer#TRANSPORT} layer error. This typically happens on transport endpoints, where a protocol + * plugin needs to report a NETCONF-equivalent condition. + */ + TRANSPORT("transport", NetconfLayer.TRANSPORT, RpcError.ErrorType.TRANSPORT), + /** + * A {@link NetconfLayer#RPC} layer error. This typically happens on request routers, where a request may end up + * being resolved due to implementation-internal causes, such as timeouts and state loss. + */ + RPC("rpc", NetconfLayer.RPC, RpcError.ErrorType.RPC), + /** + * A {@link NetconfLayer#OPERATIONS} layer error. These typically happen in a NETCONF protocol implementation. + */ + PROTOCOL("protocol", NetconfLayer.OPERATIONS, RpcError.ErrorType.PROTOCOL), + /** + * A {@link NetconfLayer#CONTENT} layer error. These typically happen due to YANG data handling, such as + * type checking and structural consistency. + */ + APPLICATION("application", NetconfLayer.CONTENT, RpcError.ErrorType.APPLICATION); + + private static final Map BY_ELEMENT_BODY = + Maps.uniqueIndex(Arrays.asList(values()), ErrorType::elementBody); + + private final RpcError.ErrorType legacy; + private final String elementBody; + private final NetconfLayer layer; + + ErrorType(final String elementName, final NetconfLayer layer, final RpcError.ErrorType legacy) { + this.elementBody = requireNonNull(elementName); + this.layer = requireNonNull(layer); + this.legacy = requireNonNull(legacy); + } + + /** + * Return the XML element body of this object. + * + * @return element body of this object + */ + public String elementBody() { + return elementBody; + } + + /** + * Return the {@link NetconfLayer} corresponding to this error type. + * + * @return A NETCONF layer + */ + public final NetconfLayer layer() { + return layer; + } + + @Deprecated + public final RpcError.ErrorType toLegacy() { + return legacy; + } + + public static @Nullable ErrorType forElementBody(final String elementBody) { + return BY_ELEMENT_BODY.get(requireNonNull(elementBody)); + } +} \ No newline at end of file diff --git a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/NetconfLayer.java b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/NetconfLayer.java new file mode 100644 index 0000000000..ef346f371e --- /dev/null +++ b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/NetconfLayer.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.yangtools.yang.common; + +/** + * Enumeration of NETCONF layers, as established in + * NETCONF. This enumeration exists because + * its semantics are implied by RFC6020 references to {@code error-tag} and its XML encoding. + * + *

+ * This enumeration corresponds to the {@code Layer} in: + *


+ *   NETCONF can be conceptually partitioned into four layers:
+ *
+ *              Layer                      Example
+ *         +-------------+      +-----------------------------+
+ *     (4) |   Content   |      |     Configuration data      |
+ *         +-------------+      +-----------------------------+
+ *                |                           |
+ *         +-------------+      +-----------------------------+
+ *     (3) | Operations  |      | <get-config>, <edit-config> |
+ *         +-------------+      +-----------------------------+
+ *                |                           |
+ *         +-------------+      +-----------------------------+
+ *     (2) |     RPC     |      |    <rpc>, <rpc-reply>       |
+ *         +-------------+      +-----------------------------+
+ *                |                           |
+ *         +-------------+      +-----------------------------+
+ *     (1) |  Transport  |      |   BEEP, SSH, SSL, console   |
+ *         |   Protocol  |      |                             |
+ *         +-------------+      +-----------------------------+
+ * 
+ * as acknowledged in RFC6241: + *
+ *   The YANG data modeling language [RFC6020] has been developed for
+ *   specifying NETCONF data models and protocol operations, covering the
+ *   Operations and the Content layers of Figure 1.
+ * 
+ */ +public enum NetconfLayer { + /** + * Content layer, for example configuration data. This layer is implied indirectly in constructs defined in + * {@link YangError} and corresponds to {@link ErrorType#APPLICATION} + */ + CONTENT, + /** + * Operations layer, for example {@code }, {@code } configuration data. This corresponds to + * {@link ErrorType#PROTOCOL}. + */ + OPERATIONS, + /** + * RPC layer, for example {@code }, {@code }. This corresponds to {@link ErrorType#RPC}. + */ + RPC, + /** + * Transport protocol layer, for example BEEP, SSH, TLS, console. This corresponds to {@link ErrorType#TRANSPORT}. + */ + TRANSPORT; +} diff --git a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/RpcError.java b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/RpcError.java index b1a79f402d..ac10b77947 100644 --- a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/RpcError.java +++ b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/RpcError.java @@ -7,37 +7,76 @@ */ package org.opendaylight.yangtools.yang.common; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Representation of an error. - * */ public interface RpcError { - + // FIXME: 8.0.0: remove this in favor of Netconf.ErrorSeverity + @NonNullByDefault enum ErrorSeverity { - ERROR, - WARNING + ERROR { + @Override + public org.opendaylight.yangtools.yang.common.ErrorSeverity toNetconf() { + return org.opendaylight.yangtools.yang.common.ErrorSeverity.ERROR; + } + }, + WARNING { + @Override + public org.opendaylight.yangtools.yang.common.ErrorSeverity toNetconf() { + return org.opendaylight.yangtools.yang.common.ErrorSeverity.WARNING; + } + }; + + public abstract org.opendaylight.yangtools.yang.common.ErrorSeverity toNetconf(); } + /** + * Enumeration of {@code error-type} values. These provide glue between {@link NetconfLayer} and various sources of + * such errors. + */ + // FIXME: 8.0.0: remove this in favor of common.ErrorType + @NonNullByDefault enum ErrorType { /** * Indicates an error occurred during transport of data, eg over the network. */ - TRANSPORT, - + TRANSPORT { + @Override + public org.opendaylight.yangtools.yang.common.ErrorType toNetconf() { + return org.opendaylight.yangtools.yang.common.ErrorType.TRANSPORT; + } + }, /** * Indicates an error occurred during a remote procedure call. */ - RPC, - + RPC { + @Override + public org.opendaylight.yangtools.yang.common.ErrorType toNetconf() { + return org.opendaylight.yangtools.yang.common.ErrorType.RPC; + } + }, /** * Indicates an error at a protocol layer, eg if invalid data was passed by the caller. */ - PROTOCOL, - + PROTOCOL { + @Override + public org.opendaylight.yangtools.yang.common.ErrorType toNetconf() { + return org.opendaylight.yangtools.yang.common.ErrorType.PROTOCOL; + } + }, /** * Indicates an error occurred during internal processing. */ - APPLICATION + APPLICATION { + @Override + public org.opendaylight.yangtools.yang.common.ErrorType toNetconf() { + return org.opendaylight.yangtools.yang.common.ErrorType.APPLICATION; + } + }; + + public abstract org.opendaylight.yangtools.yang.common.ErrorType toNetconf(); } /** @@ -51,7 +90,9 @@ public interface RpcError { * Returns a short string that identifies the general type of error condition. * *

- * The following outlines suggested values as defined by netconf (RFC 6241): + * The following outlines suggested values as defined by + * (RFC6241): + * *

      *    access-denied
      *    bad-attribute
@@ -75,6 +116,7 @@ public interface RpcError {
      * 
* @return a string if available or null otherwise. */ + // FIXME: 8.0.0: return ErrorTag here String getTag(); /** @@ -99,6 +141,7 @@ public interface RpcError { * * @return a string if available or null otherwise. */ + // FIXME: YANGTOOLS-765: this is wrong and needs to be modeled at data-api layer with YangErrorInfo String getInfo(); /** diff --git a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/YangConstants.java b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/YangConstants.java index 61b63b6695..d6b83a3bda 100644 --- a/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/YangConstants.java +++ b/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/YangConstants.java @@ -87,6 +87,58 @@ public final class YangConstants { */ public static final String YANG_XPATH_FUNCTIONS_PREFIX = "yang"; + /** + * NETCONF protocol elements' namespace, as defined in + * RFC4741 section 3.1, in String format. + */ + public static final String NETCONF_NAMESPACE_STRING = "urn:ietf:params:xml:ns:netconf:base:1.0"; + + /** + * NETCONF protocol elements' namespace, as defined in + * RFC4741 section 3.1, in String format. + */ + public static final XMLNamespace NETCONF_NAMESPACE = XMLNamespace.of(NETCONF_NAMESPACE_STRING).intern(); + + /** + * NETCONF namespace bound to YANG through + * ietf-netconf@2011-06-01.yang. + */ + public static final QNameModule RFC6241_YANG_MODULE = + QNameModule.create(NETCONF_NAMESPACE, Revision.of("2011-06-01")).intern(); + + /** + * {@code bad-attribute}, value is the name of the attribute. + */ + public static final QName BAD_ATTRIBUTE_QNAME = QName.create(RFC6241_YANG_MODULE, "bad-attribute").intern(); + /** + * {@code bad-element}, value is the name of the element. + */ + public static final QName BAD_ELEMENT_QNAME = QName.create(RFC6241_YANG_MODULE, "bad-element").intern(); + /** + * {@code bad-namespace}, value is the name of the namespace. + */ + public static final QName BAD_NAMESPACE_QNAME = QName.create(RFC6241_YANG_MODULE, "bad-namespace").intern(); + /** + * {@code session-id}, value the session identifier, as modeled in {@code SessionIdOrZero}. + */ + public static final QName SESSION_ID_QNAME = QName.create(RFC6241_YANG_MODULE, "session-id").intern(); + @Deprecated(since = "RFC6241") + public static final QName ERR_ELEMENT_QNAME = QName.create(RFC6241_YANG_MODULE, "err-element").intern(); + @Deprecated(since = "RFC6241") + public static final QName NOOP_ELEMENT_QNAME = QName.create(RFC6241_YANG_MODULE, "noop-element").intern(); + @Deprecated(since = "RFC6241") + public static final QName OK_ELEMENT_QNAME = QName.create(RFC6241_YANG_MODULE, "ok-element").intern(); + /** + * {@code missing-choice} as defined in + * RFC6020, section 13.7. + */ + public static final QName MISSING_CHOICE_QNAME = QName.create(RFC6020_YANG_MODULE, "missing-choice").intern(); + /** + * {@code non-unique} as defined in + * RFC6020, section 13.1. + */ + public static final QName NON_UNIQUE_QNAME = QName.create(RFC6020_YANG_MODULE, "non-unique").intern(); + // Dummy template UnqualifiedQName. These are never leaked, but are used for efficient instantiation via // UnqualifiedQName#bindTo() private static final UnqualifiedQName DUMMY_OPERATION_INPUT = UnqualifiedQName.of("input"); diff --git a/model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java b/model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java index fbe0a60287..89774deb0d 100644 --- a/model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java +++ b/model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java @@ -22,6 +22,7 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; +import org.opendaylight.yangtools.yang.common.YangConstants; import org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression.QualifiedBound; /** @@ -40,7 +41,7 @@ public interface SchemaContext extends ContainerLike, Immutable { * QName of NETCONF top-level data node. */ // FIXME: YANGTOOLS-1074: we do not want this name - @NonNull QName NAME = QName.create(XMLNamespace.of("urn:ietf:params:xml:ns:netconf:base:1.0"), "data").intern(); + @NonNull QName NAME = QName.create(YangConstants.NETCONF_NAMESPACE, "data").intern(); /** * Returns data schema node instances which represents direct subnodes (like -- 2.36.6