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

How to use
getIdentifier
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.getIdentifier (Showing top 20 results out of 315)

origin: org.opendaylight.mdsal/mdsal-binding-dom-adapter

private LazyDataObjectModification(final BindingCodecTreeNode<T> codec, final DataTreeCandidateNode domData) {
  this.codec = Preconditions.checkNotNull(codec);
  this.domData = Preconditions.checkNotNull(domData);
  this.identifier = codec.deserializePathArgument(domData.getIdentifier());
}
origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

private LazyTreeNodeModification(final BindingTreeNodeCodec<T> codec, final DataTreeCandidateNode domData) {
  this.codec = Preconditions.checkNotNull(codec);
  this.domData = Preconditions.checkNotNull(domData);
  this.identifier = codec.deserializePathArgument(domData.getIdentifier());
}
origin: org.opendaylight.controller/sal-binding-broker-impl

private LazyDataObjectModification(final BindingCodecTreeNode<T> codec, final DataTreeCandidateNode domData) {
  this.codec = Preconditions.checkNotNull(codec);
  this.domData = Preconditions.checkNotNull(domData);
  this.identifier = codec.deserializePathArgument(domData.getIdentifier());
}
origin: org.opendaylight.controller/sal-binding-broker-impl

static BindingStructuralType from(final DataTreeCandidateNode domChildNode) {
  final Optional<NormalizedNode<?, ?>> dataBased = domChildNode.getDataAfter().or(domChildNode.getDataBefore());
  if(dataBased.isPresent()) {
    return from(dataBased.get());
  }
  return from(domChildNode.getIdentifier());
}
origin: org.opendaylight.mdsal/mdsal-binding-dom-adapter

public static BindingStructuralType from(final DataTreeCandidateNode domChildNode) {
  Optional<NormalizedNode<?, ?>> dataBased = domChildNode.getDataAfter();
  if (!dataBased.isPresent()) {
    dataBased = domChildNode.getDataBefore();
  }
  if (dataBased.isPresent()) {
    return from(dataBased.get());
  }
  return from(domChildNode.getIdentifier());
}
origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

static BindingStructuralType from(final DataTreeCandidateNode domChildNode) {
  Optional<NormalizedNode<?, ?>> dataBased = domChildNode.getDataAfter();
  if (!dataBased.isPresent()) {
    dataBased = domChildNode.getDataBefore();
  }
  if (dataBased.isPresent()) {
    return from(dataBased.get());
  }
  return from(domChildNode.getIdentifier());
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

private void filterOutAnyChangeOutsideEffRibsIn(final PeerId peerId, final DataTreeCandidateNode rootNode,
  final Map<RouteUpdateKey, RouteEntry> ret, final YangInstanceIdentifier rootPath, final DOMDataWriteTransaction tx) {
  final DataTreeCandidateNode ribIn = rootNode.getModifiedChild(EFFRIBIN_NID);
  if (ribIn == null) {
    LOG.trace("Skipping change {}", rootNode.getIdentifier());
    return;
  }
  final DataTreeCandidateNode table = ribIn.getModifiedChild(TABLES_NID).getModifiedChild(this.tableKey);
  if (table == null) {
    LOG.trace("Skipping change {}", rootNode.getIdentifier());
    return;
  }
  initializeTableWithExistentRoutes(table, peerId, rootPath, tx);
  updateNodes(table, peerId, tx, ret);
}
origin: opendaylight/yangtools

private static LeafRefContext getReferencedByCtxChild(final LeafRefContext referencedByCtx,
    final DataTreeCandidateNode childNode) {
  if (referencedByCtx == null) {
    return null;
  }
  final QName childQName = childNode.getIdentifier().getNodeType();
  LeafRefContext childReferencedByCtx = referencedByCtx.getReferencedChildByName(childQName);
  if (childReferencedByCtx == null) {
    final NormalizedNode<?, ?> data = childNode.getDataAfter().get();
    if (data instanceof MapEntryNode || data instanceof UnkeyedListEntryNode) {
      childReferencedByCtx = referencedByCtx;
    }
  }
  return childReferencedByCtx;
}
origin: org.opendaylight.yangtools/yang-data-impl

private static LeafRefContext getReferencingCtxChild(final LeafRefContext referencingCtx,
    final DataTreeCandidateNode childNode) {
  if (referencingCtx == null) {
    return null;
  }
  final QName childQName = childNode.getIdentifier().getNodeType();
  LeafRefContext childReferencingCtx = referencingCtx.getReferencingChildByName(childQName);
  if (childReferencingCtx == null) {
    final NormalizedNode<?, ?> data = childNode.getDataAfter().get();
    if (data instanceof MapEntryNode || data instanceof UnkeyedListEntryNode) {
      childReferencingCtx = referencingCtx;
    }
  }
  return childReferencingCtx;
}
origin: org.opendaylight.yangtools/yang-data-impl

private static LeafRefContext getReferencedByCtxChild(final LeafRefContext referencedByCtx,
    final DataTreeCandidateNode childNode) {
  if (referencedByCtx == null) {
    return null;
  }
  final QName childQName = childNode.getIdentifier().getNodeType();
  LeafRefContext childReferencedByCtx = referencedByCtx.getReferencedChildByName(childQName);
  if (childReferencedByCtx == null) {
    final NormalizedNode<?, ?> data = childNode.getDataAfter().get();
    if (data instanceof MapEntryNode || data instanceof UnkeyedListEntryNode) {
      childReferencedByCtx = referencedByCtx;
    }
  }
  return childReferencedByCtx;
}
origin: opendaylight/yangtools

private static LeafRefContext getReferencingCtxChild(final LeafRefContext referencingCtx,
    final DataTreeCandidateNode childNode) {
  if (referencingCtx == null) {
    return null;
  }
  final QName childQName = childNode.getIdentifier().getNodeType();
  LeafRefContext childReferencingCtx = referencingCtx.getReferencingChildByName(childQName);
  if (childReferencingCtx == null) {
    final NormalizedNode<?, ?> data = childNode.getDataAfter().get();
    if (data instanceof MapEntryNode || data instanceof UnkeyedListEntryNode) {
      childReferencingCtx = referencingCtx;
    }
  }
  return childReferencingCtx;
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

@Override
public void onTablesChanged(final PeerId peerId, final DataTreeCandidateNode tablesChange) {
  final NodeIdentifierWithPredicates supTablesKey = RibSupportUtils.toYangKey(SupportedTables.QNAME, this.localTableKey);
  final DataTreeCandidateNode localTableNode = tablesChange.getModifiedChild(supTablesKey);
  if (localTableNode != null) {
    final Optional<NormalizedNode<?, ?>> dataAfter = localTableNode.getDataAfter();
    processSupportedSendReceiveTables(localTableNode.getModifiedChild(SEND_RECEIVE_NID), peerId);
    if (dataAfter.isPresent()) {
      final boolean added = this.peerTables.add(peerId);
      if (added) {
        LOG.debug("Supported table {} added to peer {}", this.localTableKey, peerId);
      }
    } else {
      final NodeIdentifierWithPredicates value = (NodeIdentifierWithPredicates) localTableNode.getIdentifier();
      this.peerTables.remove(peerId);
      LOG.debug("Removed tables {} from peer {}", value, peerId);
    }
  }
}
origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

private static void populateList(final List<TreeNodeModification<? extends TreeNode>> result,
    final BindingTreeNodeCodec<?> parentCodec, final Collection<DataTreeCandidateNode> domChildNodes) {
  for (final DataTreeCandidateNode domChildNode : domChildNodes) {
    final BindingStructuralType type = BindingStructuralType.from(domChildNode);
    if (type != BindingStructuralType.NOT_ADDRESSABLE) {
      /*
       * Even if type is UNKNOWN, from perspective of BindingStructuralType we try to load codec for
       * it. We will use that type to further specify debug log.
       */
      try {
        final BindingTreeNodeCodec<?> childCodec =
            parentCodec.yangPathArgumentChild(domChildNode.getIdentifier());
        populateList(result, type, childCodec, domChildNode);
      } catch (final IllegalArgumentException e) {
        if (type == BindingStructuralType.UNKNOWN) {
          LOG.debug("Unable to deserialize unknown DOM node {}", domChildNode, e);
        } else {
          LOG.debug("Binding representation for DOM node {} was not found", domChildNode, e);
        }
      }
    }
  }
}
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.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);
        }
      }
    }
  }
}
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: opendaylight/yangtools

