Class BindingDOMDataBrokerAdapter

    • Constructor Detail

    • Method Detail

      • newReadOnlyTransaction

        public ReadTransaction newReadOnlyTransaction()
        Description copied from interface: TransactionFactory
        Allocates a new read-only transaction which provides an immutable snapshot of the data tree. The view of data tree is an immutable snapshot of current data tree state when transaction was allocated.
        Specified by:
        newReadOnlyTransaction in interface TransactionFactory
        Returns:
        A new read-only transaction
      • newWriteOnlyTransaction

        public WriteTransaction newWriteOnlyTransaction()
        Description copied from interface: TransactionFactory
        Allocates new write-only transaction based on latest state of data tree.

        Preconditions for mutation of data tree are captured from the snapshot of data tree state, when the transaction is allocated. If data was changed during transaction in an incompatible way then the commit of this transaction will fail. See WriteTransaction.commit() for more details about conflicting and not-conflicting changes and failure scenarios.

        Since this transaction does not provide a view of the data it SHOULD BE used only by callers who are exclusive writers (exporters of data) to the subtree they modify. This prevents optimistic lock failures as described in WriteTransaction.commit().

        Exclusivity of writers to particular subtree SHOULD BE enforced by external locking mechanism.

        Specified by:
        newWriteOnlyTransaction in interface TransactionFactory
        Returns:
        new write-only transaction
      • newReadWriteTransaction

        public ReadWriteTransaction newReadWriteTransaction()
        Description copied from interface: TransactionFactory
        Allocates new read-write transaction which provides a mutable view of the data tree.

        Preconditions for mutation of data tree are captured from the snapshot of data tree state, when the transaction is allocated. If data was changed during transaction in an incompatible way then the commit of this transaction will fail. See WriteTransaction.commit() for more details about conflicting and non-conflicting changes and failure scenarios.

        Specified by:
        newReadWriteTransaction in interface TransactionFactory
        Returns:
        new read-write transaction
      • createTransactionChain

        public TransactionChain createTransactionChain​(TransactionChainListener listener)
        Description copied from interface: DataBroker
        Create a new transaction chain. The chain will be initialized to read from its backing datastore, with no outstanding transaction. Listener will be registered to handle chain-level events.
        Specified by:
        createTransactionChain in interface DataBroker
        Parameters:
        listener - Transaction chain event listener
        Returns:
        A new transaction chain.
      • createMergingTransactionChain

        public TransactionChain createMergingTransactionChain​(TransactionChainListener listener)
        Description copied from interface: DataBroker
        Create a new transaction chain. The chain will be initialized to read from its backing datastore, with no outstanding transaction. Listener will be registered to handle chain-level events.

        Unlike DataBroker.createTransactionChain(TransactionChainListener), the transaction chain returned by this method is allowed to merge individual transactions into larger chunks. When transactions are merged, the results must be indistinguishable from the result of all operations having been performed on a single transaction.

        When transactions are merged, TransactionChain.newReadOnlyTransaction() may actually be backed by a read-write transaction, hence an additional restriction on API use is that multiple read-only transactions may not be open at the same time.

        Specified by:
        createMergingTransactionChain in interface DataBroker
        Parameters:
        listener - Transaction chain event listener
        Returns:
        A new transaction chain.
      • registerDataTreeChangeListener

        public <T extends DataObject,​L extends DataTreeChangeListener<T>> ListenerRegistration<L> registerDataTreeChangeListener​(DataTreeIdentifier<T> treeId,
                                                                                                                                       L listener)
        Description copied from interface: DataTreeChangeService
        Registers a DataTreeChangeListener 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 DataTreeIdentifier.

        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 the data tree for the path for which you are registering, you will receive an 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 the 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.

        Specified by:
        registerDataTreeChangeListener in interface DataTreeChangeService
        Parameters:
        treeId - Data tree identifier of the subtree which should be watched for changes.
        listener - Listener instance which is being registered
        Returns:
        Listener registration object, which may be used to unregister your listener using ListenerRegistration.close() to stop delivery of change events.