@Beta public class InMemoryDOMDataTreeShard extends Object implements ReadableWriteableDOMDataTreeShard, org.opendaylight.yangtools.yang.model.api.SchemaContextListener
Modifier and Type | Method and Description |
---|---|
static InMemoryDOMDataTreeShard |
create(DOMDataTreeIdentifier id,
Executor dataTreeChangeExecutor,
int maxDataChangeListenerQueueSize) |
static InMemoryDOMDataTreeShard |
create(DOMDataTreeIdentifier id,
Executor dataTreeChangeExecutor,
int maxDataChangeListenerQueueSize,
int submitQueueSize) |
org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataTreeShardProducer |
createProducer(Collection<DOMDataTreeIdentifier> prefixes)
Create a producer that has the ability to write into the provided subtrees.
|
Collection<org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataTreeShardProducer> |
getProducers() |
void |
onChildAttached(DOMDataTreeIdentifier childPrefix,
DOMDataTreeShard child)
Invoked whenever a child is getting attached as a more specific prefix under this shard.
|
void |
onChildDetached(DOMDataTreeIdentifier childPrefix,
DOMDataTreeShard child)
Invoked whenever a child is getting detached as a more specific prefix under this shard.
|
void |
onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext context) |
<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. |
public static InMemoryDOMDataTreeShard create(DOMDataTreeIdentifier id, Executor dataTreeChangeExecutor, int maxDataChangeListenerQueueSize)
public static InMemoryDOMDataTreeShard create(DOMDataTreeIdentifier id, Executor dataTreeChangeExecutor, int maxDataChangeListenerQueueSize, int submitQueueSize)
public void onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext context)
onGlobalContextUpdated
in interface org.opendaylight.yangtools.yang.model.api.SchemaContextListener
public void onChildAttached(DOMDataTreeIdentifier childPrefix, DOMDataTreeShard child)
DOMDataTreeShard
onChildAttached
in interface DOMDataTreeShard
childPrefix
- Child's prefixchild
- Child shardpublic void onChildDetached(DOMDataTreeIdentifier childPrefix, DOMDataTreeShard child)
DOMDataTreeShard
onChildDetached
in interface DOMDataTreeShard
childPrefix
- Child's prefixchild
- Child shardpublic org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataTreeShardProducer createProducer(Collection<DOMDataTreeIdentifier> prefixes)
WriteableDOMDataTreeShard
createProducer
in interface WriteableDOMDataTreeShard
prefixes
- Subtrees that the caller wants to write into.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. 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 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.public Collection<org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataTreeShardProducer> getProducers()
Copyright © 2019 OpenDaylight. All rights reserved.