private void validateChildren(final LeafRefContext rootLeafRefCtx, final Collection<DataTreeCandidateNode> children)
    throws LeafRefDataValidationFailedException {
  for (final DataTreeCandidateNode dataTreeCandidateNode : children) {
    if (dataTreeCandidateNode.getModificationType() != ModificationType.UNMODIFIED) {
      final PathArgument identifier = dataTreeCandidateNode.getIdentifier();
      final QName childQName = identifier.getNodeType();
      final LeafRefContext referencedByCtx = rootLeafRefCtx.getReferencedChildByName(childQName);
      final LeafRefContext referencingCtx = rootLeafRefCtx.getReferencingChildByName(childQName);
      if (referencedByCtx != null || referencingCtx != null) {
        validateNode(dataTreeCandidateNode, referencedByCtx, referencingCtx,
          YangInstanceIdentifier.create(identifier));
      }
    }
  }
  if (!errorsMessages.isEmpty()) {
    final StringBuilder message = new StringBuilder();
    int errCount = 0;
    for (final String errorMessage : errorsMessages) {
      message.append(errorMessage);
      errCount++;
    }
    throw new LeafRefDataValidationFailedException(message.toString(), errCount);
  }
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

private void filterOutPeerRole(final PeerId peerId, final DataTreeCandidateNode rootNode, final YangInstanceIdentifier rootPath) {
  final DataTreeCandidateNode roleChange = rootNode.getModifiedChild(PEER_ROLE_NID);
  if (roleChange != null) {
    if (rootNode.getModificationType() != ModificationType.DELETE) {
      this.cacheDisconnectedPeers.reconnected(peerId);
    }
    // Check for removal
    final Optional<NormalizedNode<?, ?>> maybePeerRole = roleChange.getDataAfter();
    final YangInstanceIdentifier peerPath = IdentifierUtils.peerPath(rootPath);
    LOG.debug("Data Changed for Peer role {} path {}, dataBefore {}, dataAfter {}", roleChange.getIdentifier(),
      peerPath , roleChange.getDataBefore(), maybePeerRole);
    final PeerRole role = PeerRoleUtil.roleForChange(maybePeerRole);
    final SimpleRoutingPolicy srp = getSimpleRoutingPolicy(rootNode);
    if(SimpleRoutingPolicy.AnnounceNone == srp) {
      return;
    }
    this.peerPolicyTracker.peerRoleChanged(peerPath, role);
  }
}
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.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()));
      }
    }
  }
}
org.opendaylight.yangtools.yang.data.api.schema.treeDataTreeCandidateNodegetIdentifier

Javadoc

Get the node identifier.

Popular methods of DataTreeCandidateNode

  • getChildNodes
    Get an unmodifiable collection of modified child nodes.
  • 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

  • Start an intent from android
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • putExtra (Intent)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JOptionPane (javax.swing)
  • 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