public class ForwardingReadOnlyTransaction extends com.google.common.collect.ForwardingObject implements ReadOnlyTransaction
ReadOnlyTransaction
implementation which forwards all interface method
invocation to a delegate instance.Modifier | Constructor and Description |
---|---|
protected |
ForwardingReadOnlyTransaction(ReadOnlyTransaction delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this transaction and releases all resources associated with it.
|
protected ReadTransaction |
delegate() |
com.google.common.util.concurrent.CheckedFuture<Boolean,ReadFailedException> |
exists(LogicalDatastoreType store,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
Checks if data is available in the logical data store located at provided path.
|
Object |
getIdentifier() |
<T extends org.opendaylight.yangtools.yang.binding.DataObject> |
read(LogicalDatastoreType store,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
Reads data from the provided logical data store located at the provided path.
|
protected ForwardingReadOnlyTransaction(ReadOnlyTransaction delegate)
protected ReadTransaction delegate()
delegate
in class com.google.common.collect.ForwardingObject
public <T extends org.opendaylight.yangtools.yang.binding.DataObject> com.google.common.util.concurrent.CheckedFuture<com.google.common.base.Optional<T>,ReadFailedException> read(LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
ReadTransaction
If the target is a subtree, then the whole subtree is read (and will be accessible from the returned data object).
read
in interface ReadTransaction
store
- Logical data store from which read should occur.path
- Path which uniquely identifies subtree which client want to
readReadFailedException
or an exception derived from ReadFailedException.public com.google.common.util.concurrent.CheckedFuture<Boolean,ReadFailedException> exists(LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
ReadTransaction
Note: a successful result from this method makes no guarantee that a subsequent call to ReadTransaction.read(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>)
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 to exists
and read
Default implementation delegates to ReadTransaction.read(LogicalDatastoreType, InstanceIdentifier)
, implementations
are advised to provide a more efficient override.
exists
in interface ReadTransaction
store
- Logical data store from which read should occur.path
- Path which uniquely identifies subtree which client want to
check existence ofReadFailedException
or an exception derived from ReadFailedException.public Object getIdentifier()
getIdentifier
in interface AsyncTransaction<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,org.opendaylight.yangtools.yang.binding.DataObject>
getIdentifier
in interface org.opendaylight.yangtools.concepts.Identifiable<Object>
public void close()
AsyncReadOnlyTransaction
close
in interface AutoCloseable
close
in interface AsyncReadOnlyTransaction<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,org.opendaylight.yangtools.yang.binding.DataObject>
Copyright © 2019 OpenDaylight. All rights reserved.