Tabnine Logo
DataTreeCandidateNode.getChildNodes
Code IndexAdd Tabnine to your IDE (free)

How to use
getChildNodes
method
in
org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode

Best Java code snippets using org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode.getChildNodes (Showing top 20 results out of 315)

origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

@Nonnull
@Override
public Collection<TreeNodeModification<? extends TreeNode>> getModifiedChildren() {
  if (childNodesCache == null) {
    childNodesCache = from(codec, domData.getChildNodes());
  }
  return childNodesCache;
}
origin: org.opendaylight.controller/sal-binding-broker-impl

@Override
public Collection<DataObjectModification<? extends DataObject>> getModifiedChildren() {
  if (childNodesCache == null) {
    childNodesCache = from(codec, domData.getChildNodes());
  }
  return childNodesCache;
}
origin: org.opendaylight.mdsal/mdsal-binding-dom-adapter

@Override
public Collection<LazyDataObjectModification<? extends DataObject>> getModifiedChildren() {
  Collection<LazyDataObjectModification<? extends DataObject>> local = childNodesCache;
  if (local == null) {
    childNodesCache = local = from(codec, domData.getChildNodes());
  }
  return local;
}
origin: org.opendaylight.controller/sal-binding-broker-impl

private static void populateList(final List<DataObjectModification<? extends DataObject>> result,
    final BindingStructuralType type, final BindingCodecTreeNode<?> childCodec,
    final DataTreeCandidateNode domChildNode) {
  switch (type) {
    case INVISIBLE_LIST:
      // We use parent codec intentionally.
      populateListWithSingleCodec(result, childCodec, domChildNode.getChildNodes());
      break;
    case INVISIBLE_CONTAINER:
      populateList(result, childCodec, domChildNode.getChildNodes());
      break;
    case UNKNOWN:
    case VISIBLE_CONTAINER:
      result.add(create(childCodec, domChildNode));
    default:
      break;
  }
}
origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

private static void populateList(final List<TreeNodeModification<? extends TreeNode>> result,
    final BindingStructuralType type, final BindingTreeNodeCodec<?> childCodec,
    final DataTreeCandidateNode domChildNode) {
  switch (type) {
    case INVISIBLE_LIST:
      // We use parent codec intentionally.
      populateListWithSingleCodec(result, childCodec, domChildNode.getChildNodes());
      break;
    case INVISIBLE_CONTAINER:
      populateList(result, childCodec, domChildNode.getChildNodes());
      break;
    case UNKNOWN:
    case VISIBLE_CONTAINER:
      result.add(create(childCodec, domChildNode));
      break;
    default:
  }
}
origin: org.opendaylight.mdsal/mdsal-binding-dom-adapter

private static void populateList(final List<LazyDataObjectModification<? extends DataObject>> result,
    final BindingStructuralType type, final BindingCodecTreeNode<?> childCodec,
    final DataTreeCandidateNode domChildNode) {
  switch (type) {
    case INVISIBLE_LIST:
      // We use parent codec intentionally.
      populateListWithSingleCodec(result, childCodec, domChildNode.getChildNodes());
      break;
    case INVISIBLE_CONTAINER:
      populateList(result, childCodec, domChildNode.getChildNodes());
      break;
    case UNKNOWN:
    case VISIBLE_CONTAINER:
      result.add(create(childCodec, domChildNode));
      break;
    default:
  }
}
origin: org.opendaylight.bgpcep/bgp-rib-spi

@Override
public final Collection<DataTreeCandidateNode> changedRoutes(final DataTreeCandidateNode routes) {
  final DataTreeCandidateNode myRoutes = routes.getModifiedChild(this.routesContainerIdentifier);
  if (myRoutes == null) {
    return Collections.emptySet();
  }
  final DataTreeCandidateNode routesMap = myRoutes.getModifiedChild(routeNid());
  if (routesMap == null) {
    return Collections.emptySet();
  }
  // Well, given the remote possibility of augmentation, we should perform a filter here,
  // to make sure the type matches what routeType() reports.
  return routesMap.getChildNodes();
}
origin: opendaylight/yangtools

public static void applyRootToCursor(final DataTreeModificationCursor cursor, final DataTreeCandidateNode node) {
  switch (node.getModificationType()) {
    case DELETE:
      throw new IllegalArgumentException("Can not delete root.");
    case WRITE:
    case SUBTREE_MODIFIED:
      AbstractNodeIterator iterator = new RootNonExitingIterator(node.getChildNodes().iterator());
      do {
        iterator = iterator.next(cursor);
      } while (iterator != null);
      break;
    case UNMODIFIED:
      // No-op
      break;
    default:
      throw new IllegalArgumentException("Unsupported modification " + node.getModificationType());
  }
}
origin: org.opendaylight.yangtools/yang-data-api

