Class NotifyingDataChangeListener

java.lang.Object
org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener
All Implemented Interfaces:
AutoCloseable, EventListener, org.opendaylight.mdsal.binding.api.DataTreeChangeListener<org.opendaylight.yangtools.yang.binding.DataObject>

public final class NotifyingDataChangeListener extends Object implements AutoCloseable, org.opendaylight.mdsal.binding.api.DataTreeChangeListener<org.opendaylight.yangtools.yang.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 Details

  • 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 type
      iid - of the md-sal object we're waiting for
      waitList - 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 type
      newIid - 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(Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<org.opendaylight.yangtools.yang.binding.DataObject>> changes)
      Specified by:
      onDataTreeChanged in interface org.opendaylight.mdsal.binding.api.DataTreeChangeListener<org.opendaylight.yangtools.yang.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

      public void waitForCreation() throws InterruptedException
      Throws:
      InterruptedException
    • waitForCreation

      public void waitForCreation(long timeout) throws InterruptedException
      Throws:
      InterruptedException
    • waitForUpdate

      public void waitForUpdate() throws InterruptedException
      Throws:
      InterruptedException
    • waitForUpdate

      public void waitForUpdate(long timeout) throws InterruptedException
      Throws:
      InterruptedException
    • waitForDeletion

      public void waitForDeletion() throws InterruptedException
      Throws:
      InterruptedException
    • waitForDeletion

      public void waitForDeletion(long timeout) throws InterruptedException
      Throws:
      InterruptedException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable