Interface DataTreeSnapshotCursor
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
DataTreeModificationCursor
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 TypeMethodDescriptionvoidclose()Close this cursor.voidenter(@NonNull Iterable<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> path) Move the cursor to the specified child of the current position.voidenter(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child) Move the cursor to the specified child of the current position.voidenter(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument... path) Move the cursor to the specified child of the current position.voidexit()Move the cursor up to the parent of current position.voidexit(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 ofNormalizedNodeContainer.
-
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 ofenter(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 ofNormalizedNodeContainer.
-
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 toenter(PathArgument...), except it takes anIterableargument.- 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 ofNormalizedNodeContainer.
-
exit
void exit()Move the cursor up to the parent of current position. This is equivalent of invokingexit(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 invokingexit()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:
closein interfaceAutoCloseable
-