Class TransactionChainManager
java.lang.Object
org.opendaylight.openflowplugin.common.txchain.TransactionChainManager
- All Implemented Interfaces:
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
ConstructorDescriptionTransactionChainManager
(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, String nodeId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Method change status for TxChainManager to WORKING and it has to make registration for this instance as aTransactionChain
callback to provide possibility a make DS transactions.<T extends org.opendaylight.yangtools.yang.binding.DataObject>
voidaddDeleteOperationToTxChain
(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path) void
close()
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.yang.binding.DataObject>
voidmergeToTransaction
(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data, boolean createParents) <T extends org.opendaylight.yangtools.yang.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.yang.binding.DataObject>
voidwriteToTransaction
(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data, boolean createParents)
-
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 aTransactionChain
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.yang.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.yang.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.yang.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.yang.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 interfaceAutoCloseable
-
acquireWriteTransactionLock
public void acquireWriteTransactionLock() -
releaseWriteTransactionLock
public void releaseWriteTransactionLock()
-