private static String toString(AugmentationIdentifier pathArgument){ Set<QName> childNames = pathArgument.getPossibleChildNames(); final StringBuilder sb = new StringBuilder("AugmentationIdentifier{"); sb.append("childNames=").append(childNames).append('}'); return sb.toString(); }
private static QName extractName(final PathArgument child) { if (child instanceof YangInstanceIdentifier.AugmentationIdentifier) { final Set<QName> children = ((YangInstanceIdentifier.AugmentationIdentifier) child).getPossibleChildNames(); Preconditions.checkArgument(!children.isEmpty(),"Augmentation without childs must not be used in data"); return children.iterator().next(); } return child.getNodeType(); } }
private static QName extractName(final PathArgument child) { if (child instanceof AugmentationIdentifier) { final Set<QName> children = ((AugmentationIdentifier) child).getPossibleChildNames(); Preconditions.checkArgument(!children.isEmpty(),"Augmentation without childs must not be used in data"); return children.iterator().next(); } return child.getNodeType(); } }
public static boolean belongsToCaseAugment(final CaseSchemaNode caseNode, final AugmentationIdentifier childToProcess) { for (final AugmentationSchemaNode augmentationSchema : caseNode.getAvailableAugmentations()) { final Set<QName> currentAugmentChildNodes = new HashSet<>(); for (final DataSchemaNode dataSchemaNode : augmentationSchema.getChildNodes()) { currentAugmentChildNodes.add(dataSchemaNode.getQName()); } if (childToProcess.getPossibleChildNames().equals(currentAugmentChildNodes)) { return true; } } return false; }
@Override protected Set<QName> getQNameIdentifiers() { return getIdentifier().getPossibleChildNames(); } }
@Override protected Set<QName> getQNameIdentifiers() { return getIdentifier().getPossibleChildNames(); }
@Override protected Object findSchemaForAugment(final ChoiceSchemaNode schema, final YangInstanceIdentifier.AugmentationIdentifier childToProcessId) { return SchemaUtils.findSchemaForAugment(schema, childToProcessId.getPossibleChildNames()); }
public static boolean belongsToCaseAugment(final CaseSchemaNode caseNode, final AugmentationIdentifier childToProcess) { for (final AugmentationSchemaNode augmentationSchema : caseNode.getAvailableAugmentations()) { final Set<QName> currentAugmentChildNodes = new HashSet<>(); for (final DataSchemaNode dataSchemaNode : augmentationSchema.getChildNodes()) { currentAugmentChildNodes.add(dataSchemaNode.getQName()); } if (childToProcess.getPossibleChildNames().equals(currentAugmentChildNodes)) { return true; } } return false; }
public static SchemaAwareApplyOperation from(final DataNodeContainer resolvedTree, final AugmentationTarget augSchemas, final AugmentationIdentifier identifier, final DataTreeConfiguration treeConfig) { for (final AugmentationSchemaNode potential : augSchemas.getAvailableAugmentations()) { for (final DataSchemaNode child : potential.getChildNodes()) { if (identifier.getPossibleChildNames().contains(child.getQName())) { return new AugmentationModificationStrategy(potential, resolvedTree, treeConfig); } } } return null; }
@Override public void startAugmentationNode(final AugmentationIdentifier identifier) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(identifier, "Node identifier should not be null"); LOG.debug("Starting a new augmentation node"); output.writeByte(NodeTypes.AUGMENTATION_NODE); writeQNameSet(identifier.getPossibleChildNames()); }
private DataSchemaContextNode<?> fromLocalSchema(final PathArgument child) { if (child instanceof AugmentationIdentifier) { return fromSchemaAndQNameChecked(schema, ((AugmentationIdentifier) child).getPossibleChildNames() .iterator().next()); } return fromSchemaAndQNameChecked(schema, child.getNodeType()); }
private InstanceIdToNodes<?> fromLocalSchema(final PathArgument child) { if (child instanceof AugmentationIdentifier) { return fromSchemaAndQNameChecked(schema, ((AugmentationIdentifier) child).getPossibleChildNames() .iterator().next()); } return fromSchemaAndQNameChecked(schema, child.getNodeType()); }
public static SchemaAwareApplyOperation from(final DataNodeContainer resolvedTree, final AugmentationTarget augSchemas, final AugmentationIdentifier identifier, final DataTreeConfiguration treeConfig) { for (final AugmentationSchemaNode potential : augSchemas.getAvailableAugmentations()) { for (final DataSchemaNode child : potential.getChildNodes()) { if (identifier.getPossibleChildNames().contains(child.getQName())) { return new AugmentationModificationStrategy(potential, resolvedTree, treeConfig); } } } return null; }
private InstanceIdToNodes<?> fromLocalSchema(final PathArgument child) { if (child instanceof AugmentationIdentifier) { return fromSchemaAndQNameChecked(schema, ((AugmentationIdentifier) child).getPossibleChildNames() .iterator().next()); } return fromSchemaAndQNameChecked(schema, child.getNodeType()); }
@Override public void startAugmentationNode(final AugmentationIdentifier identifier) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(identifier, "Node identifier should not be null"); LOG.trace("Starting a new augmentation node"); output.writeByte(NodeTypes.AUGMENTATION_NODE); writeQNameSet(identifier.getPossibleChildNames()); }
@Override protected Object findSchemaForAugment(ContainerSchemaNode schema, YangInstanceIdentifier.AugmentationIdentifier childToProcessId) { return SchemaUtils.findSchemaForAugment(schema, childToProcessId.getPossibleChildNames()); }
@Override protected Set<QName> getQNameIdentifiers() { return getIdentifier().getPossibleChildNames(); } }
private DataNormalizationOperation<?> fromLocalSchema(final PathArgument child) throws DataNormalizationException { if (child instanceof AugmentationIdentifier) { return fromSchemaAndQNameChecked(schema, ((AugmentationIdentifier) child).getPossibleChildNames() .iterator().next()); } return fromSchemaAndQNameChecked(schema, child.getNodeType()); }
private AugmentationIdentifier transform(final AugmentationIdentifier identifier) { ImmutableSet.Builder<QName> builder = ImmutableSet.builder(); for (QName original : identifier.getPossibleChildNames()) { builder.add(transform(original)); } return new AugmentationIdentifier(builder.build()); }
private DataSchemaContextNode<?> fromLocalSchema(final PathArgument child) { if (child instanceof AugmentationIdentifier) { return fromSchemaAndQNameChecked(schema, ((AugmentationIdentifier) child).getPossibleChildNames() .iterator().next()); } return fromSchemaAndQNameChecked(schema, child.getNodeType()); }