import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.GET_SCHEMA_QNAME;
-import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DATA_QNAME;
+import static org.opendaylight.netconf.util.NetconfUtil.NETCONF_DATA_QNAME;
import com.google.common.base.MoreObjects;
import com.google.common.util.concurrent.Futures;
*/
package org.opendaylight.netconf.sal.connect.netconf.util;
+import static org.opendaylight.netconf.util.NetconfUtil.NETCONF_DATA_QNAME;
+import static org.opendaylight.netconf.util.NetconfUtil.NETCONF_QNAME;
+
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
public static final QName IETF_NETCONF_NOTIFICATIONS =
QName.create(NetconfCapabilityChange.QNAME, "ietf-netconf-notifications").intern();
- public static final QName NETCONF_QNAME =
- QName.create("urn:ietf:params:xml:ns:netconf:base:1.0", "2011-06-01", "netconf").intern();
public static final URI NETCONF_URI = NETCONF_QNAME.getNamespace();
- public static final QName NETCONF_DATA_QNAME = QName.create(NETCONF_QNAME, "data").intern();
public static final NodeIdentifier NETCONF_DATA_NODEID = NodeIdentifier.create(NETCONF_DATA_QNAME);
public static final QName NETCONF_RPC_REPLY_QNAME = QName.create(NETCONF_QNAME, "rpc-reply").intern();
.build();
}
- private static NormalizedMetadata leafMetadata(YangInstanceIdentifier path, final ModifyAction oper) {
+ private static NormalizedMetadata leafMetadata(final YangInstanceIdentifier path, final ModifyAction oper) {
final List<PathArgument> args = path.getPathArguments();
final Deque<Builder> builders = new ArrayDeque<>(args.size());
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_CONFIG_NODEID;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_CONFIG_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DATA_NODEID;
-import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DATA_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_FILTER_NODEID;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_FILTER_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_OPERATION_QNAME;
+import static org.opendaylight.netconf.util.NetconfUtil.NETCONF_DATA_QNAME;
import com.google.common.base.Preconditions;
import java.util.Collections;
.withChild(compositeNodeSchemas)
.build();
final ContainerNode data = Builders.containerBuilder()
- .withNodeIdentifier(new YangInstanceIdentifier
- .NodeIdentifier(NetconfMessageTransformUtil.NETCONF_DATA_QNAME))
+ .withNodeIdentifier(NetconfMessageTransformUtil.NETCONF_DATA_NODEID)
.withChild(netconfState)
.build();
final ContainerNode rpcReply = Builders.containerBuilder()
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
Assert.assertEquals(resolveNode(expectedReply), resolveNode(result));
}
- private Node resolveNode(final DOMRpcResult result) {
- DataContainerChild<? extends PathArgument, ?> value = ((ContainerNode) result.getResult())
- .getChild(NodeIdentifier.create(NetconfMessageTransformUtil.NETCONF_DATA_QNAME)).get();
+ private static Node resolveNode(final DOMRpcResult result) {
+ DataContainerChild<?, ?> value = ((ContainerNode) result.getResult())
+ .getChild(NetconfMessageTransformUtil.NETCONF_DATA_NODEID).get();
Node node = ((AnyXmlNode)value).getValue().getNode();
assertNotNull(node);
return node;
Assert.assertNotNull(result.getResult());
final ContainerNode rpcReply = (ContainerNode) result.getResult();
Assert.assertEquals(NetconfMessageTransformUtil.NETCONF_RPC_REPLY_QNAME, rpcReply.getNodeType());
- final Optional<?> dataOpt = rpcReply.getChild(
- new YangInstanceIdentifier.NodeIdentifier(NetconfMessageTransformUtil.NETCONF_DATA_QNAME));
+ final Optional<?> dataOpt = rpcReply.getChild(NetconfMessageTransformUtil.NETCONF_DATA_NODEID);
Assert.assertTrue(dataOpt.isPresent());
final AnyXmlNode data = (AnyXmlNode) dataOpt.get();
final Diff diff = XMLUnit.compareXML(dataElement.getOwnerDocument(), (Document) data.getValue().getNode());
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.GET_SCHEMA_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_CANDIDATE_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_COMMIT_QNAME;
-import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DATA_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_DISCARD_CHANGES_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_EDIT_CONFIG_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_GET_CONFIG_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toId;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toPath;
+import static org.opendaylight.netconf.util.NetconfUtil.NETCONF_DATA_QNAME;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
private static Node checkBasePartOfActionRequest(final NetconfMessage actionRequest) {
Node baseRpc = actionRequest.getDocument().getFirstChild();
- checkNode(baseRpc, "rpc", "rpc", NetconfMessageTransformUtil.NETCONF_QNAME.getNamespace().toString());
+ checkNode(baseRpc, "rpc", "rpc", NetconfUtil.NETCONF_QNAME.getNamespace().toString());
assertTrue(baseRpc.getLocalName().equals("rpc"));
assertTrue(baseRpc.getNodeName().equals("rpc"));
import org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc;
import org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer;
import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
+import org.opendaylight.netconf.util.NetconfUtil;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
final Optional<NormalizedNode<?, ?>> dataOpt =
baseOps.getConfigRunningData(callback, Optional.of(YangInstanceIdentifier.EMPTY)).get();
Assert.assertTrue(dataOpt.isPresent());
- Assert.assertEquals(NetconfMessageTransformUtil.NETCONF_DATA_QNAME, dataOpt.get().getNodeType());
+ Assert.assertEquals(NetconfUtil.NETCONF_DATA_QNAME, dataOpt.get().getNodeType());
}
@Test
final Optional<NormalizedNode<?, ?>> dataOpt =
baseOps.getData(callback, Optional.of(YangInstanceIdentifier.EMPTY)).get();
Assert.assertTrue(dataOpt.isPresent());
- Assert.assertEquals(NetconfMessageTransformUtil.NETCONF_DATA_QNAME, dataOpt.get().getNodeType());
+ Assert.assertEquals(NetconfUtil.NETCONF_DATA_QNAME, dataOpt.get().getNodeType());
}
@Test