@Beta public class BindingDOMDataBrokerAdapter extends AbstractForwardedDataBroker implements DataBroker, DataTreeService
Besides this the DataBrokerImpl and it's collaborators also cache data that is already transformed from the binding independent to binding aware format
Modifier and Type | Field and Description |
---|---|
static BindingDOMAdapterBuilder.Factory<DataBroker> |
BUILDER_FACTORY |
Constructor and Description |
---|
BindingDOMDataBrokerAdapter(DOMDataBroker domDataBroker,
BindingToNormalizedNodeCodec codec) |
Modifier and Type | Method and Description |
---|---|
DataTreeProducer |
createProducer(Collection<DataTreeIdentifier<?>> subtrees)
Create a producer, which is able to access to a set of trees.
|
BindingTransactionChain |
createTransactionChain(TransactionChainListener listener)
Create a new transaction chain.
|
ReadTransaction |
newReadOnlyTransaction()
Allocates a new read-only transaction which provides an immutable snapshot of
the data tree.
|
AsyncReadWriteTransaction<InstanceIdentifier<?>,TreeNode> |
newReadWriteTransaction()
Allocates new read-write transaction which provides a mutable view of the data tree.
|
WriteTransaction |
newWriteOnlyTransaction()
Allocates new write-only transaction based on latest state of data tree.
|
<T extends DataTreeListener> |
registerListener(T listener,
Collection<DataTreeIdentifier<?>> subtrees,
boolean allowRxMerges,
Collection<DataTreeProducer> producers)
Register a
DataTreeListener instance. |
close, getCodec, getDelegate, toBinding, toBinding, toBindingData
public static final BindingDOMAdapterBuilder.Factory<DataBroker> BUILDER_FACTORY
public BindingDOMDataBrokerAdapter(DOMDataBroker domDataBroker, BindingToNormalizedNodeCodec codec)
public ReadTransaction newReadOnlyTransaction()
AsyncDataTransactionFactory
The view of data tree is an immutable snapshot of current data tree state when transaction was allocated.
newReadOnlyTransaction
in interface DataBroker
newReadOnlyTransaction
in interface TransactionFactory
newReadOnlyTransaction
in interface AsyncDataBroker<InstanceIdentifier<?>,TreeNode>
newReadOnlyTransaction
in interface AsyncDataTransactionFactory<InstanceIdentifier<?>,TreeNode>
public WriteTransaction newWriteOnlyTransaction()
AsyncDataTransactionFactory
Preconditions for mutation of data tree are captured from the snapshot of data tree state,
when the transaction is allocated. If data was changed during transaction in an incompatible
way then the commit of this transaction will fail. See AsyncWriteTransaction.submit()
for more details about conflicting and not-conflicting changes and failure scenarios.
Since this transaction does not provide a view of the data it SHOULD BE used only by callers
which are exclusive writers (exporters of data) to the subtree they modify. This prevents
optimistic lock failures as described in AsyncWriteTransaction.submit()
.
Exclusivity of writers to particular subtree SHOULD BE enforced by external locking mechanism.
newWriteOnlyTransaction
in interface DataBroker
newWriteOnlyTransaction
in interface TransactionFactory
newWriteOnlyTransaction
in interface AsyncDataBroker<InstanceIdentifier<?>,TreeNode>
newWriteOnlyTransaction
in interface AsyncDataTransactionFactory<InstanceIdentifier<?>,TreeNode>
public AsyncReadWriteTransaction<InstanceIdentifier<?>,TreeNode> newReadWriteTransaction()
AsyncDataTransactionFactory
Preconditions for mutation of data tree are captured from the snapshot of data tree state, when the transaction
is allocated. If data was changed during transaction in an incompatible way then the commit of this transaction
will fail. See AsyncWriteTransaction.submit()
for more details about conflicting and not-conflicting
changes and failure scenarios.
newReadWriteTransaction
in interface AsyncDataBroker<InstanceIdentifier<?>,TreeNode>
newReadWriteTransaction
in interface AsyncDataTransactionFactory<InstanceIdentifier<?>,TreeNode>
public BindingTransactionChain createTransactionChain(TransactionChainListener listener)
TransactionChainFactory
createTransactionChain
in interface DataBroker
createTransactionChain
in interface TransactionChainFactory<InstanceIdentifier<?>,TreeNode>
listener
- Transaction chain event listener@Nonnull public <T extends DataTreeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<T> registerListener(@Nonnull T listener, @Nonnull Collection<DataTreeIdentifier<?>> subtrees, boolean allowRxMerges, @Nonnull Collection<DataTreeProducer> producers) throws DataTreeLoopException
DataTreeService
DataTreeListener
instance. Once registered, the listener will start
receiving changes on the selected subtrees. If the listener cannot keep up with the rate of
changes, and allowRxMerges is set to true, this service is free to merge the changes, so that
a smaller number of them will be reported, possibly hiding some data transitions (like
flaps).
If the listener wants to write into any producer, that producer has to be mentioned in the call to this method. Those producers will be bound exclusively to the registration, so that accessing them outside of this listener's callback will trigger an error. Any producers mentioned must be idle, e.g. they may not have an open transaction at the time this method is invoked.
Each listener instance can be registered at most once. Implementations of this interface have to guarantee that the listener's methods will not be invoked concurrently from multiple threads.
registerListener
in interface DataTreeService
T
- listener typelistener
- DataTreeListener
that is being registeredsubtrees
- Conceptual subtree identifier of subtrees which should be monitored for
changes. May not be null or empty.allowRxMerges
- True if the backend may perform ingress state compression.producers
- DataTreeProducer
instances to bind to the listener.DataTreeLoopException
- if the registration of the listener to the specified subtrees
with specified producers would form a feedback looppublic DataTreeProducer createProducer(Collection<DataTreeIdentifier<?>> subtrees)
DataTreeProducerFactory
createProducer
in interface DataTreeProducerFactory
subtrees
- The collection of subtrees the resulting producer should have access to.DataTreeProducer
instance.Copyright © 2019 OpenDaylight. All rights reserved.