public class InMemoryDOMDataStore extends SnapshotBackedWriteTransaction.TransactionReadyPrototype<String> implements DOMStore, org.opendaylight.yangtools.concepts.Identifiable<String>, org.opendaylight.yangtools.yang.model.api.SchemaContextListener, AutoCloseable, DOMStoreTreeChangePublisher
Implementation of DOMStore which uses DataTree and other
classes such as SnapshotBackedWriteTransaction.
SnapshotBackedReadTransaction to implement DOMStore
contract.
| Constructor and Description |
|---|
InMemoryDOMDataStore(String name,
org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration config,
ExecutorService dataChangeListenerExecutor,
int maxDataChangeListenerQueueSize,
boolean debugTransactions) |
InMemoryDOMDataStore(String name,
ExecutorService dataChangeListenerExecutor) |
InMemoryDOMDataStore(String name,
ExecutorService dataChangeListenerExecutor,
int maxDataChangeListenerQueueSize,
boolean debugTransactions) |
InMemoryDOMDataStore(String name,
LogicalDatastoreType type,
ExecutorService dataChangeListenerExecutor,
int maxDataChangeListenerQueueSize,
boolean debugTransactions) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
DOMStoreTransactionChain |
createTransactionChain()
Creates new transaction chain.
|
org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager<?,?> |
getDataChangeListenerNotificationManager() |
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,
Exception readyError)
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 InMemoryDOMDataStore(String name, LogicalDatastoreType type, ExecutorService dataChangeListenerExecutor, int maxDataChangeListenerQueueSize, boolean debugTransactions)
public InMemoryDOMDataStore(String name, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration config, ExecutorService dataChangeListenerExecutor, int maxDataChangeListenerQueueSize, boolean debugTransactions)
public org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager<?,?> getDataChangeListenerNotificationManager()
public void setCloseable(AutoCloseable closeable)
public final String getIdentifier()
getIdentifier in interface org.opendaylight.yangtools.concepts.Identifiable<String>public DOMStoreReadTransaction newReadOnlyTransaction()
DOMStoreTransactionFactoryCreates a new read-only transaction, which provides read access to snapshot of current state.
See DOMStoreReadTransaction for more information.
newReadOnlyTransaction in interface DOMStoreTransactionFactoryDOMStoreReadTransactionpublic DOMStoreReadWriteTransaction newReadWriteTransaction()
DOMStoreTransactionFactory
See DOMStoreReadWriteTransaction for more information.
newReadWriteTransaction in interface DOMStoreTransactionFactoryDOMStoreWriteTransactionpublic DOMStoreWriteTransaction newWriteOnlyTransaction()
DOMStoreTransactionFactory
See DOMStoreWriteTransaction for more information.
newWriteOnlyTransaction in interface DOMStoreTransactionFactoryDOMStoreWriteTransactionpublic DOMStoreTransactionChain createTransactionChain()
DOMStoreTransactions in a chain need to be committed in sequence and each transaction should see the effects of previous transactions as if they happened.
See DOMStoreTransactionChain for more information.
createTransactionChain in interface DOMStorepublic void onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext ctx)
onGlobalContextUpdated in interface org.opendaylight.yangtools.yang.model.api.SchemaContextListenerpublic void close()
close in interface AutoCloseablepublic final boolean getDebugTransactions()
public <L extends DOMDataTreeChangeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerTreeChangeListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier treeId, L listener)
DOMStoreTreeChangePublisherDOMDataTreeChangeListener 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. If the data at the supplied path does not exist, you will also receive initial data change event, which will contain empty data tree modification, marked as unmodified.
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 DOMStoreTreeChangePublishertreeId - 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.TransactionReadyPrototypetransactionAborted 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, Exception readyError)
SnapshotBackedWriteTransaction.TransactionReadyPrototypetransactionReady in class SnapshotBackedWriteTransaction.TransactionReadyPrototype<String>tx - Transaction on which ready was invoked.modification - Modified data tree which has been constructed.readyError - Any error that has already happened when readying.Copyright © 2018 OpenDaylight. All rights reserved.