public static void applyRootToCursor(final DataTreeModificationCursor cursor, final DataTreeCandidateNode node) {
  switch (node.getModificationType()) {
    case DELETE:
      throw new IllegalArgumentException("Can not delete root.");
    case WRITE:
    case SUBTREE_MODIFIED:
      AbstractNodeIterator iterator = new RootNonExitingIterator(node.getChildNodes().iterator());
      do {
        iterator = iterator.next(cursor);
      } while (iterator != null);
      break;
    case UNMODIFIED:
      // No-op
      break;
    default:
      throw new IllegalArgumentException("Unsupported modification " + node.getModificationType());
  }
}
origin: opendaylight/yangtools

public static void validate(final DataTreeCandidate tree, final LeafRefContext rootLeafRefCtx)
    throws LeafRefDataValidationFailedException {
  final Optional<NormalizedNode<?, ?>> root = tree.getRootNode().getDataAfter();
  if (root.isPresent()) {
    new LeafRefValidation(root.get()).validateChildren(rootLeafRefCtx, tree.getRootNode().getChildNodes());
  }
}
origin: org.opendaylight.yangtools/yang-data-impl

public static void validate(final DataTreeCandidate tree, final LeafRefContext rootLeafRefCtx)
    throws LeafRefDataValidationFailedException {
  final Optional<NormalizedNode<?, ?>> root = tree.getRootNode().getDataAfter();
  if (root.isPresent()) {
    new LeafRefValidation(root.get()).validateChildren(rootLeafRefCtx, tree.getRootNode().getChildNodes());
  }
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

@Override
public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {
  LOG.debug("Data change received for AdjRibOut {}", changes);
  for (final DataTreeCandidate tc : changes) {
    LOG.trace("Change {} type {}", tc.getRootNode(), tc.getRootNode().getModificationType());
    for (final DataTreeCandidateNode child : tc.getRootNode().getChildNodes()) {
      processSupportedFamilyRoutes(child);
    }
  }
  this.session.flush();
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

private void writeTable(final DOMDataWriteTransaction tx, final NodeIdentifierWithPredicates tableKey, final DataTreeCandidateNode table) {
  final RIBSupportContext ribSupport = getRibSupport(tableKey);
  final YangInstanceIdentifier tablePath = effectiveTablePath(tableKey);
  // Create an empty table
  LOG.trace("Create Empty table", tablePath);
  ribSupport.createEmptyTableStructure(tx, tablePath);
  processTableChildren(tx, ribSupport.getRibSupport(), tablePath, table.getChildNodes());
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

@Override
public void onDataTreeChanged(@Nonnull final Collection<DataTreeCandidate> changes) {
  LOG.trace("Data changed called to effective RIB. Change : {}", changes);
  // we have a lot of transactions created for 'nothing' because a lot of changes
  // are skipped, so ensure we only create one transaction when we really need it
  DOMDataWriteTransaction tx = null;
  for (final DataTreeCandidate tc : changes) {
    final YangInstanceIdentifier rootPath = tc.getRootPath();
    final DataTreeCandidateNode root = tc.getRootNode();
    for (final DataTreeCandidateNode table : root.getChildNodes()) {
      if (tx == null) {
        tx = this.chain.newWriteOnlyTransaction();
      }
      changeDataTree(tx, rootPath, root, table);
    }
  }
  if (tx != null) {
    tx.submit();
  }
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

private void modifyTable(final DOMDataWriteTransaction tx, final NodeIdentifierWithPredicates tableKey, final DataTreeCandidateNode table) {
  final RIBSupportContext ribSupport = getRibSupport(tableKey);
  final YangInstanceIdentifier tablePath = effectiveTablePath(tableKey);
  processTableChildren(tx, ribSupport.getRibSupport(), tablePath, table.getChildNodes());
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

private void updateNodes(final DataTreeCandidateNode table, final PeerId peerId, final DOMDataWriteTransaction tx,
  final Map<RouteUpdateKey, RouteEntry> routes) {
  for (final DataTreeCandidateNode child : table.getChildNodes()) {
    LOG.debug("Modification type {}", child.getModificationType());
    if ((Attributes.QNAME).equals(child.getIdentifier().getNodeType())) {
      if (child.getDataAfter().isPresent()) {
        // putting uptodate attribute in
        LOG.trace("Uptodate found for {}", child.getDataAfter());
        tx.put(LogicalDatastoreType.OPERATIONAL, this.locRibTarget.node(child.getIdentifier()), child.getDataAfter().get());
      }
      continue;
    }
    updateRoutesEntries(child, peerId, routes);
  }
}
origin: io.fd.honeycomb/data-impl

Stream<Modification> streamChildren() {
  return dataCandidate.getChildNodes().stream()
    .map(child -> {
      final YangInstanceIdentifier childId = id.node(child.getIdentifier());
      final Object schemaChild = schemaChild(schemaNode, child.getIdentifier());
      // An augment cannot change other augment, so we do not update parent node if we are streaming
      // children of AugmentationSchema (otherwise we would fail to find schema for nested augmentations):
      if (updateParentNode) {
        if (schemaNode instanceof AugmentationSchemaNode) {
          // child nodes would not have nested augmentations, so we stop moving parentNode:
          return new Modification(childId, child, parentNode, schemaChild, false);
        } else {
          // update parent node:
          return new Modification(childId, child, schemaNode, schemaChild, true);
        }
      }
      return new Modification(childId, child, parentNode, schemaChild, updateParentNode);
    });
}
origin: org.opendaylight.yangtools/yang-data-impl

private void validateNode(final DataTreeCandidateNode node, final LeafRefContext referencedByCtx,
  final LeafRefContext referencingCtx, final YangInstanceIdentifier current) {
  if (node.getModificationType() == ModificationType.WRITE && node.getDataAfter().isPresent()) {
    validateNodeData(node.getDataAfter().get(), referencedByCtx, referencingCtx, node.getModificationType(),
      current);
    return;
  }
  if (node.getModificationType() == ModificationType.DELETE && referencedByCtx != null) {
    validateNodeData(node.getDataBefore().get(), referencedByCtx, null, node.getModificationType(), current);
    return;
  }
  for (final DataTreeCandidateNode childNode : node.getChildNodes()) {
    if (childNode.getModificationType() != ModificationType.UNMODIFIED) {
      final LeafRefContext childReferencedByCtx = getReferencedByCtxChild(referencedByCtx, childNode);
      final LeafRefContext childReferencingCtx = getReferencingCtxChild(referencingCtx, childNode);
      if (childReferencedByCtx != null || childReferencingCtx != null) {
        validateNode(childNode, childReferencedByCtx,childReferencingCtx,
          current.node(childNode.getIdentifier()));
      }
    }
  }
}
origin: opendaylight/yangtools

private void validateNode(final DataTreeCandidateNode node, final LeafRefContext referencedByCtx,
  final LeafRefContext referencingCtx, final YangInstanceIdentifier current) {
  if (node.getModificationType() == ModificationType.WRITE && node.getDataAfter().isPresent()) {
    validateNodeData(node.getDataAfter().get(), referencedByCtx, referencingCtx, node.getModificationType(),
      current);
    return;
  }
  if (node.getModificationType() == ModificationType.DELETE && referencedByCtx != null) {
    validateNodeData(node.getDataBefore().get(), referencedByCtx, null, node.getModificationType(), current);
    return;
  }
  for (final DataTreeCandidateNode childNode : node.getChildNodes()) {
    if (childNode.getModificationType() != ModificationType.UNMODIFIED) {
      final LeafRefContext childReferencedByCtx = getReferencedByCtxChild(referencedByCtx, childNode);
      final LeafRefContext childReferencingCtx = getReferencingCtxChild(referencingCtx, childNode);
      if (childReferencedByCtx != null || childReferencingCtx != null) {
        validateNode(childNode, childReferencedByCtx,childReferencingCtx,
          current.node(childNode.getIdentifier()));
      }
    }
  }
}
origin: org.opendaylight.controller/sal-core-spi

  private void notifyNode(final YangInstanceIdentifier path, final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regNode, final DataTreeCandidateNode candNode) {
    if (candNode.getModificationType() == ModificationType.UNMODIFIED) {
      LOG.debug("Skipping unmodified candidate {}", path);
      return;
    }

    final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> regs = regNode.getRegistrations();
    if (!regs.isEmpty()) {
      notifyListeners(regs, path, candNode);
    }

    for (DataTreeCandidateNode candChild : candNode.getChildNodes()) {
      if (candChild.getModificationType() != ModificationType.UNMODIFIED) {
        final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regChild = regNode.getExactChild(candChild.getIdentifier());
        if (regChild != null) {
          notifyNode(path.node(candChild.getIdentifier()), regChild, candChild);
        }

        for (RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> rc : regNode.getInexactChildren(candChild.getIdentifier())) {
          notifyNode(path.node(candChild.getIdentifier()), rc, candChild);
        }
      }
    }
  }
}
org.opendaylight.yangtools.yang.data.api.schema.treeDataTreeCandidateNodegetChildNodes

Javadoc

Get an unmodifiable collection of modified child nodes.

Popular methods of DataTreeCandidateNode

  • getIdentifier
    Get the node identifier.
  • getModificationType
    Return the type of modification this node is undergoing.
  • getDataAfter
    Return the after-image of data corresponding to the node.
  • getDataBefore
    Return the before-image of data corresponding to the node.
  • getModifiedChild
    Returns modified child or null if child was not modified / does not exists.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • JPanel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now