Interface DOMStoreReadTransaction
- All Superinterfaces:
AutoCloseable
,DOMStoreTransaction
,Identifiable<Object>
- All Known Subinterfaces:
DOMStoreReadWriteTransaction
- All Known Implementing Classes:
SnapshotBackedReadTransaction
,SnapshotBackedReadWriteTransaction
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull FluentFuture<DOMQueryResult>
Executes a query on the provided logical data store.exists
(YangInstanceIdentifier path) Checks if data is available in the logical data store located at provided path.read
(YangInstanceIdentifier path) Reads data from provided logical data store located at provided path.Methods inherited from interface org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction
close, getIdentifier
-
Method Details
-
read
Reads data from provided logical data store located at provided path.- Parameters:
path
- Path which uniquely identifies subtree which client want to read- Returns:
- a FluentFuture containing the result of the read. The Future blocks until the
commit operation is complete. Once complete:
- If the data at the supplied path exists, the Future returns an Optional object containing the data.
- If the data at the supplied path does not exist, the Future returns Optional.empty().
- If the read of the data fails, the Future will fail with a
ReadFailedException
or an exception derived from ReadFailedException.
-
exists
Checks if data is available in the logical data store located at provided path.Note: a successful result from this method makes no guarantee that a subsequent call to
read(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
will succeed. It is possible that the data resides in a data store on a remote node and, if that node goes down or a network failure occurs, a subsequent read would fail. Another scenario is if the data is deleted in between the calls toexists
andread
- Parameters:
path
- Path which uniquely identifies subtree which client want to check existence of- Returns:
- a FluentFuture containing the result of the check.
- If the data at the supplied path exists, the Future returns a Boolean whose value is true, false otherwise
- If checking for the data fails, the Future will fail with a
ReadFailedException
or an exception derived from ReadFailedException.
-
execute
Executes a query on the provided logical data store.Default operation invokes
read(query.getRoot())
and then executes the result withDOMQueryEvaluator
. Implementations are encouraged to provide a more efficient implementation as appropriate.- Parameters:
query
- DOMQuery to execute- Returns:
- a FluentFuture containing the result of the query. The Future blocks until the operation is complete.
Once complete:
- The Future returns the result of the query
- If the query execution fails, the Future will fail with a
ReadFailedException
or an exception derived from ReadFailedException.
- Throws:
NullPointerException
- if any of the arguments is nullIllegalArgumentException
- if the query is not supported
-