All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
DataTreeModificationCursor

@Beta public interface DataTreeSnapshotCursor extends AutoCloseable
A cursor holding a logical position within a DataTreeSnapshot. It allows operations relative to that position, as well as moving the position up or down the tree. Implementations are expected to be NOT thread-safe.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close this cursor.
    void
    enter(@NonNull Iterable<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> path)
    Move the cursor to the specified child of the current position.
    void
    enter(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child)
    Move the cursor to the specified child of the current position.
    void
    enter(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument... path)
    Move the cursor to the specified child of the current position.
    void
    Move the cursor up to the parent of current position.
    void
    exit(int depth)
    Move the cursor up by specified amounts of steps from the current position.
    Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode>
    readNode(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child)
    Read a particular node from the snapshot.
  • Method Details

    • enter

      void enter(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child)
      Move the cursor to the specified child of the current position.
      Parameters:
      child - Child identifier
      Throws:
      BackendFailedException - when an implementation-specific error occurs while servicing the request.
      IllegalArgumentException - when specified identifier does not identify a valid child, or if that child is not an instance of NormalizedNodeContainer.
    • enter

      void enter(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument... path)
      Move the cursor to the specified child of the current position. This is the equivalent of multiple invocations of enter(PathArgument), except the operation is performed all at once.
      Parameters:
      path - Nested child identifier
      Throws:
      BackendFailedException - when an implementation-specific error occurs while servicing the request.
      IllegalArgumentException - when specified path does not identify a valid child, or if that child is not an instance of NormalizedNodeContainer.
    • enter

      void enter(@NonNull Iterable<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> path)
      Move the cursor to the specified child of the current position. This is equivalent to enter(PathArgument...), except it takes an Iterable argument.
      Parameters:
      path - Nested child identifier
      Throws:
      BackendFailedException - when an implementation-specific error occurs while servicing the request.
      IllegalArgumentException - when specified path does not identify a valid child, or if that child is not an instance of NormalizedNodeContainer.
    • exit

      void exit()
      Move the cursor up to the parent of current position. This is equivalent of invoking exit(1).
      Throws:
      IllegalStateException - when exiting would violate containment, typically by attempting to exit more levels than previously entered.
    • exit

      void exit(int depth)
      Move the cursor up by specified amounts of steps from the current position. This is equivalent of invoking exit() multiple times, except the operation is performed atomically.
      Parameters:
      depth - number of steps to exit
      Throws:
      IllegalArgumentException - when depth is negative.
      IllegalStateException - when exiting would violate containment, typically by attempting to exit more levels than previously entered.
    • readNode

      Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode> readNode(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child)
      Read a particular node from the snapshot.
      Parameters:
      child - Child identifier
      Returns:
      Optional result encapsulating the presence and value of the node
      Throws:
      BackendFailedException - when implementation-specific error occurs while servicing the request.
      IllegalArgumentException - when specified path does not identify a valid child.
    • close

      void close()
      Close this cursor. Attempting any further operations on the cursor will lead to undefined behavior.
      Specified by:
      close in interface AutoCloseable