requireNonNull(input);
final var actionResultFuture = listener.sendRequest(
- messageTransformer.toActionRequest(schemaPath, dataTreeIdentifier, input),
- input.getIdentifier().getNodeType());
+ messageTransformer.toActionRequest(schemaPath, dataTreeIdentifier, input), input.name().getNodeType());
return Futures.transform(actionResultFuture, netconfMessageRpcResult -> {
if (netconfMessageRpcResult != null) {
checkState(modulesStateNode instanceof ContainerNode, "Expecting container containing module list, but was %s",
modulesStateNode);
final ContainerNode modulesState = (ContainerNode) modulesStateNode;
- final NodeIdentifier nodeName = modulesState.getIdentifier();
+ final NodeIdentifier nodeName = modulesState.name();
checkState(MODULES_STATE_NID.equals(nodeName), "Wrong container identifier %s", nodeName);
return create((ContainerNode) modulesStateNode);
}
private static @Nullable Entry<QName, URL> createFromEntry(final MapEntryNode moduleNode) {
- final QName moduleNodeId = moduleNode.getIdentifier().getNodeType();
+ final QName moduleNodeId = moduleNode.name().getNodeType();
checkArgument(moduleNodeId.equals(Module.QNAME), "Wrong QName %s", moduleNodeId);
final String moduleName = getSingleChildNodeValue(moduleNode, NAME_NID).orElseThrow();
@Override
public void onSuccess(final DOMRpcResult domRpcResult) {
notificationHandler.addNotificationFilter(notification -> {
- if (NetconfCapabilityChange.QNAME.equals(notification.getBody().getIdentifier().getNodeType())) {
+ if (NetconfCapabilityChange.QNAME.equals(notification.getBody().name().getNodeType())) {
LOG.info("{}: Schemas change detected, reconnecting", id);
// Only disconnect is enough,
// the reconnecting nature of the connector will take care of reconnecting
static Optional<RemoteYangSchema> createFromNormalizedNode(final RemoteDeviceId id,
final MapEntryNode schemaNode) {
- final QName schemaNodeId = schemaNode.getIdentifier().getNodeType();
+ final QName schemaNodeId = schemaNode.name().getNodeType();
checkArgument(schemaNodeId.equals(Schema.QNAME), "Wrong QName %s", schemaNodeId);
QName childNode = NetconfMessageTransformUtil.IETF_NETCONF_MONITORING_SCHEMA_FORMAT;
NetconfDeviceNotification(final ContainerNode content, final Instant eventTime) {
this.content = content;
this.eventTime = eventTime;
- schemaPath = Absolute.of(content.getIdentifier().getNodeType());
+ schemaPath = Absolute.of(content.name().getNodeType());
}
NetconfDeviceNotification(final ContainerNode content, final Absolute schemaPath, final Instant eventTime) {
final ContainerNode root = domNotification.getBody();
assertNotNull(root);
assertEquals(6, root.body().size());
- assertEquals("user-visited-page", root.getIdentifier().getNodeType().getLocalName());
+ assertEquals("user-visited-page", root.name().getNodeType().getLocalName());
assertEquals(NotificationMessage.RFC3339_DATE_PARSER.apply("2015-10-23T09:42:27.67175+00:00"),
((DOMEvent) domNotification).getEventInstant());
}
NetconfMessageTransformUtil.NETCONF_GET_CONFIG_QNAME);
assertNotNull(result.value());
final ContainerNode rpcReply = result.value();
- assertEquals(NetconfMessageTransformUtil.NETCONF_RPC_REPLY_QNAME, rpcReply.getIdentifier().getNodeType());
+ assertEquals(NetconfMessageTransformUtil.NETCONF_RPC_REPLY_QNAME, rpcReply.name().getNodeType());
final DOMSourceAnyxmlNode data =
(DOMSourceAnyxmlNode) rpcReply.getChildByArg(NetconfMessageTransformUtil.NETCONF_DATA_NODEID);
final Diff diff = XMLUnit.compareXML(dataElement.getOwnerDocument(), (Document) data.body().getNode());
public void testGetConfigRunningData() throws Exception {
final var dataOpt = baseOps.getConfigRunningData(callback, Optional.of(YangInstanceIdentifier.of())).get();
assertTrue(dataOpt.isPresent());
- assertEquals(NormalizedDataUtil.NETCONF_DATA_QNAME, dataOpt.orElseThrow().getIdentifier().getNodeType());
+ assertEquals(NormalizedDataUtil.NETCONF_DATA_QNAME, dataOpt.orElseThrow().name().getNodeType());
}
@Test
public void testGetData() throws Exception {
final var dataOpt = baseOps.getData(callback, Optional.of(YangInstanceIdentifier.of())).get();
assertTrue(dataOpt.isPresent());
- assertEquals(NormalizedDataUtil.NETCONF_DATA_QNAME, dataOpt.orElseThrow().getIdentifier().getNodeType());
+ assertEquals(NormalizedDataUtil.NETCONF_DATA_QNAME, dataOpt.orElseThrow().name().getNodeType());
}
@Test
final Map<QName, Object> keys = new HashMap<>();
for (final DataContainerChild value : values) {
- keys.put(value.getIdentifier().getNodeType(), value.body());
+ keys.put(value.name().getNodeType(), value.body());
}
final NodeIdentifierWithPredicates identifierWithPredicates =
final Map<QName, Object> keys = new HashMap<>();
for (final DataContainerChild value : values) {
- keys.put(value.getIdentifier().getNodeType(), value.body());
+ keys.put(value.name().getNodeType(), value.body());
}
final NodeIdentifierWithPredicates identifierWithPredicates =
public void testInvokeRpc() throws Exception {
ContainerNode input = createNode("urn:ietf:params:xml:ns:netconf:base:1.0", "2011-06-01", "filter");
final DOMRpcResult result = rpc.invokeRpc(type, input).get();
- assertEquals(expectedReply.value().getIdentifier(), result.value().getIdentifier());
+ assertEquals(expectedReply.value().name(), result.value().name());
assertEquals(resolveNode(expectedReply), resolveNode(result));
}