public abstract class AbstractDataStore extends Object implements DistributedDataStoreInterface, org.opendaylight.yangtools.yang.model.api.SchemaContextListener, DatastoreContextPropertiesUpdater.Listener, DOMStoreTreeChangePublisher, org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohortRegistry, AutoCloseable
Modifier | Constructor and Description |
---|---|
protected |
AbstractDataStore(ActorContext actorContext,
ClientIdentifier identifier) |
protected |
AbstractDataStore(ActorContext actorContext,
ClientIdentifier identifier,
DataStoreClient clientActor) |
protected |
AbstractDataStore(akka.actor.ActorSystem actorSystem,
ClusterWrapper cluster,
Configuration configuration,
DatastoreContextFactory datastoreContextFactory,
DatastoreSnapshot restoreFromSnapshot) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ActorContext |
getActorContext() |
protected DataStoreClient |
getClient() |
CountDownLatch |
getWaitTillReadyCountDownLatch() |
void |
onDatastoreContextUpdated(DatastoreContextFactory contextFactory) |
void |
onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext) |
<L extends AsyncDataChangeListener<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>>> |
registerChangeListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier path,
L listener,
AsyncDataBroker.DataChangeScope scope)
Registers
AsyncDataChangeListener for Data Change callbacks which will
be triggered on the change of provided subpath. |
<C extends org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohort> |
registerCommitCohort(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier subtree,
C cohort) |
<L extends DOMDataTreeChangeListener> |
registerProxyListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier shardLookup,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier insideShard,
org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener delegate) |
<L extends DOMDataTreeChangeListener> |
registerShardConfigListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier internalPath,
DOMDataTreeChangeListener delegate) |
<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) |
void |
waitTillReady() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTransactionChain
newReadOnlyTransaction, newReadWriteTransaction, newWriteOnlyTransaction
protected AbstractDataStore(akka.actor.ActorSystem actorSystem, ClusterWrapper cluster, Configuration configuration, DatastoreContextFactory datastoreContextFactory, DatastoreSnapshot restoreFromSnapshot)
protected AbstractDataStore(ActorContext actorContext, ClientIdentifier identifier)
protected AbstractDataStore(ActorContext actorContext, ClientIdentifier identifier, DataStoreClient clientActor)
protected final DataStoreClient getClient()
public void setCloseable(AutoCloseable closeable)
public <L extends AsyncDataChangeListener<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>>> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerChangeListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier path, L listener, AsyncDataBroker.DataChangeScope scope)
DOMStore
AsyncDataChangeListener
for Data Change callbacks which will
be triggered on the change of provided subpath. What constitutes a change
depends on the @scope parameter.
Listener upon registration receives an initial callback
AsyncDataChangeListener.onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)
which contains stable view of data tree at the time of registration.
@param path Path (subtree identifier) on which client listener will be
invoked.registerChangeListener
in interface DOMStore
listener
- Instance of listener which should be invoked onscope
- Scope of change which triggers callback.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.public <C extends org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohort> org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohortRegistration<C> registerCommitCohort(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier subtree, C cohort)
registerCommitCohort
in interface org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohortRegistry
public void onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext)
onGlobalContextUpdated
in interface org.opendaylight.yangtools.yang.model.api.SchemaContextListener
public void onDatastoreContextUpdated(DatastoreContextFactory contextFactory)
onDatastoreContextUpdated
in interface DatastoreContextPropertiesUpdater.Listener
public void close()
close
in interface AutoCloseable
public ActorContext getActorContext()
getActorContext
in interface DistributedDataStoreInterface
public void waitTillReady()
public CountDownLatch getWaitTillReadyCountDownLatch()
public <L extends DOMDataTreeChangeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerProxyListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier shardLookup, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier insideShard, org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener delegate)
public <L extends DOMDataTreeChangeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerShardConfigListener(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier internalPath, DOMDataTreeChangeListener delegate)
Copyright © 2019 OpenDaylight. All rights reserved.