Class NotifyingDataChangeListener
java.lang.Object
org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener
- All Implemented Interfaces:
AutoCloseable
,org.opendaylight.mdsal.binding.api.DataTreeChangeListener<org.opendaylight.yangtools.binding.DataObject>
public final class NotifyingDataChangeListener
extends Object
implements AutoCloseable, org.opendaylight.mdsal.binding.api.DataTreeChangeListener<org.opendaylight.yangtools.binding.DataObject>
This class provides methods for checking or waiting for various md-sal operations to complete.
Once an instance is created one must invoke the registerDataChangeListener method
with a DataBroker.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionNotifyingDataChangeListener
(org.opendaylight.mdsal.common.api.LogicalDatastoreType type, int mask, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> iid, List<NotifyingDataChangeListener> waitList) NotifyingDataChangeListener
(org.opendaylight.mdsal.common.api.LogicalDatastoreType type, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> iid, List<NotifyingDataChangeListener> waitList) Create a new NotifyingDataChangeListener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
close()
boolean
isCreated
(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path) boolean
isRemoved
(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path) boolean
isUpdated
(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path) void
modify
(org.opendaylight.mdsal.common.api.LogicalDatastoreType newType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> newIid) Completely reset the state of this NotifyingDataChangeListener.void
onDataTreeChanged
(List<org.opendaylight.mdsal.binding.api.DataTreeModification<org.opendaylight.yangtools.binding.DataObject>> changes) void
registerDataChangeListener
(org.opendaylight.mdsal.binding.api.DataBroker dataBroker) void
setlisten
(boolean value) void
setMask
(int mask) void
void
waitForCreation
(long timeout) void
void
waitForDeletion
(long timeout) void
void
waitForUpdate
(long timeout) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opendaylight.mdsal.binding.api.DataTreeChangeListener
onInitialData
-
Field Details
-
BIT_CREATE
public static final int BIT_CREATE- See Also:
-
BIT_UPDATE
public static final int BIT_UPDATE- See Also:
-
BIT_DELETE
public static final int BIT_DELETE- See Also:
-
BIT_ALL
public static final int BIT_ALL- See Also:
-
-
Constructor Details
-
NotifyingDataChangeListener
public NotifyingDataChangeListener(org.opendaylight.mdsal.common.api.LogicalDatastoreType type, int mask, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> iid, List<NotifyingDataChangeListener> waitList) -
NotifyingDataChangeListener
public NotifyingDataChangeListener(org.opendaylight.mdsal.common.api.LogicalDatastoreType type, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> iid, List<NotifyingDataChangeListener> waitList) Create a new NotifyingDataChangeListener.- Parameters:
type
- DataStore typeiid
- of the md-sal object we're waiting forwaitList
- for tracking outstanding changes
-
-
Method Details
-
modify
public void modify(org.opendaylight.mdsal.common.api.LogicalDatastoreType newType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> newIid) Completely reset the state of this NotifyingDataChangeListener.- Parameters:
newType
- DataStore typenewIid
- of the md-sal object we're waiting for
-
setlisten
public void setlisten(boolean value) -
setMask
public void setMask(int mask) -
onDataTreeChanged
public void onDataTreeChanged(List<org.opendaylight.mdsal.binding.api.DataTreeModification<org.opendaylight.yangtools.binding.DataObject>> changes) - Specified by:
onDataTreeChanged
in interfaceorg.opendaylight.mdsal.binding.api.DataTreeChangeListener<org.opendaylight.yangtools.binding.DataObject>
-
isCreated
public boolean isCreated(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path) -
isUpdated
public boolean isUpdated(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path) -
isRemoved
public boolean isRemoved(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path) -
clear
public void clear() -
registerDataChangeListener
public void registerDataChangeListener(org.opendaylight.mdsal.binding.api.DataBroker dataBroker) -
waitForCreation
- Throws:
InterruptedException
-
waitForCreation
- Throws:
InterruptedException
-
waitForUpdate
- Throws:
InterruptedException
-
waitForUpdate
- Throws:
InterruptedException
-
waitForDeletion
- Throws:
InterruptedException
-
waitForDeletion
- Throws:
InterruptedException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-