Class TransactionChainManager

java.lang.Object
org.opendaylight.openflowplugin.common.txchain.TransactionChainManager
All Implemented Interfaces:
AutoCloseable

public class TransactionChainManager extends Object implements AutoCloseable
The openflowplugin-impl.org.opendaylight.openflowplugin.impl.device package protected class for controlling WriteTransaction life cycle. It listens on chains and provides package-protected methods for writeToTransaction method (wrapped WriteOperations.put(LogicalDatastoreType, InstanceIdentifier, DataObject)) and submitTransaction method (wrapped WriteTransaction.commit()).
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransactionChainManager(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, String nodeId)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    Method change status for TxChainManager to WORKING and it has to make registration for this instance as a TransactionChain callback to provide possibility a make DS transactions.
    <T extends org.opendaylight.yangtools.binding.DataObject>
    void
    addDeleteOperationToTxChain(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
     
    void
     
    com.google.common.util.concurrent.FluentFuture<?>
    Method change status for TxChainManger to SLEEPING and it unregisters this instance so it broke a possibility to write something to DS.
    boolean
     
    <T extends org.opendaylight.yangtools.binding.DataObject>
    void
    mergeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data, boolean createParents)
     
    <T extends org.opendaylight.yangtools.binding.DataObject>
    com.google.common.util.concurrent.ListenableFuture<Optional<T>>
    readFromTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
     
    void
     
    com.google.common.util.concurrent.FluentFuture<?>
     
    @org.checkerframework.checker.lock.qual.GuardedBy({"txLock"}) boolean
     
    @org.checkerframework.checker.lock.qual.GuardedBy({"txLock"}) boolean
    submitTransaction(boolean doSync)
     
    <T extends org.opendaylight.yangtools.binding.DataObject>
    void
    writeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data, boolean createParents)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TransactionChainManager

      public TransactionChainManager(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, String nodeId)
  • Method Details

    • initialSubmitWriteTransaction

      public boolean initialSubmitWriteTransaction()
    • activateTransactionManager

      public void activateTransactionManager()
      Method change status for TxChainManager to WORKING and it has to make registration for this instance as a TransactionChain callback to provide possibility a make DS transactions. Call this method for MASTER role only.
    • deactivateTransactionManager

      public com.google.common.util.concurrent.FluentFuture<?> deactivateTransactionManager()
      Method change status for TxChainManger to SLEEPING and it unregisters this instance so it broke a possibility to write something to DS. Call this method for SLAVE only.
      Returns:
      Future competing when deactivation completes
    • submitTransaction

      public @org.checkerframework.checker.lock.qual.GuardedBy({"txLock"}) boolean submitTransaction()
    • submitTransaction

      public @org.checkerframework.checker.lock.qual.GuardedBy({"txLock"}) boolean submitTransaction(boolean doSync)
    • addDeleteOperationToTxChain

      public <T extends org.opendaylight.yangtools.binding.DataObject> void addDeleteOperationToTxChain(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
    • writeToTransaction

      public <T extends org.opendaylight.yangtools.binding.DataObject> void writeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data, boolean createParents)
    • mergeToTransaction

      public <T extends org.opendaylight.yangtools.binding.DataObject> void mergeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data, boolean createParents)
    • readFromTransaction

      public <T extends org.opendaylight.yangtools.binding.DataObject> com.google.common.util.concurrent.ListenableFuture<Optional<T>> readFromTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
    • shuttingDown

      public com.google.common.util.concurrent.FluentFuture<?> shuttingDown()
    • close

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

      public void acquireWriteTransactionLock()
    • releaseWriteTransactionLock

      public void releaseWriteTransactionLock()