@Override public NodeCodecContext<?> yangPathArgumentChild(final YangInstanceIdentifier.PathArgument arg) { final DataContainerCodecPrototype<?> cazeProto; if (arg instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates) { cazeProto = byYangCaseChild.get(new NodeIdentifier(arg.getNodeType())); } else { cazeProto = byYangCaseChild.get(arg); } return childNonNull(cazeProto, arg, "Argument %s is not valid child of %s", arg, getSchema()).get() .yangPathArgumentChild(arg); }
@Override public void startMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Starting a new map node"); startNode(name.getNodeType(), NodeTypes.MAP_NODE); }
protected ImmutableMapNodeSchemaAwareBuilder(final ListSchemaNode schema) { this.schema = requireNonNull(schema); super.withNodeIdentifier(NodeIdentifier.create(schema.getQName())); }
private void writeRouteTables(final DataTreeCandidateNode child, final PathArgument childIdentifier, final DOMDataWriteTransaction tx, final RIBSupport ribSupport, final AbstractImportPolicy policy, final YangInstanceIdentifier childPath, final Optional<NormalizedNode<?, ?>> childDataAfter) { if (TABLE_ROUTES.equals(childIdentifier)) { final Collection<DataTreeCandidateNode> changedRoutes = ribSupport.changedRoutes(child); if (!changedRoutes.isEmpty()) { tx.put(LogicalDatastoreType.OPERATIONAL, childPath, childDataAfter.get()); // Routes are special, as they may end up being filtered. The previous put conveniently // ensured that we have them in at target, so a subsequent delete will not fail :) for (final DataTreeCandidateNode route : changedRoutes) { processRoute(tx, ribSupport, policy, childPath, route); } } } }
UnkeyedListMixinNormalization(final ListSchemaNode list) { super(NodeIdentifier.create(list.getQName())); this.innerNode = new UnkeyedListItemNormalization(list); }
private ImmutableContainerNodeSchemaAwareBuilder(final ContainerSchemaNode schema, final ImmutableContainerNode node) { super(node); this.validator = new DataNodeContainerValidator(schema); super.withNodeIdentifier(NodeIdentifier.create(schema.getQName())); }
private ImmutableYangModeledAnyXmlNodeBuilder(final YangModeledAnyXmlSchemaNode yangModeledAnyXMLSchemaNode, final int sizeHint) { super(sizeHint); requireNonNull(yangModeledAnyXMLSchemaNode, "Yang modeled any xml node must not be null."); super.withNodeIdentifier(NodeIdentifier.create(yangModeledAnyXMLSchemaNode.getQName())); this.contentSchema = yangModeledAnyXMLSchemaNode.getSchemaOfAnyXmlData(); }
UnorderedLeafListMixinContextNode(final LeafListSchemaNode potential) { super(NodeIdentifier.create(potential.getQName()), potential); innerOp = new LeafListEntryContextNode(potential); }
private ImmutableContainerNodeSchemaAwareBuilder(final ContainerSchemaNode schema) { this.validator = new DataNodeContainerValidator(schema); super.withNodeIdentifier(NodeIdentifier.create(schema.getQName())); }
ActionAdapter(final BindingToNormalizedNodeCodec codec, final DOMActionService delegate, final Class<? extends Action<?, ?, ?>> type) { super(codec, delegate); this.type = requireNonNull(type); this.schemaPath = getCodec().getActionPath(type); this.inputName = NodeIdentifier.create(operationInputQName(schemaPath.getLastComponent().getModule())); }
private void processModifiedRouteTables(final DataTreeCandidateNode child, final PathArgument childIdentifier, final DOMDataWriteTransaction tx, final RIBSupport ribSupport, final AbstractImportPolicy policy, final YangInstanceIdentifier childPath, final Optional<NormalizedNode<?, ?>> childDataAfter) { if (TABLE_ROUTES.equals(childIdentifier)) { for (final DataTreeCandidateNode route : ribSupport.changedRoutes(child)) { processRoute(tx, ribSupport, policy, childPath, route); } } else { tx.put(LogicalDatastoreType.OPERATIONAL, childPath, childDataAfter.get()); } }
private ContainerNode createMirrors(final Mirror mirror, final Timestamp timestamp) { final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(Mirrors.QNAME)); builder.withChild(ImmutableNodes.leafNode(PEER_MIRROR_INFORMATION_QNAME, toDom(MirrorInformationCode.forValue( mirror.getTlvs().getMirrorInformationTlv().getCode().getIntValue())))); builder.withChild(ImmutableNodes.leafNode(PEER_MIRROR_TIMESTAMP_QNAME, timestamp.getValue())); return builder.build(); }
private ContainerNode createStats(final Stat stat, final Timestamp timestamp) { final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(Stats.QNAME)); builder.withChild(ImmutableNodes.leafNode(PEER_STATS_TIMESTAMP_QNAME, timestamp.getValue())); final Tlvs tlvs = stat.getTlvs(); if (tlvs != null) { statsForTlvs(tlvs, builder); } return builder.build(); }
private LazySerializedContainerNode(final QName identifier, final TreeNode binding, final BindingNormalizedNodeCodecRegistry registry) { this.identifier = NodeIdentifier.create(identifier); this.bindingData = binding; this.registry = registry; this.domData = null; }
/** * Constructs a new Instance Identifier with new {@link NodeIdentifier} added to the end of path arguments. * * @param name QName of {@link NodeIdentifier} * @return Instance Identifier with additional path argument added to the end. */ public final YangInstanceIdentifier node(final QName name) { return node(new NodeIdentifier(name)); }
@Override public DataSchemaContextNode<?> getChild(final PathArgument child) { if (child.getNodeType().equals(getIdentifier().getNodeType())) { return innerNode; } return null; }
@Override public void startUnkeyedListItem(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalStateException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Starting a new unkeyed list item"); startNode(name.getNodeType(), NodeTypes.UNKEYED_LIST_ITEM); }
@Override public void startUnkeyedList(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Starting a new unkeyed list"); startNode(name.getNodeType(), NodeTypes.UNKEYED_LIST); }
@Override public void leafNode(final NodeIdentifier name, final Object value) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Writing a new leaf node"); startNode(name.getNodeType(), NodeTypes.LEAF_NODE); writeObject(value); }
/** * Lazily translates supplied Binding action output into NormalizedNode data. * * @param action Binding action class * @param output Binding action output * @return NormalizedNode representation of action output */ @Beta default @NonNull BindingLazyContainerNode<RpcOutput> toLazyNormalizedNodeActionOutput( @NonNull final Class<? extends Action<?, ?, ?>> action, @NonNull final RpcOutput output) { return toLazyNormalizedNodeActionOutput(action, new NodeIdentifier(YangConstants.operationInputQName(BindingReflections.getQNameModule(action))), output); }