public class InMemoryDOMDataStore extends SnapshotBackedWriteTransaction.TransactionReadyPrototype<String> implements DOMStore, org.opendaylight.yangtools.concepts.Identifiable<String>, org.opendaylight.yangtools.yang.model.api.SchemaContextListener, AutoCloseable, DOMStoreTreeChangePublisher
DOMStore
which uses DataTree
and other
classes such as SnapshotBackedWriteTransaction
.
SnapshotBackedReadTransaction
to implement DOMStore
contract.Constructor and Description |
---|
InMemoryDOMDataStore(String name,
ExecutorService dataChangeListenerExecutor) |
InMemoryDOMDataStore(String name,
ExecutorService dataChangeListenerExecutor,
int maxDataChangeListenerQueueSize,
boolean debugTransactions) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
DOMStoreTransactionChain |
createTransactionChain()
Creates new transaction chain.
|
boolean |
getDebugTransactions() |
String |
getIdentifier() |
DOMStoreReadTransaction |
newReadOnlyTransaction()
Creates a read only transaction
|
DOMStoreReadWriteTransaction |
newReadWriteTransaction()
Creates Read-Write transaction
|
DOMStoreWriteTransaction |
newWriteOnlyTransaction()
Creates write only transaction
|
void |
onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext ctx) |
<L extends DOMDataTreeChangeListener> |
registerTreeChangeListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier treeId,
L listener)
Registers a
DOMDataTreeChangeListener to receive
notifications when data changes under a given path in the conceptual data
tree. |
void |
setCloseable(AutoCloseable closeable) |
protected void |
transactionAborted(SnapshotBackedWriteTransaction<String> tx)
Called when a transaction is closed without being readied.
|
protected DOMStoreThreePhaseCommitCohort |
transactionReady(SnapshotBackedWriteTransaction<String> tx,
org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification modification)
Returns a commit coordinator associated with supplied transactions.
|
public InMemoryDOMDataStore(String name, ExecutorService dataChangeListenerExecutor)
public InMemoryDOMDataStore(String name, ExecutorService dataChangeListenerExecutor, int maxDataChangeListenerQueueSize, boolean debugTransactions)
public void setCloseable(AutoCloseable closeable)
public final String getIdentifier()
getIdentifier
in interface org.opendaylight.yangtools.concepts.Identifiable<String>
public DOMStoreReadTransaction newReadOnlyTransaction()
DOMStoreTransactionFactory
Creates a new read-only transaction, which provides read access to
snapshot of current state.
See DOMStoreReadTransaction
for more information.
newReadOnlyTransaction
in interface DOMStoreTransactionFactory
DOMStoreReadTransaction
public DOMStoreReadWriteTransaction newReadWriteTransaction()
DOMStoreTransactionFactory
See DOMStoreReadWriteTransaction
for more information.
newReadWriteTransaction
in interface DOMStoreTransactionFactory
DOMStoreWriteTransaction
public DOMStoreWriteTransaction newWriteOnlyTransaction()
DOMStoreTransactionFactory
See DOMStoreWriteTransaction
for more information.
newWriteOnlyTransaction
in interface DOMStoreTransactionFactory
DOMStoreWriteTransaction
public DOMStoreTransactionChain createTransactionChain()
DOMStore
DOMStoreTransactionChain
for more information.createTransactionChain
in interface DOMStore
public void onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext ctx)
onGlobalContextUpdated
in interface org.opendaylight.yangtools.yang.model.api.SchemaContextListener
public void close()
close
in interface AutoCloseable
public final boolean getDebugTransactions()
public <L extends DOMDataTreeChangeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerTreeChangeListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier treeId, L listener)
DOMStoreTreeChangePublisher
DOMDataTreeChangeListener
to receive
notifications when data changes under a given path in the conceptual data
tree.
You are able to register for notifications for any node or subtree
which can be represented using YangInstanceIdentifier
.
You are able to register for data change notifications for a subtree or leaf even if it does not exist. You will receive notification once that node is created.
If there is any pre-existing data in data tree on path for which you are registering, you will receive initial data change event, which will contain all pre-existing data, marked as created.
This method returns a ListenerRegistration
object. To
"unregister" your listener for changes call the ListenerRegistration.close()
method on this returned object.
You MUST explicitly unregister your listener when you no longer want to receive notifications. This is especially true in OSGi environments, where failure to do so during bundle shutdown can lead to stale listeners being still registered.
registerTreeChangeListener
in interface DOMStoreTreeChangePublisher
treeId
- Data tree identifier of the subtree which should be watched for
changes.listener
- Listener instance which is being registeredListenerRegistration.close()
to stop
delivery of change events.protected void transactionAborted(SnapshotBackedWriteTransaction<String> tx)
SnapshotBackedWriteTransaction.TransactionReadyPrototype
transactionAborted
in class SnapshotBackedWriteTransaction.TransactionReadyPrototype<String>
tx
- Transaction which got aborted.protected DOMStoreThreePhaseCommitCohort transactionReady(SnapshotBackedWriteTransaction<String> tx, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification modification)
SnapshotBackedWriteTransaction.TransactionReadyPrototype
transactionReady
in class SnapshotBackedWriteTransaction.TransactionReadyPrototype<String>
tx
- Transaction on which ready was invoked.modification
- Modified data tree which has been constructed.Copyright © 2017 OpenDaylight. All rights reserved.