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

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

origin: io.fd.honeycomb/data-impl

com.google.common.base.Optional<NormalizedNode<?, ?>> getDataAfter() {
  // TODO(HONEYCOMB-192): switch to java.util.Optional when rest of ODL infra does
  return com.google.common.base.Optional.fromNullable(dataCandidate.getDataAfter().orElse(null));
}
origin: io.fd.honeycomb/data-impl

boolean isMixin() {
  // Checking whether node is a mixin is not performed on schema, but on data since mixin is
  // only a NormalizedNode concept, not a schema concept
  return dataCandidate.getDataBefore().orElse(null) instanceof MixinNode ||
      dataCandidate.getDataAfter().orElse(null) instanceof MixinNode;
}
origin: io.fd.honeycomb/data-impl

boolean isBeforeAndAfterDifferent() {
  if (dataCandidate.getDataBefore().isPresent()) {
    return !dataCandidate.getDataBefore().get().equals(dataCandidate.getDataAfter().orElse(null));
  }
  // considering not a modification if data after is also null
  return dataCandidate.getDataAfter().isPresent();
}
origin: org.opendaylight.controller/sal-binding-broker-impl

@Override
public T getDataAfter() {
  return deserialize(domData.getDataAfter());
}
origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

@Nullable
@Override
public T getDataAfter() {
  return deserialize(domData.getDataAfter());
}
origin: org.opendaylight.mdsal/mdsal-binding-dom-adapter

@Override
public T getDataAfter() {
  return deserialize(domData.getDataAfter());
}
origin: org.opendaylight.mdsal/mdsal-dom-spi

@Override
protected synchronized void appendInitial(final State state) {
  // We are still starting up, so all we need to do is squash reported changes to an initial write event
  final DataTreeCandidate last = Iterables.getLast(state.changes);
  changes.clear();
  final Optional<NormalizedNode<?, ?>> lastData = last.getRootNode().getDataAfter();
  if (lastData.isPresent()) {
    changes.add(DataTreeCandidates.fromNormalizedNode(last.getRootPath(), lastData.get()));
  }
}
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.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.bgpcep/bgp-rib-impl

private SimpleRoutingPolicy getSimpleRoutingPolicy(final DataTreeCandidateNode rootNode) {
  final DataTreeCandidateNode statusChange = rootNode.getModifiedChild(SIMPLE_ROUTING_POLICY_NID);
  if (statusChange != null) {
    final Optional<NormalizedNode<?, ?>> maybePeerStatus = statusChange.getDataAfter();
    if (maybePeerStatus.isPresent()) {
      return SimpleRoutingPolicy.valueOf(BindingMapping.getClassName((String) (maybePeerStatus.get()).getValue()));
    }
  }
  return null;
}
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: 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 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.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: 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.controller/sal-distributed-datastore

@Override
public void onDataTreeChanged(@Nonnull Collection<DataTreeCandidate> changes) {
  for (DataTreeCandidate change : changes) {
    DataTreeCandidateNode changeRoot = change.getRootNode();
    LeafNode<?> ownerLeaf = (LeafNode<?>) changeRoot.getDataAfter().get();
    String entityType = entityTypeFromEntityPath(change.getRootPath());
    String newOwner = extractOwner(ownerLeaf);
    if(!Strings.isNullOrEmpty(newOwner)) {
      updateStatistics(entityType, newOwner, 1);
    }
    Optional<NormalizedNode<?, ?>> dataBefore = changeRoot.getDataBefore();
    if (dataBefore.isPresent()) {
      String origOwner = extractOwner((LeafNode<?>) changeRoot.getDataBefore().get());
      if(!Strings.isNullOrEmpty(origOwner)) {
        updateStatistics(entityType, origOwner, -1);
      }
    }
  }
}
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);
  }
}
org.opendaylight.yangtools.yang.data.api.schema.treeDataTreeCandidateNodegetDataAfter

Javadoc

Return the after-image of data corresponding to the node.

Popular methods of DataTreeCandidateNode

  • getChildNodes
    Get an unmodifiable collection of modified child nodes.
  • getIdentifier
    Get the node identifier.
  • getModificationType
    Return the type of modification this node is undergoing.
  • 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

  • Making http requests using okhttp
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Github Copilot alternatives
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